4

I have a large dataset of x,y coordinates in "NAD 1983 StatePlane Michigan South FIPS 2113 Feet" (aka ESRI 102690). I'd like to convert them to lat-lng points.

In theory, this is something proj is built to handle, but the documentation hasn't given me a clue -- it seems to describe much more complicated cases.

I've tried using a python interface, like so:

from pyproj import Proj
p = Proj(init='esri:102690')
sx = 13304147.06410000000 #sample points
sy = 288651.94040000000
x2, y2 = p(sx, sy, inverse=True)

But that gives wildly incorrect output.

There's a Javascript library, but I have ~50,000 points to handle, so that doesn't seem appropriate.


What worked for me:

I created a file called ptest with each pair on its own line, x and y coordinates separated by a space, like so:

13304147.06410000000 288651.94040000000
...

Then I fed that file into the command and piped the results to an output file:

$>cs2cs -f %.16f +proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 
+lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 
+datum=NAD83 +to_meter=0.3048006096012192 +no_defs +zone=20N +to 
+proj=latlon ptest > out.txt
skaffman
  • 398,947
  • 96
  • 818
  • 769
Matt Hampel
  • 5,088
  • 12
  • 52
  • 78

2 Answers2

4

If you only need to reproject and can do some data-mining on your text files use whatever you like and use http://spatialreference.org/ref/esri/102690/ as reference.

For example use the Proj4 and store it in a shell/cmd file and call out your input file with proj4 (linux/windows version available) no problem with the size your dataset.

cs2cs +proj=latlong +datum=NAD83 +to +proj=utm +zone=10  +datum=NAD27 -r <<EOF
cs2cs -f %.16f +proj=utm +zone=20N +to +proj=latlon - | awk '{print $1 " " $2}

so in your case something like this:

cs2cs -f %.16f +proj=lcc +lat_1=42.1 +lat_2=43.66666666666666 +lat_0=41.5 +lon_0=-84.36666666666666 +x_0=4000000 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=0.3048006096012192 +no_defs +zone=20N +to +proj=latlon

http://trac.osgeo.org/proj/wiki/man_cs2cs

http://trac.osgeo.org/proj/

DefenestrationDay
  • 3,712
  • 2
  • 33
  • 61
Jonke
  • 6,525
  • 2
  • 25
  • 40
  • I'm still confused on the usage of cs2cs. How would I feed my two sample points in? How would I format a file with many points? How do I hand that file to cs2cs? The docs seem to suggest it's a file with values tab-separated, each pair on its own line, last line is "EOF". – Matt Hampel Jul 19 '09 at 19:15
  • 1
    I have a working example somewhere but as I recall it is simpler than one thinks, I use the -E to get the input coords to the output after all the parameters the first argument is the source file. Everything goes to stdout so just use a cs2cs +++lotofparameters+++ sourcefile > outputfile – Jonke Jul 19 '09 at 20:13
  • Thanks, that was easier than it seemed. Thanks! – Matt Hampel Jul 19 '09 at 20:25
3

If you have coordinates in TXT, CSV or XLS file, you can do CTRL+C and insert them to http://cs2cs.mygeodata.eu where you can set appropriate input and desired output coordinate system. It is possible to insert thousands of coordinates in various formats...

Tonny
  • 285
  • 2
  • 8