How to fix a GeoTIFF that has an invalid NO DATA value: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 6: | Line 6: | ||
It is possible to fix the metadata of a GeoTIFF. You can download the free ''exiftool'' program to automatically adjust the {{nodata}}-metadata. | It is possible to fix the metadata of a GeoTIFF. You can download the free ''exiftool'' program to automatically adjust the {{nodata}}-metadata. | ||
Once downloaded, extract the file | {{editor steps|title=How to fix a GeoTIFF that has an invalid NO DATA value | ||
| Download url exiftool: [https://exiftool.org/]. | |||
| Once downloaded, extract the files and go into the exiftool folder. | |||
| Create a new file and name it a name like "exiftool.cmd". This will be our automated command file. | |||
| Edit this file with a text editor (such as "Kladblok") | |||
| Paste the code provided below into the text editor and save. | |||
| Drag your GeoTIFF file onto this cmd-file. A command prompt window will open | |||
| Note that it says that it says it has changed the file. Press enter to continue | |||
| Note that the new meta data is now printed and verify that the ''GDAL No Data'' value is now correct. | |||
| Try to import your GeoTIFF file into your project. It should no longer show the invalid {{nodata}} error. | |||
}} | |||
<gallery> | |||
File:nodata_tool_download.PNG|''Exiftool's'' download page. Download the window's zip. | |||
File:nodata_tool_extract.PNG|Once downloaded, extract the ''exiftool'' from the zip file. | |||
</gallery> | |||
<code>exiftool.exe nodata_tiff_comma.tiff "-GDALNoData=-3.4028229999999999999e+038"</code> | <code>exiftool.exe nodata_tiff_comma.tiff "-GDALNoData=-3.4028229999999999999e+038"</code> |
Revision as of 12:18, 29 September 2023
When importing a GeoTIFF into a project that you are editing, it can occur that you will receive the following error:
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:
- Download url exiftool: [1].
- Once downloaded, extract the files and go into the exiftool folder.
- Create a new file and name it a name like "exiftool.cmd". This will be our automated command file.
- Edit this file with a text editor (such as "Kladblok")
- Paste the code provided below into the text editor and save.
- Drag your GeoTIFF file onto this cmd-file. A command prompt window will open
- Note that it says that it says it has changed the file. Press enter to continue
- Note that the new meta data is now printed and verify that the GDAL No Data value is now correct.
- Try to import your GeoTIFF file into your project. It should no longer show the invalid NO_DATA error.
exiftool.exe nodata_tiff_comma.tiff "-GDALNoData=-3.4028229999999999999e+038"
C:\Users\TYGRON\Downloads\downloadtool\exiftool-12.65\exiftool.exe %1 -GDALNoData=-3.4028229999999999999e+038
pause
C:\Users\TYGRON\Downloads\downloadtool\exiftool-12.65\exiftool.exe %1
pause
Notes
- You can also adjust the NO_DATA value to an other value than -Infinity, for example to -999.