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

Raffaele Morelli raffaele.morelli at gmail.com
Thu Nov 9 03:38:53 EST 2006


2006/11/9, Hamish <hamish_nospam at yahoo.com>:
>
> 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.


Ok but you are talking about a query. You are only issue a SQL instruction,
so your results are temporarily and grass does not know nothing about it. As
Jarek said, you must create a new table and then put your query's results in
it using a INSERT INTO new_table_name SELECT * FROM tbl_a JOIN tbl_b
USING(key_name) or JOIN ON .. ...

> 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.


Right... as long the table doesn't exist.

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 ?


The solution would be to work with views.
Grass sees views, connects to views and this is wonderful, but... more it
would be if it could handle them correctly. I tried to link to views but
quering on the attributes doesn't work correctly.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20061109/5100d4f2/attachment.html


More information about the grass-user mailing list