Child pages
  • GDAL
Skip to end of metadata
Go to start of metadata

GDAL is a translator library for raster geospatial data formats that is released under an X/MIT style Open Source license by the Open Source Geospatial Foundation. As a library, it presents a single abstract data model to the calling application for all supported formats. It also comes with a variety of useful commandline utilities for data translation and processing. The NEWS page describes the May 2012 GDAL/OGR 1.9.1 release.

The main page can be found on You can find how to install GDAL on this page. If you desire QGIS, then it is recommended to install QGIS, including GDAL via the OSGeo4Setup utitility. This allows you to get hold on the latest versions of QGIS and GDAL utitlities.
A good recipe for installing without QGIS is describe on this blog

For a compiled Windows(executable) version you can go to and chose the appropriate development, stable of release version of gdal and than download the core version (something like gdal-19-1600-core.msi). The python binding can also be found here.

Below you can find various tips to use the various GDAL utitilities. You are requested to append tips and trics.

GDAL info

One of the main GDAL utilities is gdalinfo. This utility gives you information on the various formats that are supported by GDAL.
Main syntax is

gdalinfo filename

- netCDF --> ArcINFO ASCII raster
use gdalinfo <> to find out which subdatasets are available in your nc. For instance in the following subdatasets are available.

  SUBDATASET_1_DESC=[1775x3782] surface_elevation (32-bit floating-point)
  SUBDATASET_2_DESC=[100x3] legend (16-bit integer)
  SUBDATASET_3_DESC=[100x2] legend_values (32-bit floating-point)
  SUBDATASET_4_DESC=[100x80] legend_description (8-bit character)
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)

By using the following syntax you can convert the to mv.asc

gdal_translate -of AAIGrid NETCDF:"":Band1 mv.asc

In the example above the part NETCDF:"":Band1 can be different in any other netCDF. For instance the netCDF ( that can be downloaded from the NMDC site gives the following gdalinfo information

  SUBDATASET_1_DESC=[319x273] //lat (32-bit floating-point)
  SUBDATASET_2_DESC=[319x273] //lon (32-bit floating-point)
  SUBDATASET_3_DESC=[1x319x273] //prediction (32-bit floating-point)
  SUBDATASET_4_DESC=[1x319x273] //stations (32-bit floating-point)
  SUBDATASET_5_DESC=[1x319x273] //stationvalues (32-bit floating-point)
Corner Coordinates:
Upper Left  (    0.0,    0.0)
Lower Left  (    0.0,  512.0)
Upper Right (  512.0,    0.0)
Lower Right (  512.0,  512.0)
Center      (  256.0,  256.0)

Check the subdataset name subdataset_3_name. It starts with HDF5 and ends with //prediction. This Entire name has to be used to derive data from this netcdf. So everything after the SUBDATASET_3_NAME=. The export to ASCII is

gdal_translate -of AAIGrid HDF5:""://prediction

Note the pathname, this is not used. Exporting is best done from the location where the netCDF is stored.