SV: [GRASS-user] Re: Limit d.raster with vector map

Martin Album Ytre-Eide Martin.Album.Ytre-Eide at nrpa.no
Fri Jul 1 09:51:18 EDT 2011


Thanks!

I also got an answer from Sylvain (see under). I tested both methods, but the best (and safest) is v.to.rast and r.mask. Worked nicely!
I was kind of hoping that was a function for this......well it is not to hard to do when scripting.

Thanks.

Martin



hi,

2 ways to do that:
- set the region extents to match the vector map (g.region vect=your_vector)
- transform the vector into raster (v.to.rast), then use this new raster as a mask


Sylvain


________________________________
Fra: grass-user-bounces at lists.osgeo.org [mailto:grass-user-bounces at lists.osgeo.org] På vegne av Nick Jachowski
Sendt: 30. juni 2011 18:37
Til: Daniel Lee
Kopi: grass-user at lists.osgeo.org
Emne: Re: [GRASS-user] Re: Limit d.raster with vector map

I would do what Daniel said, but use the raster (use command v.to.rast) as a mask (use command r.mask) to limit the displayed area to the vector map area.

On Thu, Jun 30, 2011 at 9:40 PM, Daniel Lee <Lee at isi-solutions.org<mailto:Lee at isi-solutions.org>> wrote:
I would do the following, assuming you've got an area vector that's covering
the raster data you want to show:

1. Convert the vector to a raster with r.to.vect
2. Reclassify it so that it's got only two values: 1 and NoData.
3. Multiply the reclassified raster with the raster data that you want to
limit to the area of the vector. The old values will be preserved in the
resulting map because x * 1 = x, but everything that's not collocated with
the vector map will be removed because it's multiplied with NoData.

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Limit-d-raster-with-vector-map-tp6533406p6533536.html
Sent from the Grass - Users mailing list archive at Nabble.com.
_______________________________________________
grass-user mailing list
grass-user at lists.osgeo.org<mailto:grass-user at lists.osgeo.org>
http://lists.osgeo.org/mailman/listinfo/grass-user

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20110701/54d6d806/attachment-0001.html


More information about the grass-user mailing list