Polygon
Constructs a Polygon instance from multiple LineString instances.
Each LineString instance represents a ring.
Each ring must have at least 4 points, be closed, and must not self-intersect.
The first described ring must be the exterior ring.
The exterior ring cannot self-intersect.
Any interior ring must be entirely contained by the outer ring.
Interior rings cannot intersect or overlap each other. Interior rings cannot share an edge.
Interior rings represent holes in the external ring.
Example
A square within another square. Note that the exterior square is described first.
Geo.Polygon(
Geo.LineString(
Geo.Point(Geo.Longitude(0.0), Geo.Latitude(0.0)),
Geo.Point(Geo.Longitude(10.0), Geo.Latitude(0.0)),
Geo.Point(Geo.Longitude(10.0), Geo.Latitude(10.0)),
Geo.Point(Geo.Longitude(0.0), Geo.Latitude(10.0)),
Geo.Point(Geo.Longitude(0.0), Geo.Latitude(0.0)),
),
Geo.LineString(
Geo.Point(Geo.Longitude(2.0), Geo.Latitude(2.0)),
Geo.Point(Geo.Longitude(8.0), Geo.Latitude(2.0)),
Geo.Point(Geo.Longitude(8.0), Geo.Latitude(8.0)),
Geo.Point(Geo.Longitude(2.0), Geo.Latitude(8.0)),
Geo.Point(Geo.Longitude(2.0), Geo.Latitude(2.0)),
),
)Content copied to clipboard
External resources
Constructs a single-ring Geo.Polygon instance from multiple Point instances.
The polygon must have at least 4 points, be closed, and must not self-intersect.
Example
A square:
Geo.Polygon(
Geo.Point(Geo.Longitude(0.0), Geo.Latitude(0.0)),
Geo.Point(Geo.Longitude(1.0), Geo.Latitude(0.0)),
Geo.Point(Geo.Longitude(1.0), Geo.Latitude(1.0)),
Geo.Point(Geo.Longitude(0.0), Geo.Latitude(1.0)),
Geo.Point(Geo.Longitude(0.0), Geo.Latitude(0.0)),
)Content copied to clipboard