5

I downloaded a Nigeria shapefile and loaded it via the add vector layer where I picked out the three .shp files within the zip file and displayed them on the layers panel. I can see the shapes displayed on the canvas.

On the canvas there are no state names or local government names so I thought those attributes may be in a .csv file, included in the zip file. I tried to add it as a delimited text file but the file doesn't contain any coordinates.

Nothing is displayed on the canvas, no state names or anything. How do I make the attributes within the .csv file to be displayed on the canvas?

I'd like to mention that I'm a beginner in GIS and I just downloaded the QGIS software only a couple of hours ago.

1
  • A "Shapefile" is actually three (or more) files - normally something.shp, something.dbf and something.shx. You need at least those for QGIS to work properly. Sounds like maybe you didn't extract everything from a zip file. The .dbf in particular is a database file that contains the attributes, the .shp only contains the geometry...
    – Spacedman
    Commented Jan 23, 2017 at 12:59

2 Answers 2

4

You will have to tell QGIS how to label the features. The layer attribute table (do a right-click in the layer list, select attribute table) will show the attributes for the features. If you have a "name" attribute or such, you'll need to use the "label" tab of the layer properties (double-click a layer name in the layer list, or right-click and choose properties at the bottom; the label tab is the third from the top).

See http://docs.qgis.org/2.0/ca/docs/training_manual/vector_classification/label_tool.html for a documentation, but it may be outdated somewhat - still, the main concepts will still apply, although maybe the dialogues are different.

1
  • Yes, yes... I needed to make use of the label tool and that link was very helpful, the tutorial is not outdated at all. Very helpful, thank you. Commented Jan 23, 2017 at 15:42
4

A shapefile is not a single file as commented by Spacedman. You require at least three files i.e.,

.dbf which contains the geometry attributes
.shp which carries the geometry and
.shx the index file.

These files are generally accompanied by a .prj file which carries the projection details.

You can load the vector layer in QGIS and check it's attributes by right-clicking on the layer name in layer panel. If the attributes are present, you can display any one label on canvas by checking display label and selecting the attribute column to show in properties->label option in right-click on layer.

You can also load a .csv file as delimited text layer and choose the coordinates columns or WKT column to load in the canvas.

If the attributes/coordinates are not there and as specified by you the zip file also contained a .csv file which lacks the coordinates. In this situation you can go for table joins options by selecting the No geometry (attribute only table) option while loading the delimited text layer. After loading this .csv it will not show any geometry in the canvas. Now you need to go to the layer properties and select the join operation by linking the shapefile and this .csv file through a common column (similar to primary-foreign key relation).

A detailed description is given at qgistutorials

1
  • 1
    I used the label tool, I've been able to label my features and I didn't even have much use for the .csv file after all. Thank you. Commented Jan 23, 2017 at 15:40

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.