如何将EPSG坐标转换为纬度/经度?

时间:2017-02-14 02:10:33

标签: node.js geolocation epsg opengis

我有以下OpenGis数据,我想将其转换为纬度/经度坐标(由Google地图使用)。

<address xmlns:gml="http://www.opengis.net/gml">
  <gml:Point srsName="urn:ogc:def:crs:EPSG::28992">
    <gml:pos>142629.0 523546.0</gml:pos>
  </gml:Point>
</address>

EPSG Registry上,我找到了EPSG的原点位置:28992。

Latitude of natural origin      52°09'22.178"N
Longitude of natural origin     5°23'15.5"E
Scale factor at natural origin  0.9999079 unity
False easting                   155000 metre
False northing                  463000 metre

我尝试使用proj4js,但我无法弄清楚如何将其放入投影以及如何获得所需的输出。

我也试过自己计算一下。但是我不知道我在这里做什么,没有什么真正有意义的。(。

2 个答案:

答案 0 :(得分:3)

这是怎么做的。通常情况下,如果Proj4js已包含投影,您可以从一个投影转换为另一个投影,如下所示:

proj4('EPSG:900913', 'EPSG:4326', [20.0, 30.0]);

但是,EPSG:28992并未包含在标准库中。为此,您可以通过添加新定义来添加它:

proj4.defs(
   "EPSG:28992", 
   "+proj=sterea +lat_0=52.15616055555555   +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000  +ellps=bessel  +towgs84=565.040,49.910,465.840,-0.40939,0.35971,-1.86849,4.0772 +units=m +no_defs"
);

然后你可以这样改变:

proj4('EPSG:28992', 'EPSG:4326', [142629.0, 523546.0]);

哪个收益

[5.2041980699764325, 52.69918555556015]

On Google Maps

答案 1 :(得分:0)

proj4js是一个有用的库,可以在不同的输出中转换不同的系统! 您还可以尝试使用转换在线工具,例如CS2S

例如,您可以尝试在ajax表单上发出请求,如下所示:

https://mygeodata.cloud/drive/crslist?dsid=0&search=28992&limit=50&offset=0

然后回到json:

{"rows": [{"proj4": "+proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.4171,50.3319,465.5524,-0.398957388243134,0.343987817378283,-1.87740163998045,4.0725 +units=m +no_defs ", "sel": 2, "epsg": 28992, "dsname": "Amersfoort / RD New", "aoi": "Netherlands - onshore, including Waddenzee, Dutch Wadden Islands and 12-mile offshore coastal zone.", "ordering2": 460.0}], "total": 1}

并在 proj4 键中检查 lat_0 lon_0

这些值的格式类似于谷歌坐标,可能更容易放入投影

相关问题