starepandas.STAREDataFrame.make_sids#
- STAREDataFrame.make_sids(level, convex=False, force_ccw=True, n_partitions=1)#
Generates and returns the STARE representation of each feauture.
- Parameters
- level: int; 0<=level<=27
STARE level to use for the STARE lookup
- convex: bool
Toggle if STARE indices for the convex hull rather than the G-Ring should be looked up
- force_ccw: bool
Toggle if a counterclockwise orientation of the geometries should be enforced
- n_partitions: int
Number of workers used to lookup STARE indices in parallel
- Returns
- sids: numpy.ndarray
array of (set of) STARE index values
Examples
From points
>>> import starepandas, geopandas >>> lats = [-72.609177, -72.648590, -72.591286] >>> lons = [-41.255402, -42.054047, -41.625336] >>> geoms = geopandas.points_from_xy(lons, lats) >>> sdf = starepandas.STAREDataFrame(geometry=geoms) >>> sdf.make_sids(level=6, convex=False) 0 2299437706637111654 1 2299435211084507366 2 2299436587616075270 Name: sids, dtype: int64
From polygons
>>> gdf = geopandas.read_file(geopandas.datasets.get_path("naturalearth_lowres")) >>> sdf = starepandas.STAREDataFrame(gdf) >>> sids = sdf.make_sids(level=5)