2

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.

enter image description here


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
nmtoken
13.6k5 gold badges39 silver badges91 bronze badges
asked Feb 22, 2016 at 11:29
5
  • 1
    It 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. Commented Feb 22, 2016 at 11:48
  • Is the .dbf file supposed to belong to the .shp file? Commented Feb 22, 2016 at 12:23
  • it's just a simplified example.... Commented 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? Commented Feb 22, 2016 at 14:32
  • Here is my data: wikisend.com/download/158200/test.7z Commented Feb 22, 2016 at 20:31

1 Answer 1

2

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:

enter image description here

And layer with lines:

enter image description here

Now you can make join with: Layer>Properties:

enter image description here

The result looks like this:

enter image description here

answered Feb 26, 2016 at 19:45
2
  • 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? Commented Mar 1, 2016 at 13:12
  • Try to open and edit it with an excel app. Commented Mar 1, 2016 at 15:56

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.