User's Guide and Reference

Polygons

A polygon is a two-dimensional surface stored as a sequence of points defining its exterior bounding ring and 0 or more interior rings. A polygon's rings cannot overlap. Therefore, by definition, polygons are always simple. Most often they define parcels of land, water bodies, and other features that have a spatial extent.

Figure 11. Polygons.

  1. A polygon whose boundary is defined by an exterior ring.
  2. A polygon whose boundary is defined by an exterior ring and two interior rings. The area inside the interior rings is part of the polygons exterior.
  3. A legal polygon because the rings intersect at a single tangent point.



top

The exterior and any interior rings define the boundary of a polygon, and the space enclosed between the rings defines the polygon's interior. The rings of a polygon can intersect at a tangent point but never cross. In addition to the other properties inherited from the superclass geometry, polygons have area.

Functions that operate on polygons:

ST_Area
Takes a polygon and returns its area as a double precision number. For more information, see ST_Area.

ST_ExteriorRing
Takes a polygon and returns its exterior ring as a linestring. For more information, see ST_ExteriorRing.

ST_NumInteriorRing
Takes a polygon and returns the number of interior rings that it contains. For more information, see ST_NumInteriorRing.

ST_InteriorRingN
Takes a polygon and an index and returns the nth interior ring as a linestring. For more information, see ST_InteriorRingN.

ST_Centroid
Takes a polygon and returns a point that is the center of the polygon's extent. For more information, see ST_Centroid.

ST_PointOnSurface
Takes a polygon and returns a point that is guaranteed to be on the surface of the polygon. For more information, see ST_PointOnSurface.

ST_Perimeter
Takes a polygon and returns the perimeter of its surface. For more information, see ST_Perimeter.


[ Top of Page | Previous Page | Next Page ]