Linking attachment to feature in ArcGIS Online and ArcGIS Desktop?

5519
6
Jump to solution
08-02-2018 01:02 PM
ChristinaHoddinott1
Occasional Contributor

I have lots of utility and facility data that is constantly being added to using Collector. Oftentimes I take photos added as attachments to the features I collect. I will then export the feature layer to a FGDB and use it to update our master FGDB. Oftentimes I need to make edits on the features in ArcGIS Desktop and then republish the layer in AGOL. 

I understand that it is possible to export the images from ArcGIS Online, but is it possible to keep those images linked to the point so that way when I republish the layer onto AGOL the attachment stays with the feature? 

Should I just download the images and put them on a file in our server and hyperlink to them in the attribute table? Seems like a lot of work that way, but that's all I can think of to do at this point.

1 Solution

Accepted Solutions
MarkBockenhauer
Esri Regular Contributor

In ArcGIS Desktop or ArcGIS Pro, the Geoprocessing command "copy features" should maintain the attachments in your collector feature service.  The Features in the filed geodatabase should have the same attachments that your original collector feature service had.

If you have a filegeodatabase with attachments, if you share or publish as a service, the resulting feature service should also have the same attachments.   The attachments should stay with the features, you should not have to manage them separately.

Mark

View solution in original post

6 Replies
MarkBockenhauer
Esri Regular Contributor

In ArcGIS Desktop or ArcGIS Pro, the Geoprocessing command "copy features" should maintain the attachments in your collector feature service.  The Features in the filed geodatabase should have the same attachments that your original collector feature service had.

If you have a filegeodatabase with attachments, if you share or publish as a service, the resulting feature service should also have the same attachments.   The attachments should stay with the features, you should not have to manage them separately.

Mark

ChristinaHoddinott1
Occasional Contributor

What do you know... it worked! Thank you!

0 Kudos
SiranErysian2
New Contributor III

For Mark: or Christina if you can answer this:

 I also have the same issue. I have updated my feature layer and then republished it but this new feature does not have the photo attachments that my old hosted feature layer has. I don't understand the Copy Features tool. If this is done in Arc Map (which the illustration shows in Pro and you export the features, how can the features have the same attachments? If I overwrite the service, it creates a new hosted feature layer without the attached photos. I don't have my attachments in a file geodatabase because they are photos taken in the field. I do have them on my computer but I do have to add them all again.

0 Kudos
ChristinaHoddinott1
Occasional Contributor

This is what I have been doing...

When I want to download features from AGOL, I go to the hosted feature layer export it as a file geodatabase (FGDB). I then download the FGDB, which can then be opened in the ArcMap. If you look at the FGDB in the Catalog, you will see that for each feature layer that has attachments, there will be a a table and relationship class file. These are your attachments! 

Then I do whatever edits I need to do in ArcMap, save the map, then share as a service, overwriting the existing service. This will replace the old hosted feature layer but retain your attachments, so long as the layers in your map are from your FGDB. I do find that, for whatever reason, if the feature layer is in a map it needs to be deleted from the map (or the map deleted) and added again for the changes to be viewed in the map. 

Basically, everything needs to remain in a FGDB with the corresponding relationship class and table features in order for the attachments to stay with the features. If you import a feature class from your original FGDB to a new one, you'll notice that those two features go with it. 

Now, instead of having one large FGDB with Feature Datasets, I have multiple FGDB for each hosted feature layer. For example, I do a lot of work with utilities. So I made a map in ArcMap that has multiple feature layers relating to the electric utilities. I published the map as a hosted feature layer, which has 10 or so layers within in it. So it's not like I have a FGDB for every single layer I ever use (that would be insane). Instead I have one for electric, one for stormwater, one for gas, etc and each has many layers within it. That's how I keep my maps organized on AGOL too, so it's not as messy as it sounds. I collect data out in the field, and just download the FGDB from AGOL on a regular basis (with a date in the name) so that way I always have a hard copy on my computer. See attached picture to see what I mean... 

I'm sort of new to all this, so perhaps there is a better way, but this is the best way I've found thus far to keep everything attached and updated. If you lost your attachments to your feature layer, I honestly don't know how to get them back other than manually adding them back one by one. But this will keep you from losing them in the future!

0 Kudos
SiranErysian2
New Contributor III

Christina,

This is brilliant! I was exporting my old files from AGOL to a shapefile and then putting them into individual geodatabases but no attachments came with them so now they do! The problem I am having is that I published each individual well run (point files where data is collected twice a year on well locations) as a service. That way each location has a separate map if more than one technician is going out in the field, they have the corresponding maps and feature layers where they will collect data. When I export the previous year’s data from AGOL to a geodatabase, there is only one HFL per map thus it all goes into one GDB with the many elements. I have an additional relationship class I created for an attached table with historic data. See screen shot below. Long weird names associated with the export to FGBD….don’t know if there is anything we can do about that.

Do you think it would be possible to combine all to one giant geodatabase?

Let me know if you don’t see the screen shot.

Siran D. Erysian, M.A., GISP,

Research Analyst II – GIS

Think Spatially

Department of Water Resources

3374 E. Shields Ave, Rm. A-1, Fresno, CA 93726 (559) 230-3312

Siran.Erysian@water.ca.gov

0 Kudos
ChristinaHoddinott1
Occasional Contributor

For the long names of the exported FGDB, you can easily right-click and rename them without it affecting anything (that's what I do to help keep things more organized).

I know you can import the feature classes from the exported FGDB into a new FGDB and it will bring the associated relationship classes and tables with it. So you could make a giant geodatabase that way.

However, I've found that it's not easy to continually be moving things back and forth between one large geodatabase and AGOL. I suppose if you are only doing it a few times a year, it wouldn't be a big issue, but since I am doing it weekly, it's just too much for me. 

If you did put everything in one big FGDB, then you could add new data to a feature class from an AGOL exported FGDB using the Object Loader tool (see How To: Use the Object Loader to load data into a table). With that tool though, you must be careful to set a definition query to prevent it from creating doubles. If the feature class you're loading data from has some of the same features of the feature class you are loading data into, it doesn't recognize that. It will just add eeeeverything from one feature class into the other unless you create a definition query. I haven't messed with this a ton though to ensure attachments are coming along with it, but it certainly wouldn't take long to figure that out. If you are simply making edits to existing features in AGOL though, I haven't found a way to easily update those same features in a master FGDB.

You could also just delete the old feature class in the master FGDB and import the new, updated feature class from the AGOL FGDB. You would lose your symbology and whatnot though. For me, that's just too much to do every day/week, which is why I just keep every map in its own FGDB instead of having a master FGDB, but it may be just fine for you!

Wow, I hope some of that made sense. haha

0 Kudos