SingleStore Managed Service

GEOGRAPHY_INTERSECTS

This function takes in two geospatial objects and determines whether any part of them overlap.

image
Syntax
GEOGRAPHY_INTERSECTS ( geo1, geo2 )
Arguments
  • geo1, geo2: any valid geospatial object or WKT string: path, point or polygon.

Important

If both geo1 and geo2 are points, this function only returns true if they are identical.

Return Type

Boolean

Examples
SELECT id, name FROM neighborhoods
WHERE
  GEOGRAPHY_INTERSECTS("POINT(-73.94990499 40.69150746)", shape);

SELECT *
FROM neighborhoods WITH (index = shape, resolution = 16)
WHERE GEOGRAPHY_INTERSECTS(shape,"POLYGON(...)");

Important

The with (index = c, resolution = n) syntax is an optional optimization discussed in the section Special Spatial Tuning Parameters.