cogeotiff / rio-cogeo

Cloud Optimized GeoTIFF creation and validation plugin for rasterio
https://cogeotiff.github.io/rio-cogeo/
BSD 3-Clause "New" or "Revised" License
310 stars 42 forks source link

`info` pydantic models in 2.2.0 breaks dictionary access #200

Closed geospatial-jeff closed 3 years ago

geospatial-jeff commented 3 years ago

The rio_cogeo.cogeo.info function used to return a dictionary but as of 2.2.0 returns a pydantic model. This causes a breaking change because before 2.2.0 the caller would access the output of info using dictionary indexing (info["GEO"]["CRS"]) but pydantic requires dot notation (info.GEO.CRS).

This was the solution in rio-tiler when it was migrated to pydantic models: https://github.com/cogeotiff/rio-tiler/blob/master/rio_tiler/models.py#L37-L39