Table join in QGIS

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Table join in QGIS

Alex Bruy
Hi, list!
  Does QGIS have ability to join tables? Can I join an attributive table of layer with an ordinary dbf or PostGIS table?
I mean SQL join, NOT spatial. For example, I have polygon layer with attributive table and two fields within it

+---------+---------+
| Shape | ICode |
+---------+---------+

and simple dbf table with many fields:

+--------+---------+------------+-----+
| Code | Name | Address | ..... |
+--------+---------+------------+-----+

Can I join this tables on field "Code"? So the result must be:

+---------+--------+---------+------------+-----+
| Shape | Code | Name | Address | ..... |
+---------+--------+---------+------------+-----+

Best regards,
  Alexander Bruy

mailto: [hidden email]

-- реклама -----------------------------------------------------------
Теперь в ДВА раза больше хостинга от Hvosting.ua!
http://hvosting.ua/actions.html

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Table join in QGIS

Giovanni Manghi
Hi,
use the Ftools extension, after having it installed

tools --> Data Management Tools --> Join Attributes


-- G --


On Tue, 2009-04-14 at 11:29 +0300, Alexander Bruy wrote:

> Hi, list!
>   Does QGIS have ability to join tables? Can I join an attributive table of layer with an ordinary dbf or PostGIS table?
> I mean SQL join, NOT spatial. For example, I have polygon layer with attributive table and two fields within it
>
> +---------+---------+
> | Shape | ICode |
> +---------+---------+
>
> and simple dbf table with many fields:
>
> +--------+---------+------------+-----+
> | Code | Name | Address | ..... |
> +--------+---------+------------+-----+
>
> Can I join this tables on field "Code"? So the result must be:
>
> +---------+--------+---------+------------+-----+
> | Shape | Code | Name | Address | ..... |
> +---------+--------+---------+------------+-----+
>
> Best regards,
>   Alexander Bruy
>
> mailto: [hidden email]
>
> -- реклама -----------------------------------------------------------
> Теперь в ДВА раза больше хостинга от Hvosting.ua!
> http://hvosting.ua/actions.html
>
> _______________________________________________
> Qgis-developer mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/qgis-developer

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re[2]: Table join in QGIS

Alex Bruy
Giovanni Manghi wrote:
  > Hi,
  > use the Ftools extension, after having it installed
  >
  > tools --> Data Management Tools --> Join Attributes
  >

Many thanks for your reply, Giovanni. I try Ftools, but this plugin can join only two vector layers into
one single layer. In my case one table is an attribute table of vector layer, but another table - isn't.
Second table is ordinary dbf table (without geometry), so this plugin don't work for me.

Best regards,
  Alexander

-- реклама -----------------------------------------------------------
Теперь в ДВА раза больше хостинга от Hvosting.ua!
http://hvosting.ua/actions.html

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Table join in QGIS

Borys Jurgiel-2
Wednesday 15 of April 2009 15:16:30 Alexander Bruy napisał(a):
> Many thanks for your reply, Giovanni. I try Ftools, but this plugin can join
only two vector layers into
> one single layer. In my case one table is an attribute table of vector layer,
but another table - isn't.
> Second table is ordinary dbf table (without geometry), so this plugin don't
work for me.

It should work. Just select 'join dbf table' instead of 'join vector layer'.
At least in the fTools for QGIS 1.x Do you use QGIS 0.x?
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Table join in QGIS

Carson Farmer
In reply to this post by Alex Bruy
Alexander,

> Giovanni Manghi wrote:
>   > Hi,
>   > use the Ftools extension, after having it installed
>   >
>   > tools --> Data Management Tools --> Join Attributes
>   >
>
> Many thanks for your reply, Giovanni. I try Ftools, but this plugin can join only two vector layers into
> one single layer. In my case one table is an attribute table of vector layer, but another table - isn't.
> Second table is ordinary dbf table (without geometry), so this plugin don't work for me.
>  
fTools works fine with standalone tables as well... you can join dbf
tables to vector layers by doing the following:
In the 'Join data' section, just click on 'Join dbf table', and 'browse'
to the dbf table on your system...

Carson

--
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation (NCG),
Email: [hidden email]
Web:   http://www.carsonfarmer.com/
       http://www.ftools.ca/


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Table join in QGIS

Alex Bruy
In reply to this post by Borys Jurgiel-2
Carson, Giovanni, thanks for yours replies.
  The problem is in my bad English. Sorry.
  Yes, fTools works, it produce a new layer with attributes, from both tables. But this is not what I want.
For my task it's necessary to have one layer with minimal attribute set and few standalone tables, which
time from time joined to the layer. In one case used one table, in another case - another table.
  I think, for this task better use PostGIS or SpatialLite...

Regards,

Alexander

-- реклама -----------------------------------------------------------
Теперь в ДВА раза больше хостинга от Hvosting.ua!
http://hvosting.ua/actions.html

_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Table join in QGIS

Barry Rowlingson
On Fri, Apr 17, 2009 at 11:56 AM, Alexander Bruy <[hidden email]> wrote:
> Carson, Giovanni, thanks for yours replies.
>  The problem is in my bad English. Sorry.
>  Yes, fTools works, it produce a new layer with attributes, from both tables. But this is not what I want.
> For my task it's necessary to have one layer with minimal attribute set and few standalone tables, which
> time from time joined to the layer. In one case used one table, in another case - another table.
>  I think, for this task better use PostGIS or SpatialLite...

 I've used PostGIS for this, and created VIEWs from my spatial table
and my data table. The spatial table is one row per feature, and the
data table has rows which have feature id, month, and rainfall in that
month.

 If I want to map rainfall in a particular month, I do a join on the
two tables, selecting the month, and joining on the feature-id. I end
up with a view that has one row per feature, keeping the_geom, and
having the rainfall for each feature in that month.

 It would be nice to have this kind of feature dynamically available
for any kind of vector layer, but then you end up duplicating an RDBMS
in Qgis. Better that we stop using shapefiles and get SpatialLite
working :)

Barry
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Table join in QGIS

Carson Farmer
In reply to this post by Alex Bruy
Alexander,
> Carson, Giovanni, thanks for yours replies.
>   The problem is in my bad English. Sorry.
>   Yes, fTools works, it produce a new layer with attributes, from both tables. But this is not what I want.
> For my task it's necessary to have one layer with minimal attribute set and few standalone tables, which
> time from time joined to the layer. In one case used one table, in another case - another table.
>   I think, for this task better use PostGIS or SpatialLite...
>  
I yes, this is a topic that was discussed at the hackfest a few weeks
back. Currently, it is not implemented, though we hope to have something
like this available in the future. I think there are some issues with
the way in which layers and data are represented in QGIS at the moment,
but this is indeed on the 'todo' list.

For now, as you mentioned, postgis or spatialight are the best solutions...

Carson

--
Carson J. Q. Farmer
ISSP Doctoral Fellow
National Centre for Geocomputation (NCG),
Email: [hidden email]
Web:   http://www.carsonfarmer.com/
       http://www.ftools.ca/


_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer
Reply | Threaded
Open this post in threaded view
|

Re: Table join in QGIS

pcav
In reply to this post by Barry Rowlingson
Barry Rowlingson ha scritto:
> in Qgis. Better that we stop using shapefiles and get SpatialLite
> working :)

Spatialite *is* working! :)
What we miss now is a SL manager, much in the style of Martin's PostGIS
Manager. Looks a reasonably easy task, with lots of potential...
All the best.
--
Paolo Cavallini: http://www.faunalia.it/pc
_______________________________________________
Qgis-developer mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/qgis-developer