Fossgis: virtual raster tables and other GDAL tools - Stephan HollΒΆ

Tags: fossgis

GDAL is a handy toolkit. It is a swiss army knife for geodata conversion. It contains a whole bunch of small command line tools for raster and vector operations:

  • gdalbuildvrt: building a VRT from input data.
  • gdal_translate: transform, cut out, re-project, converting formats, etc.
  • gdalinfo: basic info about raster data
  • gdalwarp: transform rasterdata, mostly from one projection into another.
  • build image “pyramids”, bunches of tiles at various zoom levels.
  • gdal_rasterize: convert vector data to rasters.
  • ... and many more. Remember to use the --help option to show you the options for all those tools.

One of the possibilities is virtual raster tables (VRT). The basis is an xml data structure. It is a virtual GDAL format for combining other GDAL formats into a new data set. You can perform operations on it with gdal_translate, gdaladdo, gdalwarp, etc. And you can program it (both manually and supported by tools).

So [if I understood correctly]: the VRT is an xml file which can be used as input for gdal tools. Those tools then use the instructions in the VRT’s xml file to get their hands on the data. This way, you can keep the source data as-is and you don’t have to generate intermediate files (which also means keeping them in sync if the souce files change).

Some advantages: you can easily generate image catalogs automatically. You can stick to one source data set and generate the rest. You can mask areas.

Some drawbacks: editing the xml file manually is somewhat cryptical. And some speciality functions have to be added by hand anyway.

An example where he used it for: he made a “chain” that compressed TIFF files by 80% with jpeg compression, followed by internal tiling. Then combining tiles again with a VRT. And doing further processing on that virtual data set. And so on.

Conclusion: GDAL contains a whole whopping lot of helpful tools. It is efficiently useable for mass data conversion jobs. And it is available for linux/osx/windows.

hills around Heidelberg
blog comments powered by Disqus logo

About me

My name is Reinout van Rees and I work a lot with Python (programming language) and Django (website framework). I live in The Netherlands and I'm happily married to Annie van Rees-Kooiman.

Weblog feeds

Most of my website content is in my weblog. You can keep up to date by subscribing to the automatic feeds (for instance with Google reader):