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

Add rasterio.env block in each method to allow factory defined gdal config #168

Closed
vincentsarago opened this issue Dec 9, 2020 · 2 comments · Fixed by #170
Closed

Add rasterio.env block in each method to allow factory defined gdal config #168

vincentsarago opened this issue Dec 9, 2020 · 2 comments · Fixed by #170

Comments

@vincentsarago
Copy link
Member

in #108 we introduced custom API route to wrap any gdal code within a specific environment. This worked well for python 3.7 but not for python 3.8. IMO adding a with rasterio.env(): block on top of each call to gdal (rio-tiler) code will make this easier.

How To

  • add gdal_config in titiler.endpoints.factories.BaseFactory with default to dict
  • add with rasterio.env(**self.gdal_config): on top of gdal blocks
@kylebarron
Copy link
Member

This worked well for python 3.7 but not for python 3.8

Why not? Is the change here in Python, or rasterio, or GDAL?

@vincentsarago
Copy link
Member Author

I think there is a change in python, I think adding the with rasterio.Env is less of a hack anyway!

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

Successfully merging a pull request may close this issue.

2 participants