For this, we wouldn't need to copy the entire Vector object.
Selecting features in vector data is generally optimized at lower levels (I know OGR was quite efficient through SQL requests, but don't know too much about geopandas, I couldn't find any detail on rasterize in their documentation: https://geopandas.org/search.html?q=rasterize).
It seems we are using this kind of code quite often when we want to select one or several geometries (e.g., https://github.com/GlacioHack/xdem/blob/main/tests/test_volume.py#L22):
I feel maybe it would make sense to have a wrapped functionality such as:
For this, we wouldn't need to copy the entire Vector object. Selecting features in vector data is generally optimized at lower levels (I know OGR was quite efficient through SQL requests, but don't know too much about
geopandas
, I couldn't find any detail onrasterize
in their documentation: https://geopandas.org/search.html?q=rasterize).