SINTEF / Geomaker

4 stars 4 forks source link

GeoTIFF output #34

Closed TheBB closed 4 years ago

TheBB commented 4 years ago

This PR adds support for GeoTIFF output.

GeoTIFF files are ordinary TIFF files with some added metadata. The most important metadata is the terrestrial coordinate system the data are mapped in. This PR only produces output in ETRS89 UTM zone 33 north, and contains more or less the minimal amount of metadata that prevents QGIS from complaining when opening the file.

In addition, GeoTIFF has support for an arbitrary affine transformation matrix that maps image coordinates onto terrestrial coordinates. This is useful for us, since we can generate a rectangular image that is relevant to only the region under consideration, but a sufficiently standards-compliant GeoTIFF viewer can still accurately map the data onto the terrestrial coordinate system.

In the image below I've opened a file in QGIS, which is the GeoTIFF viewer I've used to validate this PR. As you can see the image is tilted in the UTM33N coordinate system, but the actual data array in the TIFF file does not include any of the black areas.

Screenshot from 2020-02-19 11-33-25

CC @VikingScientist

VikingScientist commented 4 years ago

I love it :heart: Will test it after lunch!