Is it possible to copy and paste geometry between two feature layers on AGOL?

920
1
Jump to solution
10-11-2021 08:10 AM
AustinWolf1
New Contributor II

Hello All,

I was wondering if there was way to copy and paste geometry from one feature layer to another in ArcGIS Online. I love this functionality in ArcGIS Desktop, and would love to be able to do this within some applications I've created in AGOL. 

1 Solution

Accepted Solutions
mdonnelly
Esri Contributor

Hello,

This is not possible through the user interface of AGOL. However, it is possible to copy and paste in Collector/Field Maps, so that is an idea for a work around.

I know you mentioned geometry but if attribute defaults is something you are interested in then a Feature Template can help with that. You would create the Feature Template for the relevant layer before publishing to AGOL.

Otherwise it is possible to copy geometries in AGOL by using the REST API, which could be scripted up in Python. You could retrieve the geometry of a feature with a given OBJECTID, then copy it and use applyEdits on the feature service layer to add the copied feature. It could then be seen on screen in the user interface for on screen manipulation. 

The following can be used to give you inspiration to retrieve geometries and attributes from a feature service layer: 

https://developers.arcgis.com/python/guide/working-with-feature-layers-and-features/

Regards,
Mark

View solution in original post

1 Reply
mdonnelly
Esri Contributor

Hello,

This is not possible through the user interface of AGOL. However, it is possible to copy and paste in Collector/Field Maps, so that is an idea for a work around.

I know you mentioned geometry but if attribute defaults is something you are interested in then a Feature Template can help with that. You would create the Feature Template for the relevant layer before publishing to AGOL.

Otherwise it is possible to copy geometries in AGOL by using the REST API, which could be scripted up in Python. You could retrieve the geometry of a feature with a given OBJECTID, then copy it and use applyEdits on the feature service layer to add the copied feature. It could then be seen on screen in the user interface for on screen manipulation. 

The following can be used to give you inspiration to retrieve geometries and attributes from a feature service layer: 

https://developers.arcgis.com/python/guide/working-with-feature-layers-and-features/

Regards,
Mark