GEOINTERSECTS

The GEOINTERSECTS field specifier (case sensitive) allows you to find documents that have a document field that describes a location that intersects a specified geometric shape.

In the following examples, the shapes used in the queries are represented by black dotted lines, and the shapes in matching documents are represented by solid green lines.

Query with... Query results...
POLYGON

Points that occur within the polygon, and lines or polygon regions that at least partially overlap it.

If a document contains a MULTIPOLYGON, MULTILINESTRING, or MULTIPOINT, the document is returned when the query polygon intersects any part of the shape.

LINESTRING

Polygons and lines that intersect the line, and points that occur on the line.

If a document contains a MULTIPOLYGON, MULTILINESTRING, or MULTIPOINT, the document is returned when the query line intersects any part of the shape.

POINT

Polygons that contain the point, lines on which the point occurs, and points that exactly match the point.

If a document contains a MULTIPOLYGON, MULTILINESTRING, or MULTIPOINT, the document is returned when the query point intersects any part of the shape.

MULTIPOLYGON Geometric shapes that intersect (overlap) any part of the specified MULTIPOLYGON.
MULTILINESTRING Geometric shapes that intersect (overlap) any part of the specified MULTILINESTRING.
MULTIPOINT Geometric shapes that intersect (overlap) any part of the specified MULTIPOINT.
GEOMETRYCOLLECTION

Geometric shapes that intersect (overlap) any of the objects in the specified GEOMETRYCOLLECTION.

Format

FieldText=GEOINTERSECTS{GEOMETRY}:POSITION
GEOMETRY

The geometric shape to query with, in Well-Known Text (WKT) format. For information about how to specify the shape, see Supported Well-Known Text Geometric Objects.

POSITION

The document field containing the position information. This field must contain unified geospatial location information.

You can specify multiple field names, in the form POSITION1:POSITION2:POSITION3, and so on. A document is returned if at least one of the fields meets the requirements of the query.

NOTE: You can optimize this field specifier by configuring the position field with the field property.

Example

FieldText=GEOINTERSECTS{POLYGON((1 1, -1 1, 0 -2, 1 -1))}:LOCATION

This example matches all documents where the geospatial region described by the LOCATION field intersects a specified polygon with vertices at (1,1), (-1,1), (0,-2), (1,-1).

FieldText=GEOINTERSECTS{POLYGON((0.075 52.233, 0.170 52.234, 0.201 52.179, 0.099 52.172))}:LOCATION

This example matches all documents where the geospatial region described by the LOCATION field intersects the polygon with longitude and latitude vertices at (0.075 52.233) (0.170 52.234) (0.201 52.179) (0.099 52.172).