Select to view content in your preferred language

ArcGIS Pro Calculate Geometry

34678
20
Jump to solution
01-08-2015 10:37 AM
DonovanCorliss
New Contributor

On my attribute table, I can calculate a field but I don't see the handy Calculate Geometry that I found in 10.2.2. 

Do I need to go back to a script to add a Latitude and Longitude field in my attribute table?

I am using a File Geodatabase table in ArcGIS Pro 1.0 (Prerelease 2, Build 1692

1 Solution

Accepted Solutions
JoshuaBixby
MVP Esteemed Contributor

I believe Add Geometry Attributes is replacing Calculate Geometry in ArcGIS Pro, at least that was the word during beta testing.

UPDATE:  Since ArcGIS Pro 2.2, a comparable Calculate Geometry tool has been available.

View solution in original post

20 Replies
JoshuaBixby
MVP Esteemed Contributor

I believe Add Geometry Attributes is replacing Calculate Geometry in ArcGIS Pro, at least that was the word during beta testing.

UPDATE:  Since ArcGIS Pro 2.2, a comparable Calculate Geometry tool has been available.

DonovanCorliss
New Contributor

Thanks - Geoprocessing Tools - Add Geometry Attributes worked like a charm. I got x, y, z, and m.

0 Kudos
AndyFairbairn
Regular Contributor

Add Geometry Attributes seems to be fine if you want to add new columns to your attribute table, but what if you just want to update existing geometry columns? I have managed to use Field Calculator for areas - e.g. !shape.area@hectares! but not sure how to do this for x and y coordinates - !shape.center()! ? - can anyone help me with the syntax for this please?

I miss the Calculate Geometry tool!

Thanks,

Andy.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

According to the documentation for Add Geometry Attributes:

One or many attribute fields will be added to the input features depending on the options specified in the Geometry Properties parameter. If the fields already exist in the input features, the values in those fields will be overwritten.

If you want to use Calculate Field instead, the examples in the documentation cover your situation.  For example, !SHAPE.CENTROID.X! and !SHAPE.CENTROID.Y!

AndyFairbairn
Regular Contributor

Thanks for that Joshua - since the field names in my data don't match those that Add Geometry Attributes wants to add, it looks like Calculate Field is my only option as far as I can see (unfortunately I don't have the option of modifying the attribute table fields in this case). So, thanks for the help with centroid syntax - somehow managed to miss that when looking through the e.g.s in the documentation.

Cheers,

Andy.

LeeBrannon
Regular Contributor

Joshua's comment was very helpful, but I have an issue that requires an additional parameter in using the Field Calculator to get XY values into existing fields.  My data is in State Plane Feet but I need to calculate the XY coords in decimal degrees for my existing XY fields.  How do I specify that I want my output units to be decimal degrees?

I tried !SHAPE.CENTROID.X@DECIMALDEGREES! but it failed so I am guessing my syntax is wrong.

JoshuaBixby
MVP Esteemed Contributor

According to the Calculate Field documentation:

Python expressions can use the geometry area and length properties with an areal or linear unit to convert the value to a different unit of measure (for example, !shape.length@kilometers!).

I don't believe getting XY coordinates in decimal degrees from projected data is supported with the tool.  I believe the Add Geometry Attributes tool is what you should be trying to use.

LeeBrannon
Regular Contributor

I think you are correct.  After a bit of testing with my data and using the Add Geometry Attributes tool, it appears I'll have to use the tool to get my point coords in DD (in the tool created xy fields) then calc the coords into my original fields.  Not stoked about the extra step.  Anyway, much thanks for the info!

JeremyTisdale
Occasional Contributor

I had a really long look for a solution to this problem.  I was disappointed and angered by the fact they got rid of the calculate geometry tool.

Once I got over that disappointment, I hunted for a solution and came across this thread.  I had tried to use the Add Geometry tool, but the point features do not have a 'z' or 'm' value so the tool crashed.  When I tried he add X Y coordinates tool, it was giving me the information in meters.  After trying some other quick little scripts and lots of other reading, I realized I had to use the Add XY Coordinates tool, but under the Environment tab, I changed the output coordinates to Geographic Coordinates, WGS 1984 and it gave the information as decimal degrees.  I hope this saves someone some time.

THIS ISSUE IS FIXED AND THE TOOL HAS BEEN UPDATED TO DEAL WITH THIS.