Hi all,
In Pro as in Map there is a script based tool called "Add Geometry ...". The script is pretty elaborate but with a few minor changes and "reductions" it should do what you want. Find attached a toolbox with a modified sript ingested in it that (from analyzing the text above) does pretty much what you want:
- On a 2D FeatureClass it adds (or updates) LAT and LONG fields and writes geographic coordinates into the fields. If the fields are already present, a warning will show but the tool will run
- A selection on the LAT field has been added: If the field is not NULL, the calculation will not be done for that record - this should make sure existing fields are not overwritten
- As a default WGS 84 are set
- No questions asked for Units - since "nulled" the tool will write x and y in decimal degree
What I didnt do:
- Cover all the rest of if/whens: Z,M, Other field namings, ...
- Took care of projections/transformations
Give it a try or export the script from the toolbox and modify. All modifications to the original esri version I made can be found in the python code by searching for comments starting with #GD:
Regards
Guenter