Skip to Main Content

Developer Community

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

transformation of cooridnates

Martien VosNov 4 2024

Can anyone help me out with this issue?

In my application i have to convert data from one SRID into another SRID and back.

In DB SRID = 28992 , in application i need SRID: 3857 (mercator) and when saving back to DB then SRID = 28992

If i do this cycle of transformation i see the coordinates are not the same anymore, how can i correct this?

with coord as (

select SDO_GEOMETRY(

  2001, -- SDO\_GTYPE for a point

  28992, -- SRID (Spatial Reference System Identifier)

  SDO\_POINT\_TYPE(107138.216543195, 400004.383460911, null),

  NULL, -- SDO\_ELEM\_INFO\_ARRAY (not used for points)

  NULL  -- SDO\_ORDINATE\_ARRAY (not used for points)

) rds

)

select p.rds.sdo_point.x, p.rds.sdo_point.y

    ,p.mercator.sdo\_point.x, p.mercator.sdo\_point.y

    ,p.cycle\_rds.sdo\_point.x, p.cycle\_rds.sdo\_point.y

from

(

select rds

    ,sdo\_cs.transform(b.rds,3857) mercator

   ,sdo\_cs.transform(sdo\_cs.transform(b.rds,3857),28992) cycle\_rds

   from coord b

) p;

OUTPUT

-----------

107138.216543195 400004.383460911 -- srid = rds:28992 start

522821.636810487 6725775.53107731 -- srid=mercator:3857

107138.220951294 400004.385796971 – srid= rds:28992 cycle end, not same as start

Comments
Post Details
Added on Nov 4 2024
6 comments
348 views