Which version, 9.2, 9.3 and 10.x all have different syntax to access the shape field properties.I recommend you instead of accessing the centroid this way, take an easier path: use the out of the box Feature To Point tool followed by the Add XY Coordinates tool.
The * is okay, that just means the field is binary, which is a good thing. The csv export you posted doesn't have a shape field, and doesn't contain the original field formats, so it doesn't help much with determining the problem. Please see the attached screenshots for proper export technique.
Well that's interesting. You do have a shape field called Shape, I assume? Maybe you can attach a one-record copy of this table so we can reproduce the error.
You have the right idea; you're just making it more complicated than it needs to be. Try:arcpy.CalculateField_management(test_poly, "X_COORD", "!Shape!.centroid.x", "PYTHON", "")I have attached a screenshot below.
arcpy.CalculateField_management(test_poly, "X_COORD", "!Shape!.centroid.x", "PYTHON", "")
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.