Solved

AGOL attachments - what are you doing with the attachments after you've read them?


Userlevel 4
Badge +13

I've seen lots of people over the community asking how to read AGOL attachments, but I'm curious to find out what FME users are doing with them once they've been read using FME.

icon

Best answer by trentatsafe 9 January 2018, 17:32

View original

10 replies

Badge +14

I've been trying to figure out how to move them to a SDE Geodatabase, but I've been unable to figure out a way to do it to keep the relationship with the feature I'm also pulling down. (Also see this one)

Badge +10

Hi @FMELizard,

I have been using the attachments for multiple reports. The reports have been written into PDF pages and Microsoft Excel. For some reports I also did some dynamic resizing of images, depending on the number of images that were attached to an object.

Another application I have seen is to check the number of attachments to a certain status of an object. E.g. a single image means that something needs to be fixed and a second image means it is solved and shows the prove of that. The contents of the image will not be checked, but purely the number of images vs. the status of the object.

Once I also designed a process for a client with two different services and the attachments needed to be migrated from one service to another if an object matched certain preset requirements.

Badge +10

I've been trying to figure out how to move them to a SDE Geodatabase, but I've been unable to figure out a way to do it to keep the relationship with the feature I'm also pulling down. (Also see this one)

You might want to have a look at this tutorial: Introduction to Working with Geodatabase Relationship Classes. If you keep having problems I might be able to help, but it will take quite some time, since I will have to dig into some backups.

 

Badge +6

I've been trying to figure out how to move them to a SDE Geodatabase, but I've been unable to figure out a way to do it to keep the relationship with the feature I'm also pulling down. (Also see this one)

Hello @runneals,

 

 

I was able to finalize the AGOL attachments to File Geodatabase(should be the same for an ArcSDE Geodatabase as well). In short, as Lars alluded to, you have to rebuild the relationship in FME. You can either create the Destination Feature Classes/Relationship Classes ahead of time or make use of an XML Workspace Document or a Template Geodatabase.

 

 

I have attached the workspace that should read in the AGOL attachments and rebuild the relationship between the two features. I hope that helps.

 

attachment2fgdb.fmwt

 

Hello @trentatsafe and @runneals...Thanks so much for this workspace. Appeared to work for me. However, when I retrieve the attachments, they appear to be corrupted. I cannot view them either in ArcMap, or after downloading them. Have you experienced this at all?

Thanks,

Mark

Badge +6

Hello @trentatsafe and @runneals...Thanks so much for this workspace. Appeared to work for me. However, when I retrieve the attachments, they appear to be corrupted. I cannot view them either in ArcMap, or after downloading them. Have you experienced this at all?

Thanks,

Mark

Hello @mapsrus,

In order to ensure the Attachments are written correctly, you will have to add a few transformers.

 

1) BinaryDecoder - String to Decode will be the Blob attribute(in most cases this is the data Attribute). Set the Encoding type to Base64, and the Output Encoding as fme-binary.

 

2) Add a RasterReplacer and set the Blob Attribute as the Decoded Blob from the BinaryDecoder. Select the format that the attachment is.

 

 

The BinaryDecoder is required because we extract the Attachment as a Base64 encoded Blob attribute, this needs to be converted to fme-binary to be used by the RasterReplacer. That should allow you to write the Attachments to the File Geodatabase correctly, without corrupting them.

 

 

Let me know if that helps!
Badge +10

Hello @mapsrus,

In order to ensure the Attachments are written correctly, you will have to add a few transformers.

 

1) BinaryDecoder - String to Decode will be the Blob attribute(in most cases this is the data Attribute). Set the Encoding type to Base64, and the Output Encoding as fme-binary.

 

2) Add a RasterReplacer and set the Blob Attribute as the Decoded Blob from the BinaryDecoder. Select the format that the attachment is.

 

 

The BinaryDecoder is required because we extract the Attachment as a Base64 encoded Blob attribute, this needs to be converted to fme-binary to be used by the RasterReplacer. That should allow you to write the Attachments to the File Geodatabase correctly, without corrupting them.

 

 

Let me know if that helps!

Just adding a note here:

 

Ensure that the blob attribute for the attachment data is encoded as fme-binary prior to the RasterReplacer. If it is, you do not need to use the BinaryDecoder.

 

To check this, you can use the FME Data Inspector and inspect the attribute via the Feature Information window:

 

@trentatsafe

Thanks very much for the template, worked really well fro me.

Badge +8

I transfer them onto our network in JPG for backups.

Badge +4

Hello @runneals,

 

 

I was able to finalize the AGOL attachments to File Geodatabase(should be the same for an ArcSDE Geodatabase as well). In short, as Lars alluded to, you have to rebuild the relationship in FME. You can either create the Destination Feature Classes/Relationship Classes ahead of time or make use of an XML Workspace Document or a Template Geodatabase.

 

 

I have attached the workspace that should read in the AGOL attachments and rebuild the relationship between the two features. I hope that helps.

 

attachment2fgdb.fmwt

 

Thank you so much for the template

Is there any template with gdb with attchemnt write to arcgis online to a service

 

Reply