How to fix a GeoTIFF that has an invalid NO DATA value: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
No edit summary
Line 28: Line 28:


==Nodata.cmd code==
==Nodata.cmd code==
The following code can be used in a cmd-file to automatically adjust the {{nodata}} value of a GeoTIFF and prints the new meta-data values after pressing enter.
<code>exiftool.exe %1 -GDALNoData=-3.4028229999999999999e+038
<code>exiftool.exe %1 -GDALNoData=-3.4028229999999999999e+038



Revision as of 12:53, 29 September 2023

When importing a GeoTIFF into a project that you are editing, it can occur that you will receive the following error:

GeoTIFF error panel shown when importing a GeoTIFF with a NO_DATA-metadata value that is in ','-number notation.

This error means that the metadata of the GeoTIFF for the NO_DATA value was written in the ','-number notation, instead of the expected '.'-number notation.

It is possible to fix the metadata of a GeoTIFF. You can download the free exiftool program to automatically adjust the NO_DATA-metadata.


How to How to fix a GeoTIFF that has an invalid NO DATA value:
  1. Download url exiftool: [1].
  2. Once downloaded, extract the files and go into the exiftool folder.
  3. Create a new file and name it a name like "nodata.cmd". This will be our automated command file.
  4. Edit this file with a text editor (such as "Kladblok")
  5. Paste the code provided below into the text editor and save.
  6. Drag your GeoTIFF file onto this cmd-file. A command prompt window will open
  7. Note that it says that it says it has changed the file. Press enter to continue
  8. Note that the new meta data is now printed and verify that the GDAL No Data value is now correct.
  9. Try to import your GeoTIFF file into your project. It should no longer show the invalid NO_DATA error.

Nodata.cmd code

The following code can be used in a cmd-file to automatically adjust the NO_DATA value of a GeoTIFF and prints the new meta-data values after pressing enter. exiftool.exe %1 -GDALNoData=-3.4028229999999999999e+038

pause

exiftool.exe %1

pause


Nodata tool command.PNG


Nodata tool exe.PNG]

Notes

  • You can also adjust the NO_DATA value to an other value than -Infinity, for example to -999.

See also