我试图在 Oracle Database 11g 企业版 (11.1.0.6.0) 上执行下一个查询:
SELECT "__ItemId"
FROM "Cities"
WHERE "Longitude" IS NOT NULL AND "Latitude" IS NOT NULL
AND SDO_ANYINTERACT(SDO_GEOMETRY('POINT(' || "Longitude" || ' ' || "Latitude" || ')'),
SDO_UTIL.FROM_WKTGEOMETRY('POLYGON ((-100 80, 100 80, 100 -80, -100 -80, -100 80))')) = 'TRUE'
其中“经度”和“纬度” - “城市”表中的数字 [NUMBER(28,5)] 列。
UPD:下一个查询(具有相同的错误)可用于测试:
SELECT 'Solved!'
FROM DUAL
WHERE SDO_ANYINTERACT(SDO_GEOMETRY('POINT(' || 100 || ' ' || 100 || ')'),
SDO_UTIL.FROM_WKTGEOMETRY('POLYGON ((-150.0 82.0, 150.0 82.0, 150.0 -67.0, -150.0 -67.0, -150.0 82.0))')) = 'TRUE';
我收到一个错误:
Error report -
SQL Error: ORA-13226: interface not supported without a spatial index
ORA-06512: at "MDSYS.MD", line 1723
ORA-06512: at "MDSYS.MDERR", line 8
ORA-06512: at "MDSYS.SDO_3GL", line 71
ORA-06512: at "MDSYS.SDO_3GL", line 239
13226. 00000 - "interface not supported without a spatial index"
*Cause: The geometry table does not have a spatial index.
*Action: Verify that the geometry table referenced in the spatial operator
has a spatial index on it.
问题:
- 如何检查指定多边形中具有指定“经度”和“纬度”的点?多边形并不总是简单的,它可以是任何的。
- 如何在没有任何空间列的表上创建空间索引?
- 真的,不能只叫空间算子吗?