sids_from_ring#
- sids_from_ring(ring, level, convex=False, force_ccw=False)#
Return a range of indices covering the region inside/outside ring. Node orientation is relevant!
- Parameters
- ring: shapely.geometry.polygon.LinearRing
Ring to lookup sids 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 of the ring
- force_ccw: bool
toggle if orientation of ring should be overwritten and ring should be interpreted as outerboundary.
- Returns
- collection of sids
Examples
>>> import starepandas >>> import shapely >>> # Note: the ring is clockwise! >>> polygon = shapely.geometry.Polygon([(0, 0), (1, 1), (1, 0)]) >>> starepandas.sids_from_ring(polygon.exterior, force_ccw=True, level=6) array([4430697608402436102, 4430838345890791430, 4430979083379146758])