How to convert an EPSG coordinate to a latitude / longitude?

5.6k Views Asked by At

I have the following OpenGis data, which I want to convert to a latitude/longitude coordinate (as used by Google maps).

<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>

On the EPSG Registry, I found the origin position of 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

I've tried to using proj4js, but I can't figure out how to put this in a projection and how to get the required output.

I've also tried calculating it myself. But I have no idea what I'm doing here and nothing really made sense :(.

2

There are 2 best solutions below

1
On BEST ANSWER

Here's how to do it. Ordinarily, you could just transform from one projection to another if Proj4js already included the projection, like this:

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

However, EPSG:28992 isn't included in the standard library. To do it, you could add it by adding a new definition:

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"
);

Then you can just transform like so:

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

Which yields

[5.2041980699764325, 52.69918555556015]

On Google Maps

1
On

proj4js is an useful library for converting different system in different output! You can also try to take a conversion online tool, like CS2S

For example, you can try to make a request on the ajax form like this:

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

and get back a 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}

and check, in proj4 key, your lat_0 and lon_0 values

These values are formatted like the google coordinates and maybe is more easy to put in a projection