[GRASS-dev] How to find whether one vector is contained by another

A lot of time I get requests to find out what vector navigation tracklines
fall within a certain region. This is easy to do by visual inspection
(turning on and off vectors in gis.m) when the number of vectors is low, but
becomes too much work for large numbers (i.e., 200). What is the best way to
find out if one vector is contained by another, without writing any output?
All I need is a listing of vector names.

I was thinking maybe set up a bash switch statement to look at a set of
cases between the vector's region extents and the extents of the region in
question. It seems to me there would be a lot of scenarios to consider and
would be really complex (i.e, north_map < north_region && north_map >
south_region && ...)

Is there any existing vector program that performs this functionality
already? If not, what do you think would be the best approach to solve this
problem?

~ Eric.

Hi everyone,

the concept of using geometry index is an excellent idea, and one that is used
quite often in R: i.e. many functions return the index of matching
observations- which can then be used for further calculations.

Cheers,

On Wednesday 11 October 2006 12:07, Jeroen Wortel wrote:

Hi Eric,

you could use a script that goes through the available vector tracks
and do for each a v.select option=overlap output=dummyfile. The
contents of the output map are not important, but the fact that it is
created or not. You could then check in your script if it was created
or not. If it is created, the vector track touches the polygon
comprising your region of interest.

A nice addition to Grass would be vector selections that are kept in
memory instead of written to an output file. Only the pointers to the
geometry need to be kept in memory, no actual geometry. These
selection could be used in other grass commands just like normal
vector maps. This mechanism works for example in GenaMap (called
active ID's) and is very powerful for scripting purposes and saves a
lot of temporary files on disk. (This would mean however that vector
indices should be kept in the vector files instead of created every
time)that When doing a selection inside or a proximity in GenaMap, the
number of selected features is returned.

At 20:09 11-10-2006, Patton, Eric wrote:
>A lot of time I get requests to find out what vector navigation tracklines
>fall within a certain region. This is easy to do by visual inspection
>(turning on and off vectors in gis.m) when the number of vectors is low,
> but becomes too much work for large numbers (i.e., 200). What is the best
> way to find out if one vector is contained by another, without writing
> any output? All I need is a listing of vector names.
>
>I was thinking maybe set up a bash switch statement to look at a set of
>cases between the vector's region extents and the extents of the region in
>question. It seems to me there would be a lot of scenarios to consider and
>would be really complex (i.e, north_map < north_region && north_map >
>south_region && ...)
>
>Is there any existing vector program that performs this functionality
>already? If not, what do you think would be the best approach to solve
> this problem?
>
>~ Eric.
>
>_______________________________________________
>grassuser mailing list
>grassuser@grass.itc.it
>http://grass.itc.it/mailman/listinfo/grassuser

RC(0.3)1r2m B-- C-- D++ F N- S? O! OCGP a29

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

Hi Eric,

you could use a script that goes through the available vector tracks and do for each a v.select option=overlap output=dummyfile. The contents of the output map are not important, but the fact that it is created or not. You could then check in your script if it was created or not. If it is created, the vector track touches the polygon comprising your region of interest.

A nice addition to Grass would be vector selections that are kept in memory instead of written to an output file. Only the pointers to the geometry need to be kept in memory, no actual geometry. These selection could be used in other grass commands just like normal vector maps. This mechanism works for example in GenaMap (called active ID's) and is very powerful for scripting purposes and saves a lot of temporary files on disk. (This would mean however that vector indices should be kept in the vector files instead of created every time)that
When doing a selection inside or a proximity in GenaMap, the number of selected features is returned.

At 20:09 11-10-2006, Patton, Eric wrote:

A lot of time I get requests to find out what vector navigation tracklines
fall within a certain region. This is easy to do by visual inspection
(turning on and off vectors in gis.m) when the number of vectors is low, but
becomes too much work for large numbers (i.e., 200). What is the best way to
find out if one vector is contained by another, without writing any output?
All I need is a listing of vector names.

I was thinking maybe set up a bash switch statement to look at a set of
cases between the vector's region extents and the extents of the region in
question. It seems to me there would be a lot of scenarios to consider and
would be really complex (i.e, north_map < north_region && north_map >
south_region && ...)

Is there any existing vector program that performs this functionality
already? If not, what do you think would be the best approach to solve this
problem?

~ Eric.

_______________________________________________
grassuser mailing list
grassuser@grass.itc.it
http://grass.itc.it/mailman/listinfo/grassuser

RC(0.3)1r2m B-- C-- D++ F N- S? O! OCGP a29

Patton, Eric wrote:

A lot of time I get requests to find out what vector navigation
tracklines fall within a certain region. This is easy to do by visual
inspection (turning on and off vectors in gis.m) when the number of
vectors is low, but becomes too much work for large numbers (i.e.,
200). What is the best way to find out if one vector is contained by
another, without writing any output? All I need is a listing of vector
names.

[v.select; ... ; g.remove]

Jeroen Wortel wrote:

A nice addition to Grass would be vector selections that are kept in
memory instead of written to an output file. Only the pointers to the
geometry need to be kept in memory, no actual geometry. These
selection could be used in other grass commands just like normal
vector maps. This mechanism works for example in GenaMap (called
active ID's) and is very powerful for scripting purposes and saves a
lot of temporary files on disk. (This would mean however that vector
indices should be kept in the vector files instead of created every
time)that When doing a selection inside or a proximity in GenaMap, the
number of selected features is returned.

there is a v.external "Memory" driver from OGR, but I'm not sure what
it does exactly.

in the GDAL source: ogr/ogrsf_frmts/mem/
* Project: OpenGIS Simple Features Reference Implementation
* Purpose: Implements OGRMemDriver class.

but nothing I could find in:

http://gdal.org/ogr/ogr_formats.html

Hamish