sids_from_polygon#

sids_from_polygon(polygon, level, convex=False, force_ccw=False)#

Lookup STARE index values for a polygon. A Polygon is a planar Surface defined by 1 exterior ring and 0 or more interior boundaries. Each interior ring defines a hole in the Polygon.

Parameters:
polygon: shapely.geometry.Polygon

Polygon to look sids up for

level: int

Maximum STARE level to use for lookup

convex: bool

Toggle if the STARE lookup should be performed on the convex hull rather than the actual geometry. This will be applied for both the exterior ring and the interior rings.

force_ccw: bool

toggle if orientation of ring should be overwritten and ring should be interpreted as outer boundary. Note: Interior rings will always be forced to be clockwise!

Returns:
sids:

collection of sids

Examples

>>> import starepandas
>>> import shapely
>>> polygon = shapely.geometry.Polygon([(0, 0), (2, 0), (1, 1)])
>>> starepandas.sids_from_polygon(polygon, level=5)
array([4423097784031248389, 4430416133425725445, 4430979083379146757])