[GRASS-user] How to JOIN a table to vector layer using MySQL

Hamish hamish_nospam at yahoo.com
Wed Nov 8 21:07:25 EST 2006


Nicolas Devaux wrote:
> I know what is a table join, and as I say, I made the join (using Cat
> as  common fields of both tables to join), but what I want is to see
> result  within Grass on the attribute table of my vector layer.
> 
> Exemple : I have a GPS points vector layer call GPS which locate
> houses. Attributes table contain only categories number. I use MySql
> to import another table containing points informations (point id and
> house's owner names). I make the table join within Mysql and it works
> (I have in the attribute table of GPS points cover the name of
> house's owners. Now, I want to be able to use this information within
> Grass, and when I look at the attribute table, I don't have owner
> names, I have only cat number as in the attributre table before the
> join operation made in MySql. I think that I miss something... I
> would like to transform the join operation results as permanent
> information within my points cover attribute table.... Perhaps I
> should make the join table operation directly in Grass instead  of
> doing it in MySql ? If is is the solution, how can I do, what is the 
> command ?


If GPS points and house data points do not exactly line up, you may have
to use the v.distance module to fill in attributes based on nearest
point. (it has a max distance parameter, so you can avoid unmatched data
mistakes)

I have very little idea about databases, but be aware that the MySQL
driver in GRASS 6.0 was rather weak and it has been substantially
rewritten & improved for GRASS 6.2.


good luck,
Hamish




More information about the grass-user mailing list