[GIS] How do different GIS systems determine a Polygon’s interior

areapolygonspherical-geometry

I'm interested in understanding how real-world GIS systems and their data encode Polygons.

Specifically, how do they resolve the ambiguity of a Polygon's interior on a sphere?

Background: in 2D, it's trivial to pick the side of the boundary that has a finite area, since the 2D plane is infinite. However, a sphere is finite, so it's impossible to know which side is inside without making additional assumptions.

Possible approaches that I know of:

  1. Right-hand-rule: exterior boundaries are always specified in clockwise order, and holes are specified in anticlockwise order. (There is of course the left-hand-rule, too).
  2. Smallest area: for any given ring, always pick the side with the smallest area. I'm not sure how you would specify a large-range Polygon: perhaps an empty exterior ring followed by holes?
  3. Equirectangular: Simply consider the equirectangular projection on an infinite 2D plane. However, this assumes features are chopped at the antemeridian, otherwise a fallback would be required to one of the two methods above.

My personal preference is the first approach, but I'm interested in understanding whether this is common in standard GIS systems.

Best Answer

Major GIS systems and their methods for resolving the inherent ambiguity:

  • ESRI: right-foot rule.
  • ArcGIS: right-foot rule.
  • SQL Server 2012: left-foot rule. Prior to SQL Server 2012, larger-than-hemisphere polygons would throw an error.

GeoJSON does not specify an ordering.