You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GeoJSON MultiPolygon geometries support multiple linear rings in their coordinates array following the same rules as those in polygons. Each ring after the first represents a hole.
A linear ring is the boundary of a surface or the boundary of a hole in a surface.
A linear ring MUST follow the right-hand rule with respect to the area it bounds, i.e., exterior rings are counterclockwise, and holes are clockwise.
Note: the [GJ2008] specification did not discuss linear ring winding order. For backwards compatibility, parsers SHOULD NOT reject Polygons that do not follow the right-hand rule.
Though a linear ring is not explicitly represented as a GeoJSON geometry type, it leads to a canonical formulation of the Polygon geometry type definition as follows:
For type "Polygon", the "coordinates" member MUST be an array of linear ring coordinate arrays.
For Polygons with more than one of these rings, the first MUST be the exterior ring, and any others MUST be interior rings. The exterior ring bounds the surface, and the interior rings (if present) bound holes within the surface.
This matcher will make no assumptions about winding order. A planned future matcher will check that. Per the standard, as long as it meets the above criteria, it is a valid polygon object. It will validate the geometry using the toBeMultiPolygonGeometry functionality.
Description
GeoJSON MultiPolygon geometries support multiple linear rings in their coordinates array following the same rules as those in polygons. Each ring after the first represents a hole.
This matcher will make no assumptions about winding order. A planned future matcher will check that. Per the standard, as long as it meets the above criteria, it is a valid polygon object. It will validate the geometry using the toBeMultiPolygonGeometry functionality.
Example Matcher Usage
Passing Tests
Good MultiPolygons
Test each for clockwise and counterclockwise:
Illogical Holes
Failing Tests
Invalid Inputs To Matcher
Rejects each of the following:
undefined
,null
,false
,true
,0
,NaN
{ someProp: 'I am not GeoJSON', id: 4 }
{}
''
,'Random Feature',
Non-Passing Polygons
The text was updated successfully, but these errors were encountered: