Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rasterising protected areas doesn't work for multiple countries #22

Open
vwvbrand opened this issue Jan 30, 2025 · 0 comments
Open

Rasterising protected areas doesn't work for multiple countries #22

vwvbrand opened this issue Jan 30, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@vwvbrand
Copy link
Contributor

In the class PARasterizer (module protected_areas):

When running for the bounding box of North-East Catalonia,

Bounding box coordinates in WGS84: 2.8354183199747673, 42.30491856806418, 3.2069789434116736, 42.5061345059027

the current code doesn't consider if the merged geopackage with protected areas contain multiple layers

Rasterizing the merged GeoPackage file...
/src/env/lib/python3.12/site-packages/pyogrio/geopandas.py:261: UserWarning: More than one layer found in 'merged_pa.gpkg': 'FRA_protected_areas' (default), 'ESP_protected_areas'. Specify layer parameter to avoid this warning.
result = read_func(
Columns: Index(['geometry'], dtype='object')
...
Error: 'year'

Possible solution: read layers by gdal.OpenEx and then create dictionary self.gdfs = {} to loop over in PARasterizer.reproject_pa_data

@vwvbrand vwvbrand added the bug Something isn't working label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant