Skip to main content
Solved

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


fmelizard
Contributor
Forum|alt.badge.img+17

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.

Best answer by trentatsafe

runneals wrote:

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

 

View original
Did this help you find an answer to your question?

10 replies

runneals
Contributor
Forum|alt.badge.img+19
  • Contributor
  • January 8, 2018

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)


lars_de_vries
Forum|alt.badge.img+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.


lars_de_vries
Forum|alt.badge.img+10
runneals wrote:

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.

 


trentatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • Best Answer
  • January 9, 2018
runneals wrote:

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

 


  • November 22, 2018

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


trentatsafe
Safer
Forum|alt.badge.img+6
  • Safer
  • November 26, 2018
mapsrus wrote:

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!

andreaatsafe
Safer
Forum|alt.badge.img+10
trentatsafe wrote:

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:

 


  • April 3, 2019

@trentatsafe

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


philippeb
Enthusiast
Forum|alt.badge.img+18
  • Enthusiast
  • December 2, 2019

I transfer them onto our network in JPG for backups.


abnan0001
Supporter
Forum|alt.badge.img+7
  • Supporter
  • November 23, 2023
trentatsafe wrote:

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

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings