maup
maup copied to clipboard
Add UserWarning when assign fails to assign
trafficstars
TODO: checkup on the behavior of assign when a geometry in the source is completely untouched by any target geometry
Update: maup will be NaN/undefined when this occurs. E.g.:
import geopandas as gpd
from shapely.geometry import Polygon
source = gpd.GeoSeries([
Polygon([(0,0), (1,0), (1,1), (0,1)]),
Polygon([(1,0), (2,0), (2,1), (1,1)])
])
target = gpd.GeoSeries([
Polygon([(0,0), (1,0), (1,1), (0,1)]),
])
>>> maup.assign(source, target)
0 0.0
1 NaN
dtype: float64
>>> maup.assign(target, source)
0 0
dtype: int64
I am going to make maup throw a user warning when either of these two ^ things occur.