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

Raffaele Morelli raffaele.morelli at gmail.com
Wed Nov 8 06:27:17 EST 2006


Hi
I use to work with grass vectors with attributes stored in a MySQL db.
But it's not very clear when you say


> I did the Join operation with Mysql and it works perfectly. But, when I
> come back in Grass, it is not possible to see the result within the
> attribute table... Joined attributes are not in the table. It seems that
> grass is not able to see results of the joined operation made in Mysql.


What kind of join are you talking about?
Do you mean a db view resulting from a two (or more) table join?

Vectors have categories which identify polygons. You must "link" those
values with the corresponding key on your table, so when calling
db.connectyou must specify a valid database name, valid table name and
finally a valid
key on your table.
Valid means that polygons id's (categories) need a value stored in the table
to link to.

Try to create a dummy table containing a field with the same value your
categories have, and link it to the vector using that field.

Hope this helps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20061108/8de6fb1a/attachment.html


More information about the grass-user mailing list