Site menu:


Site search

GRASS r.patch

I did say this blog was about GIS, so here’s the first article to prove it.  Hey, I can’t talk about bikes all the time!

The problem: Aerial imagery in 1kmx1km tiles.  Three years of acquisition (2007, 2008, 2009) abutting within one tile.  Each year’s coverage area is on a separate tile with white space in the remainder of the image.  It is impossible to see full coverage of the entire tile because one image is always ‘blanking out’ the other two.

The solution: Once again, bust out GRASS via QGIS (running via OSGEO4W), my favourite power-stack of GIS apps.  Use the following commands to merge the images together:

  • to import the three images (all have same extents)
  • manually set region and resolution to match the images
  • r.composite to obtain one colour raster rather than red,green,blue layers for each image
  • r.null.val to set the white background value to null
  • r.patch to patch the rasters together into one
  • r.out.tiff to export the final product to .tiff
  • gdal_translate to convert .tif to .ecw
Example of r.patch

Example of r.patch

Once again, I’m impressed with the ease, quality and functionality of the QGIS/GRASS stack.  A perfect final product, a logical workflow, and lots of flexibility.  Thinking further on this, I think the r.mapcalc function would have done the same job as r.patch with proper use of isnull() statements.  I haven’t tried this, but suspect it would work.  Thoughts?

G:\Revolution\Clients\Ontario\Blue_Sky_Net_Group\Municipalities\Strong\Data\Hard Services\20100210


Pingback from GIS-Lab Blog» Архив блога » Новости вокруг 43
Time March 9, 2010 at 6:29 am

[…] Объединение нескольких снимков в один с удалением белых полей (GRASS). […]

Write a comment