# 18 Spatial Operators

This chapter describes the operators that you can use when working with the spatial object data type. For an overview of spatial operators, including how they differ from spatial procedures and functions, see Spatial Operators_ Procedures_ and Functions. The following table lists the main operators.

Table 18-1 Main Spatial Operators

Operator Description

SDO_FILTER

Specifies which geometries may interact with a given geometry.

SDO_JOIN

Performs a spatial join based on one or more topological relationships.

SDO_NN

Determines the nearest neighbor geometries to a geometry.

SDO_NN_DISTANCE

Returns the distance of an object returned by the SDO_NN operator.

SDO_POINTINPOLYGON

Takes a set of rows whose first column is a point's x-coordinate value and the second column is a point's y-coordinate value, and returns those rows that are within a specified polygon geometry.

SDO_RELATE

Determines whether or not two geometries interact in a specified way. (See also Table 18-2 for convenient alternative operators for performing specific mask value operations.)

SDO_WITHIN_DISTANCE

Determines if two geometries are within a specified distance from one another.

Table 18-2 lists operators, provided for convenience, that perform an SDO_RELATE operation of a specific mask type.

Table 18-2 Convenience Operators for SDO_RELATE Operations

Operator Description

SDO_ANYINTERACT

Checks if any geometries in a table have the ANYINTERACT topological relationship with a specified geometry.

SDO_CONTAINS

Checks if any geometries in a table have the CONTAINS topological relationship with a specified geometry.

SDO_COVEREDBY

Checks if any geometries in a table have the COVEREDBY topological relationship with a specified geometry.

SDO_COVERS

Checks if any geometries in a table have the COVERS topological relationship with a specified geometry.

SDO_EQUAL

Checks if any geometries in a table have the EQUAL topological relationship with a specified geometry.

SDO_INSIDE

Checks if any geometries in a table have the INSIDE topological relationship with a specified geometry.

SDO_ON

Checks if any geometries in a table have the ON topological relationship with a specified geometry.

SDO_OVERLAPBDYDISJOINT

Checks if any geometries in a table have the OVERLAPBDYDISJOINT topological relationship with a specified geometry.

SDO_OVERLAPBDYINTERSECT

Checks if any geometries in a table have the OVERLAPBDYINTERSECT topological relationship with a specified geometry.

SDO_OVERLAPS

Checks if any geometries in a table overlap (that is, have the OVERLAPBDYDISJOINT or OVERLAPBDYINTERSECT topological relationship with) a specified geometry.

SDO_TOUCH

Checks if any geometries in a table have the TOUCH topological relationship with a specified geometry.

Note:

For any numbers in string (VARCHAR2) parameters to Spatial and Graph operators and subprograms, the period (.) must be used for any decimal points regardless of the locale. Example: `'distance=3.7'`

The rest of this chapter provides reference information on the operators, listed in alphabetical order.

For information about using operators with topologies, see Oracle Spatial and Graph Topology Data Model and Network Data Model Graph Developer's Guide.