Select to view content in your preferred language

Update Geometry while using python

880
2
05-07-2010 06:56 AM
JeremyTibbetts
Emerging Contributor
Hello,
I have two fields, Northing and Easting, which hold values. However, I want to relate these fields to a geometry field in the same feature class. How would I be able to do this while using python? Can you use an update cursor on the same feature class?

Thanks,

Jeremy
0 Kudos
2 Replies
BruceHarold
Esri Regular Contributor
Hello Jeremy

Yes, you can update your feature class geometry with a cursor writing to the shape field with points made from the northing and easting values.  Make a Point from each XY then a PointGeometry, then write the value.  Don't forget to set the spatial reference for the cursor if the feature class coordinate system is different form the XY values.

Regards
0 Kudos
JamesOBrien
Emerging Contributor
I have a detailed blog here about processing Arcgis geometry with Python:

http://geophyter.blogspot.com/2009/12/converting-feature-classes-to-kml-using.html
0 Kudos