Oracle-将SDO_GEOMETRY转换为WKT吗? [英] Oracle - Converting SDO_GEOMETRY to WKT?

查看:1473
本文介绍了Oracle-将SDO_GEOMETRY转换为WKT吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对oracle空间很陌生.

I am very new to oracle spatial.

我有一个带有一个SDO_GEOMETRY列的空间表.在此表中插入POINT数据后,我想以WKT格式检索数据.

I have a spatial table with one SDO_GEOMETRY column. After inserting POINT data in this table, I want to retrieve data in WKT format.

这是我所做的:

插入数据-

INSERT INTO new_test (name, geom) VALUES (
'Test', 
SDO_GEOMETRY(
             2001,
             4326, 
             SDO_POINT_TYPE(12,14,NULL), 
             NULL, 
             NULL));

获取数据-

SELECT NAME, SDO_UTIL.TO_WKTGEOMETRY(GEOM) AS point FROM NEW_TEST;

输出-

NAME | POINT
-------------
Test | (null)

为什么我在这里得到空值?它不应该显示坐标点吗?

Why do I get null here? Shouldn't it display the co-ordinate points?

推荐答案

功能SDO_UTIL.TO_WKTGEOMETRY Express版本中似乎不可用(

The function SDO_UTIL.TO_WKTGEOMETRY seems not to be available in the Express version (Source - Siva Ravada-Oracle):

Oracle Express在数据库和WKT中没有Javavm 转换例程需要此功能,因为该功能是通过Java实现的 存储过程.因此, 速成版.

Oracle Express does not have a Javavm in the database and the WKT conversion routines need this as the feature is implemented as Java stored procedures. So these WKT routines are not supported on the Express edition.

您仍然可以像这样(针对积分)构建自己的WKT:

You can still build your own WKT like this (for points):

SELECT name, 'POINT ('||t.X||' '||t.Y||')' AS point FROM NEW_TEST p, TABLE(SDO_UTIL.GETVERTICES(p.GEOM)) t;

这篇关于Oracle-将SDO_GEOMETRY转换为WKT吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆