point polygon operators

Back to Geometric functions


Point-polygon operators relate Point geometries to Polygon geometries, and convert between points and vertex sequences. These are among the most commonly used operators in spatial analysis, enabling joins between point datasets and area datasets. How these joins relate to the other matching functions, and to a JOIN in SQL, is described in Spatial joins and allocation.

  • Point_in_polygon - for each point, return the index of the polygon that contains it (or null if none)
  • Point_in_ranked_polygon - for each point, return the index of the polygon that contains it according to a ranking attribute; used when polygons may overlap
  • Point_in_all_polygons - return all point-polygon containment pairs as a relation; used when a single point may lie in multiple polygons
  • Sequence2points - decompose each arc or polygon into its individual vertex points, one row per vertex
  • Points2sequence - construct arcs from an ordered sequence of vertices (alias: points2arc)
  • points2polygon - construct polygons from an ordered sequence of vertices
  • points2multi_point - construct multipoints from a set of vertices (since 20.2.0)