Fixes a rasterio query using format=json and a MemoryFile issue #1824
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
There is an issue when writing the raster data with the MemoryFile.
The issue is present in the demo and can be tested easily with a query such as this one:
https://demo.pygeoapi.io/master/collections/gdps-temperature/coverage?f=json&lang=en-US&bbox=-118,52,-116,54
This fix (more an optimization) changes the code to not work with a MemoryFile at all (doesn't need to) when the queried format is json.
Note, the MemoryFile is still being used when format isn't json.
Related Issue / discussion
Additional information
Dependency policy (RFC2)
Updates to public demo
Contributions and licensing
(as per https://github.com/geopython/pygeoapi/blob/master/CONTRIBUTING.md#contributions-and-licensing)