GDAL

Aus Geoinformation HSR
Zur Navigation springen Zur Suche springen

GDAL (ausgesprochen "Gudel") ist eine Rasterformate-Bibliothek (C++ Open Source von Frank Warmerdam) die typischerweise über die Kommandozeile gesteuert werden.

Siehe auch:

Alternative Rasterdaten-Konverter:

  • TatukGIS Viewer (free, Windows)
  • ECW Header Editor, ERMapper (free, Windows)

Dokumentation

Weblinks:

Formate

Often used formats:

  1. GeoTIFF
  2. HGT
  3. (VRT - s special GDAL file for input which points to the 'real' files)
  4. (JPG/JPEG is a lossy file format suited for images but not for grid files like DTMs. Note that JPEG is also a compression option inside TIFF!)

Hier ein Auszug aus den verfügbaren Rasterformate ('ro' is read-only driver; 'rw' is read or write (ie. supports CreateCopy); 'rw+' is read, write and update (ie. supports Create)):

  • BMP (rw+): MS Windows Device Independent Bitmap
  • GIF (rw): Graphics Interchange Format (.gif)
  • GMT (rw): GMT NetCDF Grid Format
  • GTiff (rw+): GeoTIFF
  • HFA (rw+): Erdas Imagine Images (.img)
  • ILWIS (rw+): ILWIS Raster Map
  • INGR (rw+): Intergraph Raster
  • JP2ECW (rw+): ERMapper JPEG2000
  • JP2MrSID (ro): MrSID JPEG2000
  • JPEG (rw): JPEG JFIF
  • MrSID (ro): Multi-resolution Seamless Image Database (MrSID)
  • PNG (rw): Portable Network Graphics
  • PNM (rw+): Portable Pixmap Format (netpbm)
  • RMF (rw+): Raster Matrix Format
  • SDTS (ro): SDTS Raster
  • SRTMHGT (rw): SRTMHGT File Format
  • USGSDEM (rw): USGS Optional ASCII DEM (and CDED)
  • VRT (rw+): Virtual Raster
  • WCS (ro): OGC Web Coverage Service
  • WMS (ro): OGC Web Map Service

GDAL How To

gdal_translate for format conversion

 gdal_translate -of XYZ elevation.tif elevation.xyz

gdal_merge for merging maps

 gdal_merge -o eins.tif -co TILED=YES -co COMPRESS=LZW --optfile _filelist.txt -n 0 -init 255

Note the use of -n 0 when merging to treat areas of zero value as nodata. The gdalwarp commands are used in this case to transform to WGS84 so the images will be in a common coordinate system.

gdal_warp for coordinate transformation

 gdalwarp img1.img img1_wgs84.img -t_srs WGS84
 gdalwarp img2.img img2_wgs84.img -t_srs WGS84
 gdal_merge.py img1_wgs84.img img2_wgs84.img -o mosaic.tif -n 0

gdaladdo for generating tile pyramids

 gdaladdo -r gauss C:\SG.tif  2 4 8 16 32 64 128 256

GeoTiff Compression for Dummies

Blog post: http://blog.cleverelephant.ca/2015/02/geotiff-compression-for-dummies.html

GDAL and Python

See Geoprocessing mit Python