[GRASS-user] r.to.vect problem

Hamish hamish_nospam at yahoo.com
Sun Feb 11 18:28:59 EST 2007


Tyler Smith wrote:
> On Fri, Feb 09, 2007 at 02:47:25PM +1300, Hamish wrote:
> > you can also use r.mapcalc to make a MASK map if you don't want to
> > modify your raster map.
> > 
> > r.mapcalc "MASK = if(oldmap > 5)"
> > 
> > "g.remove MASK" when done.
> > 
> > or,
> > 
> > r.mapcalc "newmap = if(oldmap > 5, oldmap, null() )"
> > # if( this, then use this, otherwise use this )
> > 
> 
> Thanks! I stumbled onto r.mapcalc myself, and realized that I wouldn't
> need to convert to vectors after all. Which is good, because r.to.vect
> takes a long time on my laptop. I used r.mapcalc to produce new
> 'binary' maps with all values 5 and up switched to 1, everything else
> switched to 0, then used r.coin to go through and calculate all the
> overlaps. There is probably a better way to transfer the data into R,
> but for a single 8x8 matrix this wasn't too bad.

Also check out the r.reclass module, it lets you make new "virtual"
raster maps based on the values in another raster map. Might save you
some time & disk space.

> Now I have to figure out what exactly I'm going to do with my
> data... Maybe it's just because my previous experience learning R and
> Emacs has toughened me up a bit, but I'm finding GRASS is a lot of
> fun!

In my experience, if someone has lots of experience with either UNIX or
GIS (dating back to ArcInfo) then GRASS is not too hard to learn. If
someone does not know either of those two things, then the learning
curve can be very steep. If someone knows both well, then GRASS is a
breath of fresh air.


Hamish




More information about the grass-user mailing list