[GRASS5] question about v.patch

I thought I remembered a discussion about this in the past 2-3 months but
couldn¹t find it in the archives. So I¹m asking. Please excuse if this has
been answered.

I¹ve got a bunch of vector files of streams in a series of adjacent areas
that I want to combine into a single stream map. v.patch is the most obvious
way to do it. However, I want to append the attribute tables of the vector
files when I combine the vector shapes. That is I want to combine streamset1
with streamset2 to make streamset3. I want streamset3 to have an attribute
table with all the records of streamset1 plus all the records of streamset2.
The formats of the tables of streamset1 and streamset2 are identical. The
cats of streamset1 and streamset2 overlap (that is cat is not unique across
all the records in all the stream files).

It is beginning to look like this is not possible using v.patch, because
v.patch combines the vectors (keeping the cats), but not the attribute
tables. So here are my questions:

1. I¹m I correct that this isn¹t possible using v.patch?
2. Is there some other way to do it in GRASS? v.overlay doesn't look right
from the man page, but maybe I just don't understand the options. Currently,
I only REALLY need one of the attributes so I'm thinking that I'll convert
all to raster, using the field I want for the new raster category, then
r.patch. However, there may well come a time when I want to combine vectors
and need more attributes.

Thanks
Michael
______________________________
Michael Barton, Professor of Anthropology
School of Human Evolution and Social Change
Arizona State University
Tempe, AZ 85287-2402
USA

voice: 480-965-6262; fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton

I saw some discussion on this a while back also, but it wasn't helpful. Generally, yes that's the way it works, and not much desire/time to change it then.

The method I use: export both with v.out.ogr to shapefile with different dsn's (ie streamset1 & streamset2) with the same 'layer' name. Use ogr2ogr -append to add one to the other. Import that back in as a new vector. Slow and tedious, but it works for now.

It looks like v.overlay could work with the default 'or' operator, but unfortunately it only works on areas (according to the docs), and I needed to patch to point vectors when I looked into it. Tho I never actually TRIED it - maybe the docs are out of date.

On Jan 31, 2005, at 5:47 PM, Michael Barton wrote:

I thought I remembered a discussion about this in the past 2-3 months but
couldn’t find it in the archives. So I’m asking. Please excuse if this has
been answered.

I’ve got a bunch of vector files of streams in a series of adjacent areas
that I want to combine into a single stream map. v.patch is the most obvious
way to do it. However, I want to append the attribute tables of the vector
files when I combine the vector shapes. That is I want to combine streamset1
with streamset2 to make streamset3. I want streamset3 to have an attribute
table with all the records of streamset1 plus all the records of streamset2.
The formats of the tables of streamset1 and streamset2 are identical. The
cats of streamset1 and streamset2 overlap (that is cat is not unique across
all the records in all the stream files).

It is beginning to look like this is not possible using v.patch, because
v.patch combines the vectors (keeping the cats), but not the attribute
tables. So here are my questions:

1. I’m I correct that this isn’t possible using v.patch?
2. Is there some other way to do it in GRASS? v.overlay doesn't look right
from the man page, but maybe I just don't understand the options. Currently,
I only REALLY need one of the attributes so I'm thinking that I'll convert
all to raster, using the field I want for the new raster category, then
r.patch. However, there may well come a time when I want to combine vectors
and need more attributes.

-----
William Kyngesburye <kyngchaos@charter.net>
http://webpages.charter.net/kyngchaos/

"History is an illusion caused by the passage of time, and time is an illusion caused by the passage of history."

- Hitchhiker's Guide to the Galaxy

William K said:

It looks like v.overlay could work with the default 'or' operator, but
unfortunately it only works on areas (according to the docs), and I
needed to patch to point vectors when I looked into it. Tho I never
actually TRIED it - maybe the docs are out of date.

if ( type[0] == GV_LINE && (operator == OP_OR || operator == OP_XOR) )
        G_fatal_error ( "Operator '%s' is not supported for type line.",
                         operator_opt->answer );

If v.overlay can't do it yet, I guess I'd most likely see a bit of awk
scripting in my future....

-- Mark

Mark P. Line
Polymathix
San Antonio, TX

Michael Barton wrote:

I thought I remembered a discussion about this in the past 2-3 months but
couldn¹t find it in the archives. So I¹m asking. Please excuse if this has
been answered.

I¹ve got a bunch of vector files of streams in a series of adjacent areas
that I want to combine into a single stream map. v.patch is the most obvious
way to do it. However, I want to append the attribute tables of the vector
files when I combine the vector shapes. That is I want to combine streamset1
with streamset2 to make streamset3. I want streamset3 to have an attribute
table with all the records of streamset1 plus all the records of streamset2.
The formats of the tables of streamset1 and streamset2 are identical. The
cats of streamset1 and streamset2 overlap (that is cat is not unique across
all the records in all the stream files).

It is beginning to look like this is not possible using v.patch, because
v.patch combines the vectors (keeping the cats), but not the attribute
tables. So here are my questions:

1. I¹m I correct that this isn¹t possible using v.patch?
2. Is there some other way to do it in GRASS? v.overlay doesn't look right
from the man page, but maybe I just don't understand the options. Currently,
I only REALLY need one of the attributes so I'm thinking that I'll convert
all to raster, using the field I want for the new raster category, then
r.patch. However, there may well come a time when I want to combine vectors
and need more attributes.

Yes, this is a problem, because it is not yet implemented. If you need only an attribute of type integer, you can simply v.reclass + v.patch.

Radim