My Oracle Support Banner

Wrong Results When Using SDO_NN_DISTANCE Spatial Queries (Doc ID 2340458.1)

Last updated on MARCH 08, 2019

Applies to:

Oracle Spatial and Graph - Version and later
Information in this document applies to any platform.


The SDO_NN_DISTANCE() construct is designed to return the distance used by the SDO_NN operator.

When an SDO_NN query is executed on 3D data with a 3D index, SDO_NN_DISTANCE() returns the correct answer.

When the same query is executed on 3D data with a *2D* index, SDO_NN_DISTANCE() returns incorrect answers.

Comparing to the use of SDO_GEOM.SDO_DISTANCE():

1) Using a 2D index

- using SDO_GEOM.SDO_DISTANCE(): the distances are correctly computed.

- using SDO_NN_DISTANCE(): the distances are incorrect:

2) Using a 3D index

The distances are correctly computed in both cases:




To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!

In this Document

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.