I have a geopandas
GeoDataFrame containing hundreds of shapely
MultiPolygon geometries. The polygons overlap in lots of places. I'd like to make a new geometry that contains a count of how many of them overlap. Something like this:
Does anyone have any ideas for how to approach this? I can't even see a way in.
Eventually I'd especially like to be able to weight the polygons, so that some polygons might be worth 2 on their own. Doing this with
shapely's Z field might be nice.
Aside: I'm not particularly tied to any of these libraries, it's just where I've ended up. The coordinates in these geometries are actually pixel coordinates — I'm stumbling towards making a raster to overlay on another image. I'd prefer to keep my footprint as small as possible, since I'd like to be able to deploy this stuff to cloud servers etc, where I might not be able to install random stuff.