[Qgis-user] GRASS Mask Issue QGIS 2.2

Ivan Santiago isantiago at ogp.pr.gov
Mon Jul 14 07:31:00 PDT 2014


Hello all:

I'm currently working with grass plugin using QGIS 2.2.
I've been successfully working with raster data but a problem appeared when trying to use a MASK.

At the last step of the analysis with raster layers in QGIS/GRASS I tried to apply a mask.

First problem: Defining the mask:
I rasterized an area/polygon vector layer.  It should have values of 1 inside the area and NULL outside the area.
When using QGIS/GRASS tools (v.to.rast constant value=1) the program returns a raster layer covering all the region in pink.

I was expecting values of 1 and NULL outside, so I used the info (i) tool in QGIS and sampled points inside the box... inside was 1 and outside was NULL or no values shown.

Believing that this was OK I applied r.mask using the raster layer mentioned above...

Then I ran r.reclass to produce a new raster table/layer but...
instead of having just the area inside the original polygon I have computed the whole region.

Then... using the GRASS command shell:
I ran v.rast and that time it ran and gave me the results I was expecting, painting only the inside area of the original polygon.

Ran r.mask option removing the old mask
Ran r.reclass from the command shell
The reclassed raster came identical, depicting the whole region instead of the area of interest.

I do not understand. Is the mask supposed to apply to all read and produced rasters from the moment that a mask is generated?

Any help will be appreciated.
---------------------------
Iván Santiago
GIS Specialist
Information Technologies
Office of Management and Budget
787.725.9420 x 2378
Calle Cruz 254
PO Box 9023228
San Juan, PR 00902-3228
http://gis.pr.gov



More information about the Qgis-user mailing list