[GRASS-user] How to find all vectors that overlay a given region

Hamish hamish_nospam at yahoo.com
Tue Sep 18 07:25:25 EDT 2007


Eric wrote:
> > I'm trying to find out how to determine how many vectors in an entire
> > mapset
> > overlay a given region. What is the best approach to do this - import the
> > current region as a vector using v.in.region (type parameter as area), then
> > run v.select on every vector in the mapset in a loop, or is there a better
> > way? I see that v.overlay/v.select takes one map as input for both the
> > ainput and binput parameters.
..
> Sorry; I'll clarify. I meant how to find the number of vector maps,
> regardless of vector type, that overlay a given region. I'm really only
> interested in the map names.

Write a shell script using 'g.mlist vect'. As a fist pass use 'v.info -g' to
get the outer bounding box region of the map to be tested. If there is no rough
overlap between the two maps then quickly continue on to the next. If the
bounding boxes do overlap you have to run v.select. If the result of v.select
$TESTMAP + v.in.region box contains >= 1 area (test result map with 'v.info
-t'), count that as a hit & log the name of the map.
 
> > How hard would it be to change the structures in v.select to accept
> > multiple inputs, or is this even feasible?

probably possible, but not worth the trouble when a shell script can do the
job?? If work is being done on v.select a high priority should be to add a
operator="no overlap". (what to call that? "op=discrete"?)


Hamish



      ____________________________________________________________________________________
Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos.
http://autos.yahoo.com/index.html
 





More information about the grass-user mailing list