Sunday, February 19, 2012

Armchair mapping using GRASS GIS

After reading my previous post a friend asked me why I didn't use just GRASS GIS. That's really a valid question. Since the GDAL/OGR utilities are some of my daily tools, I'm more familiar with them than with GRASS. Out of interest I developed a workflow how to extract and vectorize waterbodies from Landsat images using (almost solely) GRASS GIS. The resulting features I wanted to upload to OpenStreetMap.
This time the Nam Ngum 1 hydro power reservoir in Laos was my test area. Like Nam Leuk last time it was only roughly digitized and some of its islands needed to be remapped.
Since GRASS uses own raster and vector data formats, it was necessary to import the images:

I took value 30 as threshold, but this depends on the image and needs to be evaluated. I set the threshold rather low to make sure that no land was classified as water. To assign mixed pixel along the lakeshore to water I expanded the waterbodies for one pixel with r.grow.

Like in my previous workflow there were noisy pixels I wanted to get rid of. I had to export the image to edit it in GIMP. Because I set the nodata option to zero, no data pixels are shown transparent in GIMP.

As a last processing step I wanted to smooth the newly created vector geometry. The v.generalize module that generalizes and smooths geometries was the only processing step I did in GRASS in my previous workflow.

Again it was necessary to finally tag the geometries in JOSM and correct the multipolygon relation. A task that needed to be done manually.

Newly created Nam Ngum in the background

Conclusion
The final result is basically the same like in the previous presented workflow, but this one is probably even easier:
With GRASS it is not necessary to clip the images, it's enough to set the computational region. Another needless step is to delete polygons that represents land area because I separated the raster pixels to value 1 or null (i.e. no data) and GRASS ignores the null data pixels during the vectorization.
A disadvantage in GRASS are the additional import and export steps.