<div dir="ltr"><div>If you have a vector layer with (some) polygons that occur partly within the region of interest, finding the area that should become a mask means in that case spitting the polygon(s). Yes, of course you could do that, but you can equally well (easier in fact) set the region to match your vector layer (or the region of interest) manually.<br>
<br>An exception? I don't know, each user will use the functions available in a different way. I personally would prefer the current implementation, or more in general, to avoid functions to set the region automatically. In my opinion that better fits the general work flow in GRASS: the user explicitly sets the region, and functions operate on that region. <br>
<br>On the other hand, r.mask with a raster as input is an exception as mentioned already mentioned, and one could argue that it is better to have the same behaviour both when using raster or vector as input.<br><br>It is important thought that r.mask does not change the region if you use raster as input, and that is something I really think should remain the case when using a vector as input. That means that even if you would implement the suggestion above, adjusting the region to the extend of the vector layer before creating the mask, that region should be set back to the initial extend after the mask is created.<br>
<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 20, 2013 at 3:15 PM, GRASS GIS <span dir="ltr"><<a href="mailto:trac@osgeo.org" target="_blank">trac@osgeo.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">#1838: r.mask: allow use of vector map as input<br>
--------------------------+-------------------------------------------------<br>
  Reporter:  mlennert     |       Owner:  grass-dev@…<br>
      Type:  enhancement  |      Status:  closed<br>
  Priority:  normal       |   Milestone:  7.0.0<br>
 Component:  Raster       |     Version:  svn-trunk<br>
Resolution:  fixed        |    Keywords:  mask, vector, r.mask<br>
  Platform:  Unspecified  |         Cpu:  Unspecified<br>
--------------------------+-------------------------------------------------<br>
<br>
Comment(by nikosa):<br>
<br>
</div> Replying to [comment:6 pvanbosgeo]:<br>
 > One reason a user would not want to match the region extent to the<br>
 queried vector map could be that he/she is only interested in an area that<br>
 partly overlaps with the vector map, with polygons falling only partly<br>
 within the region. This still works with our suggestion, but only if the<br>
 region is set back to the initial one after the mask is created I guess.<br>
<br>
 If a user is interested in an area that partly overlaps with the vector<br>
 map, he doesn't really want to<br>
<br>
 {{{<br>
 r.mask vector=SomeVector<br>
 }}}<br>
<br>
 He rather needs to manually find the area of interest that will become a<br>
 MASK.  This sounds as an exception, rather than a general rule. What do<br>
 you think?<br>
<br>
 Thanks<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Ticket URL: <<a href="http://trac.osgeo.org/grass/ticket/1838#comment:7" target="_blank">http://trac.osgeo.org/grass/ticket/1838#comment:7</a>><br>
GRASS GIS <<a href="http://grass.osgeo.org" target="_blank">http://grass.osgeo.org</a>><br>
<br>
</font></span></blockquote></div><br></div>