Hello all,
I recently came across the workflow of uploading a zipped folder as an item to ArcGIS Online and having the ability to upload it as a "Photos with locations" file type, which can also place a point down at the photos' location and attach the photo to the waypoint, similar to the workflow in this blog post https://www.esri.com/about/newsroom/arcwatch/add-geotagged-photos-to-arcgis-online-web-maps.
I have been thinking about building out a web tool to place into an Experience Builder that allows my end users to use this functionality, uploading photos from an UAS for situational awareness purposes. The end goal is to append the data to an existing feature service instead of creating a new one entirely, but we'll deal with that later.
From what I have seen, this workflow will create an Image Collection, then publish that and somehow know to plot points at the exif information. I have been able to upload a small zip folder with a few geotagged UAS images to the files within my Notebooks and create an Image collection from that using "gis.content.add" (script below) however I can't figure out how to get it to actually publish properly. Anyone have any ideas or can point me in the right direction?
Adds the zipped image to my content as an image collection:
zip_path = '/arcgis/home/DJI_0001.zip'
item_props = {
"title": "Field Photos Image Collection",
"type": "Image Collection",
"tags": "photos, image collection, exif",
"snippet": "Geotagged photos uploaded as an image collection"
}
image_collection = gis.content.add(
item_properties=item_props,
data=zip_path,
file_type="zip"
)
image_collection
Suppose to publish the Image Collection as a feature service, but returns with the error "A file_type must be provide, data format not recognized"
publish_params = {
"name": "Field_Photos_Feature_Service",
"locationType": "exif",
"imageCollection": True
}
feature_service = image_collection.publish(
publish_parameters=publish_params
)
feature_service
(This post is also up in the Developers community)
Yep — your publish_parameters are fine, you’re just missing the file_type on publish(). For some uploads (like zipped image collections), AGOL can’t auto-detect the publish format and throws the exact error you’re seeing.
arcgis.gis module | ArcGIS API for Python v2.3 | Esri Developer
feature_service = image_collection.publish(
file_type="imageCollection",
publish_parameters={
"name": "Field_Photos_Feature_Service",
"locationType": "exif",
"imageCollection": True
}
)
Also double-check your zip contains only JPEGs with EXIF GPS if your goal is the “Photos with locations” point layer behavior.
https://community.esri.com/t5/arcgis-living-atlas-questions/is-esri-s-world-imagery-wayback-unreliab...
Thanks for your reply! I tested out this and have been getting a generic error message, "Unknown error, please check the data or the title of the item". Any suggestions? Attached is the image of the error (I couldn't paste in the image for some reason) The image collections appears to still be added as expected and all images are jpg with exif information.
zip_path = '/arcgis/home/DJI_0001.zip'
item_props = {
"title": "Field Photos Image Collection",
"type": "Image Collection",
"tags": "photos, image collection, exif",
"snippet": "Geotagged photos uploaded as an image collection"
}
print("Making the photo colection")
image_collection = gis.content.add(
item_properties=item_props,
data=zip_path,
file_type="zip"
)
image_collection
print("Publishing...")
feature_service = image_collection.publish(
file_type="imageCollection",
publish_parameters={
"name": "Field_Photos_Feature_Service",
"locationType": "exif",
"imageCollection": True
}
)
Yes — your approach is close, but that “Unknown error…check the data or the title” usually comes down to one of these (I’ve hit all of them):
Name/title collision: the name in publish_parameters must be globally unique in your org (try a new name like Field_Photos_FS_20251226_01).
ZIP structure: keep the JPGs at the root of the ZIP (no nested folders, no extra files like __MACOSX, thumbs.db).
EXIF GPS not truly present for all: a few images missing GPS tags can cause publish to fail (the UI silently skips; API sometimes errors).
Wrong publish path: “Photos with locations” is a hosted feature layer with attachments workflow (not always the same as publishing an “Image Collection”). ArcGIS Online supports “Publish photos with locations” from a ZIP.
https://doc.arcgis.com/en/arcgis-online/manage-data/publish-features.htm?utm_source=chatgpt.com
Quick next try (most reliable):
Re-zip with only geotagged JPGs at root
Use a new unique title/name
Publish as the photos-with-locations workflow (not image collection) — that’s the intended pattern for points + attachments.
https://doc.arcgis.com/en/arcgis-online/manage-data/publish-features.htm?utm_source=chatgpt.com