I've got a shapefile lines with ID attribute and .dbf with values which corresponds do ID. Every value in dbf is in different record.
I want to style lines and display label using these values from dbf. I tried to use Join tool in layer's properties in QGIS but it joined only a few of values.
I shown you just a simplified example...
My "real life" problem is a little bit different. I've got a shapefile with geometry of roads. Every link of the roads has a unique ID attribute. On the other hand I've got a dbf file with information about road restriction.
Structure of dbf is: road_linkID - type - value
road_link1 - max_height - 2
road_link1 - speed limit - 50
road_link1 - max_weight - 3,5
road_link2 - speedlimit - 60
road_link3 - max_weight - 3,5
road_link3 - speedlimit - 60
road_link3 - max_height - 4
When I'm using layer\properties\join to my road.shp adds one column with only one parameter:
road_link1 - max_height - 2
road_link2 - speedlimit - 60
road_link3 - max_weight - 3,5
-
1It sounds like you already have the solution but something went wrong. Maybe you can provide the join / link command you used if you cant find the error yourself. If it only joined / linked a few values, you may have given the wrong data for the attributes to join or have some ghostsigns (e.g. spaces) that prevent a proper join or link.Papierwolf– Papierwolf2016年02月22日 11:48:07 +00:00Commented Feb 22, 2016 at 11:48
-
Is the .dbf file supposed to belong to the .shp file?Joseph– Joseph2016年02月22日 12:23:04 +00:00Commented Feb 22, 2016 at 12:23
-
it's just a simplified example....pawaelus– pawaelus2016年02月22日 12:37:52 +00:00Commented Feb 22, 2016 at 12:37
-
Could you perhaps share your data so that others could test it? From the example you gave, your shapefile only contains 3 attributes whereas your .dbf contains more (rows = features; columns = attributes). I think maybe you want to add more columns?Joseph– Joseph2016年02月22日 14:32:22 +00:00Commented Feb 22, 2016 at 14:32
-
Here is my data: wikisend.com/download/158200/test.7zpawaelus– pawaelus2016年02月22日 20:31:50 +00:00Commented Feb 22, 2016 at 20:31
1 Answer 1
Is it possible to modify your .dbf file ? In your case with your simple data "join" is one to one relationship. In my opinion it should looks like this:
And layer with lines:
Now you can make join with: Layer>Properties:
The result looks like this:
-
I think it would be enough. I can't modify my dbf by hand because it's data of whole country so, it would took years to change everything. Do you know which tools I could use to modify?pawaelus– pawaelus2016年03月01日 13:12:40 +00:00Commented Mar 1, 2016 at 13:12
-
Try to open and edit it with an excel app.Artec– Artec2016年03月01日 15:56:18 +00:00Commented Mar 1, 2016 at 15:56