SDO_WITHIN_DISTANCE Operator Returning Incorrect Results (Doc ID 1606126.1)

Last updated on FEBRUARY 08, 2017

Applies to:

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

Symptoms

SDO_WITHIN_DISTANCE returning incorrect results


SELECT TITLE,
  SDO_GEOM.SDO_DISTANCE(SDO_GEOMETRY('POINT (-119.039441 35.353293)',8307), LOCATION, .05) AS distanceInMeters
FROM geospatial_test t
WHERE SDO_WITHIN_DISTANCE( t.LOCATION, SDO_GEOMETRY('POINT (-119.039441 35.353293)',8307),'distance=' || 154000 || ' unit=M' ) = 'TRUE'
ORDER BY distanceInMeters;

/*
TITLE DISTANCEINMETERS
---------- ----------------
100040 154799.075
100041 154959.56
100042 155072.003
100043 155229.442
100044 155341.888
100045 155502.369
100035 156154.605
100036 156312.05
100037 156395.979
100038 156569.933
100039 156644.997

11 rows selected.

The query is returning 11 rows are we are expecting 0 rows

Cause

Sign In with your My Oracle Support account

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

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms