Skip to content

What is a simple polygon

Annette Locke edited this page Apr 5, 2022 · 2 revisions

ESRI Simple polygon

The Esri Simple polygon is a polygon such that for every segment the polygon exterior is unambiguously to the left of the segment, and the polygon interior is unambiguously to the right of the segment.

As a result of the above property the following is also true for such polygons:

  • segments can touch other segments only at the end points
  • segments have non-zero length
  • outer rings are clockwise and holes are counterclockwise
  • each polygon ring has non-zero area
  • rings can't overlap
  • rings can't have spikes

Non OGC compliant properties:

  • order of the rings does not matter, although after a call to Simplify, the polygon ring order will be established such that each exterior ring is followed by its holes
  • rings can be self-tangent at vertices.

OGC Simple MultiPolygon

OGC specification defines Polygon and MultiPolygon types. In OGC spec, a MultiPolygon is a collection of one or more Polygons, while a Polygon consists of a single Exterior ring and zero or more holes. See [OGC Specifications, Simple Feature Access Part 1 - Common Architecture].(https://www.ogc.org/standards/sfa)

An OGC Simple Polygon is a polygon such that for every segment, the polygon exterior is unambiguously to the right of the segment and the polygon interior is unambiguously to the left of the segment.

In addition to that, each ring of the polygon must be simple (defined below) and the polygon interior must be a topologically connected point set. That is, any two points inside of the polygon can be connected by a continuous path that does not touch polygon boundary.

An OGC Simple MultiPolygon is a collection of the OGC Simple Polygons such that no polygons overlap, and if their boundaries touch they can do so only at vertices.

A ring is OGC simple if it it does not pass through the same point twice.

As a result of the above properties the following is also true for OGC Simple MultiPolygon:

  • segments can touch other segments only at the end points
  • segments have non-zero length
  • outer rings are clockwise and holes are counterclockwise
  • each polygon ring has non-zero area
  • rings can't overlap
  • rings can't have spikes
  • rings can't be self-tangent.

IMPORTANT: Esri Polygon specification is sufficient to represent both MultiPolygon and Polygon of the OGC specification.

OGC Specification can be considered as an additional restrictions over the Esri specification. An OGC MultiPolygon or OGC Polygon which is OGC Simple is always also Esri Simple That means one can use OGC method in Repair tool to repair geometries for Esri or use Operator_simplify_OGC to fix geometries and they will be Esri simple as well.

Representing OGC Multipolygons using Esri Polygons

Esri Polygons can represent OGC Multipolygons exactly. To ensure that Esri Polygon satisfies the OGC specification of Simple MultiPolygon, one ca use either Operator_simplify_OGC available in GeometryX, or use Repair Geometry tool in Geoprocessing with the OGC method.

There is one important thing that needs to be taken into account when a user manually converts Esri polygon validated with OGC method. The Esri Polygons are always stored with the Exterior rings being clockwise and holes being counterclockwise, while the OGC specification says they need to be reversed. Therefore, when manually processing shapes, for OGC storage, one need to reverse the ring orienation and the result will be completely compatible with OGC spec.

After the Esri polygon is repaired using the OGC method, its rings will be grouped to form OGC Polygons. To extract the OGC Polygons from the result MultiPolygon, iterate the rings. A ring with the positive area starts an OGC Polygon, then there are zero or more rings with negative area (holes), then when a ring with positive area is encountered, it means the next OGC Polygon, and so on.

Examples OGC vs Esri

Most of the time, a polygon which is valid for Esri will be also valid for OGC, with the following notable exceptions:

OGC_V_Esri_SimplePoly

  • a. OGC MultiPolygon must consist of two rings - an exterior and a hole, because the rings must be simple, while Esri Polygon allows this to be either two rings, or a single ring that is self tangent.
  • b. OGC MultiPolygon must consist of two Polygons that touch, while Esri Polygon can be either two exterior rings, or one exterior ring with a hole. OGC does not allow this to be an exterior ring with a hole because then the interior would not be connected - it is impossible to draw a path from the left interior to the right interior without crossing the boundary.
  • c. OGC MultiPolygon consisting of two polygons that touch, while Esri Polygon could be either two exterior rings, or a single exterior ring which is self tangent.
Clone this wiki locally