简体   繁体   English

如何更改Oracle SDO_GEOMETRY的SRID

[英]How do I change the SRID's for Oracle SDO_GEOMETRY

I have spatial data that Oracle has assigned an SRID of 81989 . 我有空间数据,Oracle已分配SRID为81989 I'd like to change it to 27700 - they're both the same coordinate system, its just Oracle uses its own SRID; 我想将它改为27700 - 它们都是相同的坐标系,它只是Oracle使用自己的SRID; so no re-projection is necessary (as such SDO_CS.TRANSFORM doesn't work as it actually changes the coordinates too, which I don't want)). 所以不需要重新投影(因此SDO_CS.TRANSFORM不起作用,因为它实际上也改变了坐标,这是我不想要的))。

I've updated USER_SDO_GEOM_METADATA easily enough, but the SDO_GEOMETRY containing the data itself has the SRID too and I don't know how to change this. 我已经足够轻松地更新了USER_SDO_GEOM_METADATA ,但是包含数据本身的SDO_GEOMETRY也有SRID,我不知道如何更改它。

So for example my current data looks like: 例如,我的当前数据如下:

MDSYS.SDO_GEOMETRY(2001,81989,MDSYS.SDO_POINT_TYPE(420531.663898,268911.956161,NULL),NULL,NULL)

and I need to go change it to: 我需要把它改成:

MDSYS.SDO_GEOMETRY(2001,27700,MDSYS.SDO_POINT_TYPE(420531.663898,268911.956161,NULL),NULL,NULL)

For all rows in a table. 对于表中的所有行。 But I don't know how to automatically alter a single element in a SDO_GEOMETRY while leaving the other aspects of the array unchanged. 但我不知道如何自动更改SDO_GEOMETRY中的单个元素,同时保持数组的其他方面不变。

Can anyone point me in the direction? 任何人都能指出我的方向吗? Thanks. 谢谢。

To update the SRID, you might use something like this: 要更新SRID,您可以使用以下内容:

UPDATE YOUR_TABLE T
SET T.YOUR_SDO_GEOMETRY_COLUMN.SDO_SRID = 27700
WHERE T.YOUR_SDO_GEOMETRY_COLUMN IS NOT NULL

Note that use of a table alias (like T in this example) is necessary. 请注意,必须使用表别名(如本例中的T)。

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

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