Convert state plane coordinate to lat/lon

8241
1
Jump to solution
09-25-2014 05:00 PM
CalebPitman
New Contributor

Hello,

 

I am trying to convert SPC similar to the earthpoint one linked below. I've found ways to do it, but I need to do it programmatically, preferably in PHP but any language would work.

 

Anyone have a function to do this?

 

 

State Plane Coordinate System

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
FreddieGibson
Occasional Contributor III

In ArcGIS this could be done in a number of ways. You could review these options to see if they'll work with your workflow.

1. Call the Add XY Coordinates (Data Management) tool after setting the Output Coordinate System environment variable to a system that uses lat/long values, such as WGS1984.

Add XY Coordinates (Data Management)

http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/add-xy-coordinates.htm http://resources.arcgis.com/en/help/main/10.2/index.html#/Add_XY_Coordinates/001700000032000000/

2. Call the Project Data Management tool to project the feature class to WGS1984. Then you could calculate the xy coordinates of the points in Lat/Long or parse them in python.

Project (Data Management)

http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/project.htm http://resources.arcgis.com/en/help/main/10.2/index.html#/Project/00170000007m000000/http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/project.htm

3. Use a cursor to project the records within a feature class to WGS1984. This would return you the lat/longs in a tuple if you use the Shape@XY token

SearchCursor (arcpy.da)

http://resources.arcgis.com/en/help/main/10.2/index.html#//018w00000011000000http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/searchcursor-class.htm

Reading Geometries

http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000001t000000http://desktop.arcgis.com/en/desktop/latest/analyze/python/reading-geometries.htm

4. Create a point object and use its projectAs method to project the point to WGS1984, after which you can parse the X and Y values.

PointGeometry

https://pro.arcgis.com/en/pro-app/arcpy/classes/point.htmhttp://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/pointgeometry.htm

5. NON ESRI : If the data comes in as shapefiles you can use osgeo.ogr to open it, parse the coordinates, and then use pyproj to project it to the needed system.

View solution in original post

1 Reply
FreddieGibson
Occasional Contributor III

In ArcGIS this could be done in a number of ways. You could review these options to see if they'll work with your workflow.

1. Call the Add XY Coordinates (Data Management) tool after setting the Output Coordinate System environment variable to a system that uses lat/long values, such as WGS1984.

Add XY Coordinates (Data Management)

http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/add-xy-coordinates.htm http://resources.arcgis.com/en/help/main/10.2/index.html#/Add_XY_Coordinates/001700000032000000/

2. Call the Project Data Management tool to project the feature class to WGS1984. Then you could calculate the xy coordinates of the points in Lat/Long or parse them in python.

Project (Data Management)

http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/project.htm http://resources.arcgis.com/en/help/main/10.2/index.html#/Project/00170000007m000000/http://desktop.arcgis.com/en/desktop/latest/tools/data-management-toolbox/project.htm

3. Use a cursor to project the records within a feature class to WGS1984. This would return you the lat/longs in a tuple if you use the Shape@XY token

SearchCursor (arcpy.da)

http://resources.arcgis.com/en/help/main/10.2/index.html#//018w00000011000000http://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-data-access/searchcursor-class.htm

Reading Geometries

http://resources.arcgis.com/en/help/main/10.2/index.html#//002z0000001t000000http://desktop.arcgis.com/en/desktop/latest/analyze/python/reading-geometries.htm

4. Create a point object and use its projectAs method to project the point to WGS1984, after which you can parse the X and Y values.

PointGeometry

https://pro.arcgis.com/en/pro-app/arcpy/classes/point.htmhttp://desktop.arcgis.com/en/desktop/latest/analyze/arcpy-classes/pointgeometry.htm

5. NON ESRI : If the data comes in as shapefiles you can use osgeo.ogr to open it, parse the coordinates, and then use pyproj to project it to the needed system.