[GRASS-user] Re: vector operations based on rasters

Tim Michelsen timmichelsen at gmx-topmail.de
Thu Sep 25 18:53:41 EDT 2008


Hello,
thanks for your help. but this is not all that I was looking for.
 >> Basically, I'd like to run v.extract/v.overlay not on a
 >> vector-to-vector basis but on a vector-to-raster basis.
 >
 > g.region rast=dem_name
 > v.in.region dem_box
 >
 > then v.overlay or v.select, depending on if you want to want to clip
 > touching vector areas at the bound or not.
=> With your tip I am just creating a boundary vector with the region 
extends.

But my raster has been created by mapcalc:


1. I created the raster like this:
(elev => SRTM DEM)

r.mapcalc "myraster=if(elev < 1000,elev, null())

=> now I have a huge (by area) raster which contains cell values in 
floating points.
=> The raster now has areas with NULL values because the terrain 
elevation is above 1000 m.

2. now I have the vector
landcover: Global Land Cover 2000

Now I would like the polygons from the landcover, which are situated 
below 1000m.
How can I achieve this?

My idea:
a) simplify the raster because the raster is too complex for data type 
conversion:
r.mapcalc "myraster_simple=if(myraster,1, null())

b) convert to vector:
r.to.vect -s in=myraster_simple out=myraster_simple

c) run v.overlay.

Is there a simplier and more efficient approach?

How do I also extract those areas of the raster which intersect with 
certain landuse types?

Thanks and kind regards,
Timmie



More information about the grass-user mailing list