Raster Format Conversion Using gdal translate

From Tuflow
Revision as of 22:48, 11 April 2022 by Ellis Symons (talk | contribs)
Jump to navigation Jump to search

This page lists useful batch file examples for using gdal_translate.exe. For complete documentation on this tool please visit gdal.org/programs/gdal_translate

Basic Format Conversion=

Format conversion can be done using "-of <format_name>" then specifying the "<source_dataset> <destination_dataset>".

ASC to GeoTIFF

gdal_translate.exe -of GTiff DEM_M01_5m.asc DEM_M01_5m.tif

ASC to GPKG

gdal_translate.exe -of GPKG DEM_M01_5m.asc DEM_M01_5m.gpkg

GeoTIFF to ASC

  • -co: (Creation Option) - output format specific option
    • SIGNIFICANT_DIGITS=<n>: limits the precision
gdal_translate.exe -of AAIGrid -co SIGNIFICANT_DIGITS=8 DEM_M01_5m.asc DEM_M01_5m.gpkg