5

This question already has an answer here:

I have a large point feature class and have realised that there are several hundred features with null geometry. Fortunately the coordinates are stored as an attribute. What I need to do is update the geometry of the points with the x and y stores in the attribute table.

After a little search I found an Esri Support Services Blog post on How to Update the Location of a Point Feature and Its XY Fields which includes a python function that will do this for me in the field calculator.

However, it seems that this will only work on features with a geometry. When I run it on the null geometry features it returns a syntax error. presumably this is because there is no shape or there is no shape.getpart(0).

Is there something I could add to this script to allow it to update null geometries, or does anyone have another method?

marked as duplicate by PolyGeo arcgis-desktop May 1 '16 at 4:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 6
    In field calculator, Python select shape field and type arcpy.Point(!x!,!y!). Set environment Extent to something very big – FelixIP Apr 27 '16 at 10:01
  • 4
    Duh, so simple! I cant believe I spent so much time messing about. That's worked - if you write is as an answer I'll accept. Thanks – whatahitson Apr 27 '16 at 10:07
  • 2
    Nyet, no answer. It's most likely a duplicate. Glad it works – FelixIP Apr 27 '16 at 10:10
  • The duplicate is not identical but uses the same concept for its solution which is that the Shape field can be updated by field calculating its X and Y values. – PolyGeo May 1 '16 at 4:17