SpatioTemporal / STAREPandas

STAREpandas adds SpatioTemporal Adaptive Resolution Encoding (STARE) support to pandas DataFrames. https://starepandas.readthedocs.io/en/latest/
MIT License
4 stars 1 forks source link

to_stare_level broken #158

Closed NiklasPhabian closed 10 months ago

NiklasPhabian commented 10 months ago

The following fails

!wget https://www2.census.gov/geo/tiger/GENZ2019/shp/cb_2019_us_region_5m.zip

regions = geopandas.read_file('cb_2019_us_region_5m.zip')
regions = starepandas.STAREDataFrame(regions)
region_sids = regions.make_sids(level=10, convex=False)
regions.set_sids(region_sids, inplace=True)
midwest = regions[regions['NAME']=='Midwest']
midwest.to_stare_level(4)
NiklasPhabian commented 10 months ago

starepandas 0.6.6

NiklasPhabian commented 10 months ago

oh duh. This isn't supposed to work in its current implementation. We need to delineate stronger between SDFs with a single SID per row and a set of SIDs. to_stare_level() currently only works on single SIDs. to_sids_singlelevel() does the trick.