[GRASSLIST:9243] How to delete features based on attribute?

A Horacio Samaniego horacio at unm.edu
Tue Nov 29 08:46:20 EST 2005


Hi,
I'm a bit confused about some results that I'm getting. This is what I 
intend to do using grass 6 with pgsql on the OSX release.

I have:
1 vect map (points with a cat attribute)
1 area map (conversted from a rast using v.to.rast)

I need to:
find closest attribute on area map to the point map

The idea:
is to run the v.distance command and obtain in this way the cat values of 
the area map closest to the points.

The problem:
on the area map I have a category (call it nonforest) that I need to get 
rid of (on the raster I would just run an if() using the r.mapcalc) before 
I run the v.distance command to find the areas closest to the points. 
(side note: perhaps we need a v.dist.rast command?)

However, I do not seem to be successful in the v.distance as not ALL the 
points have a cat value for the closest area feature. (I did not use the 
dmax option... so it should find the closest. --even if its way far!) Any 
hint?

There are some places where I believe I could have done something wrong.

1.-  I just went to the table (in pgsql) and erased all the records that 
had the not-wanted value (nonforest, DELETE FROM <table> WHERE 
label='nonforest'). Hoping that this will just get rid of the feature in 
GRASS having such a label.
2.- After running the same v.distance with dmax=0 I get the same results 
as before (only 73 of the 202 points have cat values for the area map?) 
Which I Believe that it just get the area values where the point is 
"sitting"...

The question:

How should one delete a feature on a vector map based on its attribute? is 
this the correct way to proceed?

How can we estimate the distance to the next feature (the one that we are 
not intersectin?)

thanks

I'll appreciate any hint to solve this...
H


Horacio Samaniego
Department of Biology
University of New Mexico
Albuquerque, NM. 87131
Phone:  (505) 277-3431
Fax:    (505) 277-0304

(http://www.unm.edu/~horacio)




More information about the grass-user mailing list