Replacing existing feature geometry with Python API

376
2
Jump to solution
01-27-2025 07:52 AM
Labels (1)
ZhongmingAn
Regular Contributor

Hi,

I have a hosted online feature service containing a polygon layer with just a circle. Now I have a more complicated geometry (more circles) and want to replace the original geometry with the new geometry without touching any of the attributes. How do I achieve that with python api?

 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
PeterKnoop
MVP Regular Contributor

You can edit a feature's geometry using the same edit_features() workflow as you would for editing its attributes, except you are updating its SHAPE property, instead of one or more of the fields in the attribute property. Some helpful resources for editing features and how polygon geometries are specified are:

View solution in original post

2 Replies
PeterKnoop
MVP Regular Contributor

You can edit a feature's geometry using the same edit_features() workflow as you would for editing its attributes, except you are updating its SHAPE property, instead of one or more of the fields in the attribute property. Some helpful resources for editing features and how polygon geometries are specified are:

ZhongmingAn
Regular Contributor

Thank you for the help!

0 Kudos