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

starepandas.STAREDataFrame.stare_intersects seems to get confused if redundant sids are in a cover. #132

Open michaelleerilee opened 1 year ago

michaelleerilee commented 1 year ago

p is a STAREDataFrame

            p[p.stare_intersects(cover)] 

drops some data unexpectedly if cover has overlapping sids.

The following workaround produces the desired result.

            sids_ = pystare.to_compressed_range(sids)
            sids_ = pystare.expand_intervals(sids_,int(max_res),multi_resolution=False)
            p = p[p.stare_intersects(sids_)]

This workaround is not ideal as the range code can be fragile.

It is unfortunate that the multi_resolution capability is broken at present, leading to more sids to compare. See bug pystare.expand_intervals issue 122.