将 ESRI 投影坐标转换为 lat-lng
我在“NAD 1983 StatePlane Michigan South FIPS 2113 Feet”(又名 ESRI 102690)。 我想将它们转换为经纬度点。
理论上,这是 proj 旨在处理的事情,但文档没有给我任何线索——它似乎描述了更复杂的情况。
我尝试使用 python 接口,如下所示:
from pyproj import Proj
p = Proj(init='esri:102690')
sx = 13304147.06410000000 #sample points
sy = 288651.94040000000
x2, y2 = p(sx, sy, inverse=True)
但这给出了非常错误的输出。
有一个 Javascript 库,但我有大约 50,000 个点需要处理,所以这似乎不合适。
对我有用的:
我创建了一个名为 ptest
的文件,每一对都在自己的行上,x 和 y 坐标用空格分隔,如下所示:
13304147.06410000000 288651.94040000000
...
然后我将该文件输入命令并通过管道传输结果到输出文件:
$>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
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:
gt;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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您只需要重新投影并且可以对文本文件进行一些数据挖掘,请使用您喜欢的任何内容并使用 http://spatialreference.org/ref/esri/102690/ 作为参考。
例如,使用 Proj4 并将其存储在 shell/cmd 文件中,并使用 proj4 调用您的输入文件(Linux/Windows 版本可用),数据集的大小没有问题。
所以在你的情况下是这样的:
http://trac.osgeo.org/proj/wiki/ man_cs2cs
http://trac.osgeo.org/proj/
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.
so in your case something like this:
http://trac.osgeo.org/proj/wiki/man_cs2cs
http://trac.osgeo.org/proj/
如果您有 TXT、CSV 或 XLS 文件中的坐标,您可以执行 CTRL+C 并将它们插入到 http://cs2cs.mygeodata .eu 您可以在其中设置适当的输入和所需的输出坐标系。 可以插入数千个各种格式的坐标......
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...