Outdated Version

You are viewing an older version of this section. View current production version.

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.
Info

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(...)");
Info

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