Hi,
I'm using Oracle 9i with the spatial option. It seems that the
spatial function, e.g., SDO_NN, does not consider the
3rd element in a point. I tried the following script to create
a table, insert 2 points, create an index, and to query
the table using SDO_NN.
-------------------< script for Oracle >----------------------
create table test (shape MDSYS.SDO_GEOMETRY);
insert into test values (
MDSYS.SDO_GEOMETRY(
3001,
NULL,
MDSYS.SDO_POINT_TYPE(3,4,10),
NULL,
NULL));
insert into test values (
MDSYS.SDO_GEOMETRY(
3001,
NULL,
MDSYS.SDO_POINT_TYPE(3,5,1),
NULL,
NULL));
insert into user_sdo_geom_metadata
values (
'test',
'shape',
mdsys.sdo_dim_array(
mdsys.sdo_dim_element('X', 0, 20, 0.005),
mdsys.sdo_dim_element('Y', 0, 20, 0.005),
mdsys.sdo_dim_element('Z', 0, 20, 0.005)
),
NULL
);
create index test_idx on test (shape)
indextype is mdsys.spatial_index;
select * from test c where
SDO_NN(c.shape, mdsys.sdo_geometry(3001, NULL, mdsys.sdo_point_type(3,4,0),
NULL, NULL), 'sdo_num_res=1')='TRUE';
## RESULT
SHAPE(SDO_GTYPE, SDO_SRID, SDO_POINT(X, Y, Z), SDO_ELEM_INFO,
SDO_ORDINATES)
---------------------------------------------------------------------------
-----
SDO_GEOMETRY(3001, NULL, SDO_POINT_TYPE(3, 4, 10), NULL, NULL)
-------------------< script for Oracle >----------------------
If the 3rd element of a point is considered, but result should be (3,5,1), I
guess. But, the query gives (3,4,10), instead. I'm wondering if the spatial
functions in Oracle really doesn't consider the 3rd element of a point, or
if there is something that I'm missing here. If Oracle doesn't support it,
is there a workaround or something like that?
Any comments would be appreciated.
Thanks in advance,
Kiyoung..