how to calculate latitude and longitude of points using python

384
1
Jump to solution
12-23-2012 02:05 PM
ElaineKuo
Occasional Contributor
System ArcGIS 9.3
Python 2.5

Hello,

I have about 100 point shapefiles in a folder. (projection WGS 1984)
I would like to get the point latitudes and longitudes.
I used to use XTool Pro but it did not go well for version 9.1

Please kindly advise any python code to calculate the latitudes and longitudes.
Thank you
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
T__WayneWhitley
Frequent Contributor
Not sure I understand, do you want the XY coordinates added to the attribute tables of point shapefiles for which you already have in WGS84?  I think the Add XY coordinates tool should do this, probably in decimal degrees, automatically adding PointX and PointY fields.
Also if you want to run that in batch, I think this tool will allow it...if you right-click on it in the toolbox and select Batch.
Optionally, you could set up an iterator in a Model or if you prefer, feed a list (or list a directory) into a loop in a python script.

View solution in original post

0 Kudos
1 Reply
T__WayneWhitley
Frequent Contributor
Not sure I understand, do you want the XY coordinates added to the attribute tables of point shapefiles for which you already have in WGS84?  I think the Add XY coordinates tool should do this, probably in decimal degrees, automatically adding PointX and PointY fields.
Also if you want to run that in batch, I think this tool will allow it...if you right-click on it in the toolbox and select Batch.
Optionally, you could set up an iterator in a Model or if you prefer, feed a list (or list a directory) into a loop in a python script.
0 Kudos