From multiple rasters to one Google earth layer

To create a Google earth map, I would normally export my raster layers as a geo-referenced png file and subsequently use maptiler (or gdal2tiles.py) to create the Google earth map (see here for more details). Because I want to create a map based on several layers, I can not simply export a raster layer. Instead, I need to create a map in QGIS map composer and georeference that map, following the steps described here.

Unfortunately, as it turns out there are limits in the size of the map you can create in QGIS map composer. Perhaps there is a way to increase this, but I am not sure how. An alternative solution is to smaller create sub-sets of the map. But how to get them together as one Google earth map again?

GDAL offers several possible solutions:

  1. Build a virtual raster dataset from the different raster maps. This can be done using gdalbuildvrt (part of gdal). The output is a ‘virtual raster’ (.vrt). The original files are left untouched and the virtual raster contains a catalogue of the original files. This .vrt file can then be treated as a single file from within your GIS application or as input in maptiler or gdal2tiles.py.
  2. Merge the files into one file by gdalwarp or by gdal_merge.py and then render tiles from that one.
  3. Create map tiles for each sub-raster using e.g., maptiler or gdal2tiles. Then merge the different sets of map tiles (tile tree merge) using gdal2tiles.py with the “-r antialias” option.

The first two options are (of course) available from the command line, but also in QGIS. Go to menu: raster – miscellaneous (the raster menu offers an GUI interface to gdal). I tried out the first option, which works like a charm.

Selecting the virtual raster ‘mosaic2.vrt’ as input in maptiler. Mosaic2.vrt is a mosaic of the map1.png and map2.png raster layers.

See this post by for a more detailed example how to use gdalbuildvrt.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s