[Qgis-user] linking n to 1 data

Bernd Vogelgesang bernd.vogelgesang at gmx.de
Sun Jan 24 07:13:45 PST 2016


Hi,

Am 22.01.2016, 11:06 Uhr, schrieb Alexandre Neto <senhor.neto at gmail.com>:

> Hello Joe,
>
> Can you please expand your question a litle bit? Gives an Idea of how  
> your data is organized, and exactly what are you trying to >print. Some  
> images might help we understand the problem and give you an hand.


For already a long time, I struggle with the same problem!

I think it actually doesn't matter how his data is organized. When you  
have a layer with a common ID to e.g. a database/table with numerous  
entries for this ID you may set up a relation and browse the associated  
data, but I found no easy way in QGIS so far to also display them on the  
map/do other stuff with them.

The only referred way of solving that which I found on the web, is to  
replicate the geometries for each entry in the database/table.

But is no convenient way with QGIS to achieve that so far:
Export WKT of the layer to a new field -> join those attributes to the  
database/table -> export this as csv -> reimport this dataset with "Add  
Delimitzed Text Layer", set to WKT.

This works with points, but when I need to do this with polygons, this  
approach miserably fails, cause the WKT for even small sized polygons is  
way too long for a string field, so the WKT is crippled!

In my specific case which I try to solve for a long time, I receive  
several point and polygons layers and only one attribute table with a  
variety of 0 to numerous entries per ID in those layers.

Even for a small amount of features it is a pain in the ass to produce  
those "materialized 1:n-relations" for being able to make a map.
In my despair, I hacked together an external R script doing all the stuff  
for me, producing all needed layers with one geometry per  
database/table-entry, but I would like to share this with colleagues  
without having to install and maintain R at their computers as well.

In my point of view it would be nice to have a model/python script to do  
at least the failing stuff:
Add vector layer, add Table, set Join 1 and 2 -> receive new vector layer  
with features for each matching entry.

Shouldn't something like this be quite easy with python? (sorry, no real  
idea where to start from with python)

Cheers
Bernd


>
> Alexandre Neto
>
> Jörg Hulka <joerg.hulka at gmail.com> escreveu no dia quinta, 21/01/2016 às  
> 13:03:
>>
>> To whom it may concern
>>
>>
>>
>>>> I got trouble linking n to 1 data. I got in my case the problem that  
>>>> there is a specific area key (shape-file) which is >>connected to  
>>>> different data sets in a dbf file. I only mangaged to print one data  
>>>> set to one area. But there are more sets with >>the same area key,  
>>>> which I want to print.
>>
>> I hope there is help to print out all data sets to the specific areas.
>>
>>
>>
>>>> I'm using 2.8.4. Is there a specific plugin?
>>
>>
>>
>>>> Thanks for your help. I'm using 2.8.4.
>>
>>
>>
>>>> Joe
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org
>> List info: http://lists.osgeo.org/mailman/listinfo/qgis-user
>> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-user
> --Alexandre Neto
> ---------------------
> @AlexNetoGeo
> http://sigsemgrilhetaswordpress.com
> http://gisunchained.wordpress.com



-- 
Bernd Vogelgesang
Siedlerstraße 2
91083 Baiersdorf/Igelsdorf
Tel: 09133-825374
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20160124/3e40e0ef/attachment.html>


More information about the Qgis-user mailing list