Search code examples
oraclecoordinatesspatial

Oracle SDO_CS.TRANSFORM shifts coordinates when converting from RD to WGS84


I have a Oracle database with spatial data in which coordinates are stored in RD format (srid 28992). To place them on a map (leaflet with openstreetmap) I need the coordinates in WGS84 (srid 4326) format.

I should be able to get the coordinates in that format by using SDO_CS.TRANSFORM. When I do that, all coordinates seems to be shifted eastwards by about 6m.

The verify that there was no problem with the data stored in the table, I created a query that takes RD coordinate 155000, 463000 and converts it to WGS84. From that query I get: 52,1551639130507 5,38735225721137

If I do the same transformation on op http://www.gpscoordinaten.nl/converteer-gps-coordinaten.php I get 52.15517, 5.38721 (which is the right coordinate)

The query used is this one:

SELECT
  t.X,
  t.Y
FROM
  (
    SELECT
      SDO_CS.TRANSFORM( MDSYS.SDO_GEOMETRY( 2001, 28992, MDSYS.SDO_POINT_TYPE(
      155000, 463000, NULL ), NULL, NULL ), 4326 ) AS geometry
    FROM
      dual
  )
  geo,
  TABLE( SDO_UTIL.GETVERTICES( geo.geometry ) ) t;

Any idea why the conversion in Oracle is shifting the coordinates?


Solution

  • Have a look at this http://epsg.io/28992

    PROJCS["Amersfoort / RD New",
        GEOGCS["Amersfoort",
            DATUM["Amersfoort",
                SPHEROID["Bessel 1841",6377397.155,299.1528128,
                    AUTHORITY["EPSG","7004"]],
                TOWGS84[565.417,50.3319,465.552,-0.398957,0.343988,-1.8774,4.0725],
                AUTHORITY["EPSG","6289"]],
            PRIMEM["Greenwich",0,
                AUTHORITY["EPSG","8901"]],
            UNIT["degree",0.0174532925199433,
                AUTHORITY["EPSG","9122"]],
            AUTHORITY["EPSG","4289"]],
        PROJECTION["Oblique_Stereographic"],
        PARAMETER["latitude_of_origin",52.15616055555555],
        PARAMETER["central_meridian",5.38763888888889],
        PARAMETER["scale_factor",0.9999079],
        PARAMETER["false_easting",155000],
        PARAMETER["false_northing",463000],
        UNIT["metre",1,
            AUTHORITY["EPSG","9001"]],
        AXIS["X",EAST],
        AXIS["Y",NORTH],
        AUTHORITY["EPSG","28992"]]
    

    But for Oracle select wktext3d from cs_srs where srid = 28992; you get

    PROJCS[ "Amersfoort / RD New", 
        GEOGCS["Amersfoort", 
            DATUM["Amersfoort", 
            SPHEROID[ "Bessel 1841", 6377397.155, 299.1528128, 
                AUTHORITY["EPSG", "7004"]], 
            TOWGS84[593.16, 26.15, 478.54, -1.304398008226, -0.103297414969, -1.144501530423, 4.0775], 
                AUTHORITY["EPSG", "6289"]], 
            PRIMEM["Greenwich", 0.000000, 
                AUTHORITY["EPSG","8901"]], 
            UNIT["degree (supplier to define representation)", 0.0174532925199433, 
                AUTHORITY["EPSG", "9122"]], 
            AXIS["Lat", NORTH], 
            AXIS["Long", EAST], 
            AUTHORITY["EPSG", "4289"]], 
        PROJECTION ["Oblique Stereographic"], 
        PARAMETER ["Latitude_Of_Origin", 52.1561605555555556], 
        PARAMETER ["Central_Meridian", 5.3876388888888889], 
        PARAMETER ["Scale_Factor", 0.9999079], 
        PARAMETER ["False_Easting", 155000.0], 
        PARAMETER ["False_Northing", 463000.0], 
        UNIT["metre", 1.0, 
            AUTHORITY["EPSG", "9001"]], 
        AXIS["X", EAST], 
        AXIS["Y", NORTH], 
        AUTHORITY["EPSG", "28992"]]
    

    You see the TOWGS84 parameters are different.

    Maybe you should discuss the issue at https://gis.stackexchange.com/ or ask Oracle support if they put wrong data in their reference.

    Add-on

    Check official EPSG data at http://www.epsg-registry.org/

    When you search for

    • Tpye = CoordinateTransformation - Single
    • Arae = Netherland

    You get a bunch of transformations. I think you have to make some deeper investigations.