Skip to content

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

@mluck

Description

@mluck

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions