create

fun create(outerRing: List<GeoPoint>, vararg holes: List<GeoPoint>): GeoPolygon
fun create(outerRing: List<GeoPoint>, holes: List<List<GeoPoint>>): GeoPolygon

Create a GeoPolygon instance.

Parameters

outerRing

A list of GeoPoints representing the outer ring of the polygon. The outer ring must contain at least 4 unique points. The first and the last point must be identical, but no other duplicates are allowed. Each subsequent pair of points represents an edge in the polygon.

holes

A list of "inner" rings. Each of these rings has the same requirements as the outerRing. A point is considered "inside" the polygon if it is contained by an odd number of rings and "outside" if it's contained by an even number of rings.

Throws

if the input polygon break some of the rules outlined above.