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

Rasterio and GDAL should not both be imported in the same Python program #359

Open
mluck opened this issue Feb 10, 2025 · 1 comment
Open

Comments

@mluck
Copy link

mluck commented Feb 10, 2025

Describe the bug
It is recommended to avoid importing gdal and rasterio in the same Python program. According to https://rasterio.readthedocs.io/en/latest/topics/switch.html#mutual-incompatibilities:

Rasterio and GDAL’s bindings can contend for global GDAL objects. Unless you have deep knowledge about both packages, choose exactly one of import osgeo.gdal or import rasterio.

GDAL’s bindings (gdal for the rest of this document) and Rasterio are not entirely compatible and should not, without a great deal of care, be imported and used in a single Python program.

To Reproduce
rasterio is imported at the head of gemgis/raster.py (line 25) and gdal is imported in the same file (line 2737).

Copy link

Hello and welcome! Thanks for posting your first issue in the GemGIS project! Someone from our developers will get back to you. If your question is support related, we may transfer it to the Discussions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant