Oracle 中 SDO_POINT 的使用
我正在使用 Oracle Spatials,有以下查询:
SDO_GEOMETRY 如果由五个组成数据组成:
CREATE TYPE sdo_geometry AS OBJECT ( SDO_GTYPE NUMBER, SDO_SRID NUMBER, SDO_POINT SDO_POINT_TYPE, SDO_ELEM_INFO SDO_ELEM_INFO_ARRAY, SDO_ORDINATES SDO_ORDINATE_ARRAY);
一旦我查询数据库以获取结果集 - 如何从上述对象获取成本数据。
我基本上感兴趣的是从 SDO_POINT 获取 x 和 y 坐标,以便能够更新另一个 POJO 类中的值。
我确实从以下位置浏览了 JGeometry 选项: http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14373/oracle/spatial/geometry/JGeometry.html
但我可能错过了一些东西,我无法使用它。
任何帮助将不胜感激。
I am working with Oracle Spatials and I have the following query:
The SDO_GEOMETRY if made of five constituent data:
CREATE TYPE sdo_geometry AS OBJECT ( SDO_GTYPE NUMBER, SDO_SRID NUMBER, SDO_POINT SDO_POINT_TYPE, SDO_ELEM_INFO SDO_ELEM_INFO_ARRAY, SDO_ORDINATES SDO_ORDINATE_ARRAY);
Once I query the database to get the resultSet - how do I get to the costituent data from the above object.
I am basically interested in getting the x and y coordinates from the SDO_POINT so as to be able to update the values in another POJO Class.
I did go through the JGeometry option from:
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14373/oracle/spatial/geometry/JGeometry.html
but I am probably missing something and I am not able to use it.
Any help would be much appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JGeometry
类包含在 sdoapi.jar 中。在我的安装中,我在 /apps/oracle/product/102040/md/lib/ 中找到它。102040
部分对您来说可能有所不同。从结果集中获取 SDO_Geometry,然后加载它,如下所示:
然后您可以从该对象中获取所需的信息。根据内容的不同,您可能可以使用
getPoint()
,也可能需要使用getType()
、getElemInfo()
、<代码>getOrdinatesArray()等The
JGeometry
class is contained in sdoapi.jar. In my install, I found it in /apps/oracle/product/102040/md/lib/. The102040
part may differ for you.Get the SDO_Geometry out of the result set, and then load it, like so:
You can then get the information you need right out of that object. Depending on the contents, you may be able to use
getPoint()
or you may need to usegetType()
,getElemInfo()
,getOrdinatesArray()
, etc.