Hi,
I'm just wondering if anyone tried this.
We have a cloud based data collection system that we use, it downloads a GIS file (Shape File, Tab File, CSV, etc...) as well as images collected overnight. So the GIS file will be overwritten with the most up to date one and the photos will just be added to a photo folder. There will also be a link file linking the photos to the GIS records.
I'm wondering if there is a way to display the GIS file on ESRI online along with the photos and have them updated overnight.
Currently we are doing it manually, when we need to update, we will load up the ESRI online map in ArcGis Pro and replace the layer with the updated one and attach all photos again. We will then save the map (to ESRI online).
This is a bit inefficient as we will need to re-upload records that did not change. I know there is a way to append/ update records in ESRI online but is there a way to append/ update photos as well?
Second question is. Is there a way to group attachments/ photos together. Currently ESRI online will just have an attachment section for all attachments, is there a way to group them in say "Before photo" and "After Photo".
Thanks.
Solved! Go to Solution.
Hi @VictorZhou1 ,
Yes, it's possible to manage attachments in a feature layer using ArcGIS API for python.
This link provides an example of how to use the attachment property.
and the following link is the API reference:
and this link shows how to update/append a hosted feature layer:
I hope that helps.
======================================================================
Please give a like if helpful and Accept as Solution if it's answered your query.
Hi @VictorZhou1 ,
Yes, it's possible to manage attachments in a feature layer using ArcGIS API for python.
This link provides an example of how to use the attachment property.
and the following link is the API reference:
and this link shows how to update/append a hosted feature layer:
I hope that helps.
======================================================================
Please give a like if helpful and Accept as Solution if it's answered your query.
Thanks, the links are quite useful.
In case others who want to achieve something similar, this is how I did it:
----Update the map objects/ attribute----
1. Prepare data to be imported so it has all the information and columns
2. Upload data file to AGOL (gis.content.add)
3. Analyse data file if it is a CSV or XLSX (gis.content.analyze)
4.Update/ Append Data to existing layer (.append)
----Upload the photos----
5.Get the list of attachment/ photos that are already in that layer so you don't reupload them (Lyr_to_Update.attachments.search(where=a Query to include all records ,as_df=True)
This generates a dataframe with all attachments and their information.
6.Exclude the attachments in the above dataframe from your file that links the photo and map object.
7.Loop through the remaining entries in your file to upload photo to AGOL.