GeoTIFF / georaster

Wrapper around Georeferenced Rasters like GeoTIFF and soon JPG and PNG that provides a standard interface
Apache License 2.0
81 stars 32 forks source link

rasterio-generated geotiffs have wrong metadata #84

Open SarahG-579462 opened 9 months ago

SarahG-579462 commented 9 months ago

Describe the bug A clear and concise description of what the bug is. When opening a rasterio-generated geotiff with georaster, I get the wrong ymin and ymax, and likely other metadata. This is likely because rasterio has an opposite standard to GDAL/QGIS with respect to the grid ordering..

As a result of this, using georaster-for-leaflet, the map is subsequently displayed upside down. It is properly displayed in QGIS.

To Reproduce Steps to reproduce the behavior:

  1. Create a geotiff with rasterio/rioxarray
  2. Open said geotiff with georaster
  3. See erroneous metadata
  4. When opening with georaster for leaflet, the raster is displayed upside down.

Upside down (from rioxarray): image

Correct display (re-exported with QGIS): image

DanielJDufour commented 9 months ago

Hello, @SarahG-579462 . Thank you for sharing this important bug! Would you happen to be able to share the geotiff that is causing issues and I can add it to our test cases?

SarahG-579462 commented 9 months ago

Sure, here's an example that doesn't work: scengen_tg_mean_annual_rcp45_p50_2031-2060.zip

and one that does: QC_bool.zip

Note that, when I simply tried to change the ymin and ymax, the map continued to be displayed upside down, in the right location. Flipping them, or trying to change the sign of the pixelHeight, resulted in a crash for georaster for leaflet.