BEYOND ECQL Spatial Predicate does not work with Oracle Data Store

Description

Attempted a WMS request with a cql_filter containing the BEYOND spatial predicate as follows:

BEYOND(LAYER1_GEOM,collectGeometries(queryCollection('test:Layer2','LAYER2_GEOM','ATTRIB1 IN (1,2,3)')),5,kilometers);ATTRIB1 IN (1,2,3)

Received the error back:

Rendering process failed
java.io.IOExceptionjava.sql.SQLException: ORA-29902: error in executing ODCIIndexStart() routine
ORA-13207: incorrect use of the [SDO_WITHIN_DISTANCE] operator
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333

ORA-29902: error in executing ODCIIndexStart() routine
ORA-13207: incorrect use of the [SDO_WITHIN_DISTANCE] operator
ORA-06512: at "MDSYS.SDO_INDEX_METHOD_10I", line 333

Defect:
GeoServer converts the BEYOND filter function into the Oracle spatial filter: SDO_WITHIN_DISTANCE(POSITION_GEO,?,'distance=10.0 unit=km') = 'FALSE'.
This is an improper use of the SDO_WITHIN_DISTANCE operator. The operator can only be compared with a ‘TRUE’, so GeoServer would need to map the BEYOND filter to: SDO_WITHIN_DISTANCE(POSITION_GEO,?,'distance=10.0 unit=km') != 'TRUE'.

Environment

Oracle 11g (11.2.0.4)

Status

Assignee

Unassigned

Reporter

Katey Bilz

Triage

None

Fix versions

None

Affects versions

2.10.2

Components

Priority

Medium
Configure