简体   繁体   English

从 RD 转换为 WGS84 时,Oracle SDO_CS.TRANSFORM 会移动坐标

[英]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).我有一个带有空间数据的 Oracle 数据库,其中坐标以 RD 格式(srid 28992)存储。 To place them on a map (leaflet with openstreetmap) I need the coordinates in WGS84 (srid 4326) format.要将它们放在地图上(带有 openstreetmap 的传单),我需要 WGS84(srid 4326)格式的坐标。

I should be able to get the coordinates in that format by using SDO_CS.TRANSFORM.我应该能够通过使用 SDO_CS.TRANSFORM 获得该格式的坐标。 When I do that, all coordinates seems to be shifted eastwards by about 6m.当我这样做时,所有坐标似乎都向东移动了大约 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.验证存储在表中的数据没有问题,我创建了一个查询,该查询采用 RD 坐标 155000, 463000 并将其转换为 WGS84。 From that query I get: 52,1551639130507 5,38735225721137从那个查询我得到: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)如果我对 op http://www.gpscoordinaten.nl/converteer-gps-coordinaten.php进行相同的转换,我会得到 52.15517, 5.38721(这是正确的坐标)

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?知道为什么 Oracle 中的转换会移动坐标吗?

Have a look at this http://epsg.io/28992看看这个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;但是对于 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.你看TOWGS84参数不一样。

Maybe you should discuss the issue at https://gis.stackexchange.com/ or ask Oracle support if they put wrong data in their reference.也许您应该在https://gis.stackexchange.com/ 上讨论这个问题,或者询问 Oracle 支持人员是否在参考中输入了错误的数据。

Add-on添加在

Check official EPSG data at http://www.epsg-registry.org/http://www.epsg-registry.org/查看官方 EPSG 数据

When you search for当你搜索

  • Tpye = CoordinateTransformation - Single Tpye = CoordinateTransformation - Single
  • Arae = Netherland Arae = 荷兰

You get a bunch of transformations.你会得到一堆转换。 I think you have to make some deeper investigations.我认为你必须进行一些更深入的调查。

For those landing here with a similar problem.对于那些遇到类似问题的人。

As pointed out in the accepted answer there are various values out there for the transformation parameters.正如在接受的答案中指出的那样,转换参数有各种值。 To change the transformation parameters in Oracle for SRID 28992 you have to do the following:要在 Oracle 中更改 SRID 28992 的转换参数,您必须执行以下操作:

update mdsys.sdo_datums set
  shift_x = 565.2369,
  shift_y = 50.0087,
  shift_z = 465.658,
  rotate_x = -0.406857330322398,
  rotate_y = 0.350732676542563,
  rotate_z =  -1.8703473836068 ,
  scale_adjust = 4.0812
where datum_id = 6289;

commit;

begin SDO_CS.UPDATE_WKTS_FOR_EPSG_DATUM(6289);
end;

commit;

I took me some time to figure out that Oracle caches these values.我花了一些时间才弄清楚 Oracle 缓存了这些值。 In order for these changes to take effect, you have to log out and start a new session.为了使这些更改生效,您必须注销并开始新的会话。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM