[GRASSLIST:10092] adding attributes in txt file to vector

hello,

as far as I remember I asked this question before but forgot the answer and
did not find the right mails in the mailing list search.

I have a vector with distinctive cats and a txt/csv file with corresponding
ones plus attribute data - how to I import and link the txt-attribute file to
the vector file?

thanks in advance, Martin

--
Martin Wegmann

DLR - German Aerospace Center
German Remote Sensing Data Center
@
Dept.of Geography
Remote Sensing and Biodiversity Unit
&&
Dept. of Animal Ecology and Tropical Biology
University of Wuerzburg
Am Hubland
97074 Würzburg

phone: +49-(0)931 - 888 4797
mobile: +49-(0)175 2091725
fax: +49-(0)931 - 888 4961
http://www.biota-africa.org
http://www.biogis.de

On Tuesday 31 January 2006 08:29 am, Martin Wegmann wrote:

hello,

as far as I remember I asked this question before but forgot the answer and
did not find the right mails in the mailing list search.

I have a vector with distinctive cats and a txt/csv file with corresponding
ones plus attribute data - how to I import and link the txt-attribute file
to the vector file?

thanks in advance, Martin

Hi Martin,

what sort of attribute storage system are you using for your vector data? If
you are using SQlite, or any other RDBMS like PGSQL or MySQL you can simply
read the text file into a new table- then perform a join between the two
tables (... where vector.cat = new_table.cat ...). Finally, use v.db.connect
to connect the new table (with labels) to your original vector file. As for
DBF data... that might be a little more complicated. Perhaps dumping the
files to text, and using the UNIX command 'join' ??

Cheers,

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

On Tuesday 31 January 2006 18:35, Dylan Beaudette wrote:

On Tuesday 31 January 2006 08:29 am, Martin Wegmann wrote:
> hello,
>
> as far as I remember I asked this question before but forgot the answer
> and did not find the right mails in the mailing list search.
>
> I have a vector with distinctive cats and a txt/csv file with
> corresponding ones plus attribute data - how to I import and link the
> txt-attribute file to the vector file?
>
> thanks in advance, Martin

Hi Martin,

what sort of attribute storage system are you using for your vector data?
If you are using SQlite, or any other RDBMS like PGSQL or MySQL you can
simply read the text file into a new table- then perform a join between the
two tables (... where vector.cat = new_table.cat ...). Finally, use
v.db.connect to connect the new table (with labels) to your original vector
file. As for DBF data... that might be a little more complicated. Perhaps
dumping the files to text, and using the UNIX command 'join' ??

I am still not very familiar with PGSQL even though I installed it and use it
as GRASS db. I will give the PGSQL - join - v.db.connect a try and will
report how it worked out.

thanks, Martin