Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I am developing an online project that needs to be able to accept a WGS84 lat lng anywhere in the lower 48 states and produce the corresponding state plane coordinates.

Once I know the state plane EPSG code then I can use http://spatialreference.org to get the parameters for that state plane zone and then use proj4js to convert the latlng to state plane.

But I am missing a piece.

Is there a way with javascript or PHP to find out the correct state plane EPSG code for a WGS84 latlng?

Is there some kind of REST API I can call that will return the EPSG code?

share|improve this question
    
This isn't really a coding issue, it is a spatial operation. In order to figure out the proper EPSG code, you need to know what state plane zone the point falls into. The zones are clearly defined, and I think there is an existing layer out there of the zone boundaries. You would need to do an intersection between your lat/lon point with the zone boundaries, then the return from that you could use to feed the conversion process. –  Get Spatial Dec 6 '13 at 21:24
    
The way to do it in general would be to take the point as part of an SQL query to feed into a backend database to perform the intersection. My thinking is that php may be better suited as it would keep all the processing on the server side. What options do you have for installing a spatial database to hold the zone boundary layer and do the intersect operation? –  Get Spatial Dec 6 '13 at 21:28
1  
Ok, I found a WMS service showing state plane zones. That WMS supports GetFeatureInfo so hopefully it will tell me the EPSG code. I found that WMS data at catalog.data.gov/dataset/united-states-stateplane-zones-nad83/…. Here is a map that displays that WMS: bit.ly/1aGZ0CI –  Gmap4 guy Dec 6 '13 at 22:18
1  
I would suggest that instead of using a map that has an unknown level of accuracy, that you may want to build your own layer. All of the zones in the state plan systems are built with edges that correspond to either state boundaries, or county boundaries within the states. This was done to ensure that all of the coordinates in one county would fall in the same zone. Therefore, it may be worth taking the layer you have found, and finding a higher quality layer of US states and counties, and tagging these with the appropriate zone name. –  Get Spatial Dec 6 '13 at 22:32
2  
Perhaps your (implicit) assumptions are based on "everyone lives in my country" and "everyone uses my tools and has my workflow", so "everyone would have already needed this". That isn't so. This is the only gis.SE question tagged state-plane (and there is no definition)... –  BradHards Dec 7 '13 at 22:47
show 3 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.