2

QGIS 2.8.9

I have been working with this shapefile and have already successfully coloured it using a graduated style from my column 'TIV' - however recently when I want to change the attribute the shapefile is coloured by, only latitude and longitude are displayed as options when there are multiple columns in the attribute table, as shown in the images below.

I have tried reimporting the shapefile and still encounter the same problem.

enter image description here

enter image description here

5

It's because your lat long columns are the only ones with a numerical data type. A nice little clue to this is in you table screenshot. Notice how your first 2 columns are right aligned, and all the rest are left aligned. It shows that all the others are strings. Using categorized styling would give you the other columns as options.

You'll have to create new columns of the correct type and copy that the old data into the new columns.

Check the documentation for a better explanation

| improve this answer | |
  • Interesting... because the classes already shown in the screenshot are already classified by TIV and when I selected TIV before I had a whole list of the columns appear. But it appears now it is only displaying whole number columns and, something has caused the TIV column to change to a string..? But thanks I will just manually change the column as you say and get back to you. – Jordan Jul 8 '16 at 10:45
  • 2
    You can also use an expression to convert the datatype when you classify. In that way, you don't have to manipulate your original data. In the Column field in the Style tab, just write toint("my_string_column_that_is_actually_numbers") or toreal("my_string_column_that_is_actually_numbers") for decimal numbers. – hexamon Jul 8 '16 at 11:22
  • 1
    All columns will appear if you are creating a "Categorised" symbology. Only numeric columns will appear if creating a "Graduated" symbology. You can still use the columns but you would have to cast them to numeric: gis.stackexchange.com/questions/34343/… – HeikkiVesanto Jul 8 '16 at 11:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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