ORACLE SDO_GEOMETRY ToString()?

时光毁灭记忆、已成空白 提交于 2019-12-11 01:30:15

问题


I have a .Net system that I am writing which needs to be able to retrieve an oracle geometry field from the database. Is there any way in my SQL statement to cast the geometry type to a string so that I can deal with it on my .Net side. At the moment I cannot get the data out as it is not a valid datatype to put into my OLEDB reader so it must be converted database side.

select CS_BOUNDS from MDSYS.CS_SRS where SRID = 4326

Thanks


回答1:


You could use the Get_WKT method:

Returns the well-known text (WKT) format (explained in Section 6.7.1.1) of a geometry object.

The documentation gives the following example:

SELECT c.shape.Get_WKT()
  FROM cola_markets c WHERE c.name = 'cola_b';

C.SHAPE.GET_WKT()                                                               
--------------------------------------------------------------------------------
POLYGON ((5.0 1.0, 8.0 1.0, 8.0 6.0, 5.0 7.0, 5.0 1.0)) 

The return type is CLOB.



来源:https://stackoverflow.com/questions/8883069/oracle-sdo-geometry-tostring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!