gives a canonical representation of the polygon poly with shared coordinates and with inner and outer boundaries.


gives a canonical representation of poly with the specified filter.


  • CanonicalizePolygon is used to get a simple standard representation of a polygon from various representations and descriptions.
  • CanonicalizePolygon converts a polygon to an optimized standard form Polygon[{p1,p2,},{outer1,outer2inner2,}].
  • The points pi are the endpoints of nonintersecting line segments and sorted into Sort order.
  • An outer boundary outerk is a closed curve with line segments {pi,pj}, possibly touching at endpoints but no other crossings.
  • An inner boundary innerk is a closed curve with line segments {pi,pj}, possibly touching at endpoints but no other crossings.
  • The general polygon specification makes it possible to give degenerate polygons representing lines and points. By using the "filter" specification, it is possible to control whether these lower-dimensional components are kept.
  • Possible "filter" specifications include:
  • Allall components, including lines and points
    Fullfull-dimensional components only


open allclose all

Basic Examples  (1)

Find the canonical form of a Polygon:

Scope  (9)

Basic Uses  (7)

CanonicalizePolygon works on polygons:



Polygon with holes:

CanonicalizePolygon works on polygons with geographic entities:

Polygon with GeoPosition:

Polygon with GeoPositionXYZ:

Polygon with GeoPositionENU:

Polygon with GeoGridPosition:

Self-intersecting polygons:

Polygons with disconnected components:

Polygons in :

Specifications  (2)

Find all components of polygons:

Find full-dimensional components of polygons:

Applications  (2)

Set up a graphics complex with shared coordinates:

Find self-intersection points of given segments:

Properties & Relations  (4)

Using CanonicalizePolygon to get PolygonCoordinates:

The CanonicalizePolygon of simple polygons preserves the number of polygon coordinates:

OuterPolygon gives the canonical representation of the outer polygon:

InnerPolygon gives the canonical representation of the inner polygon:

Possible Issues  (1)

CanonicalizePolygon works only on geometric regions:

Introduced in 2019