Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I have a a column of data that I'm trying to display in the Categorized Style but when QGIS orders the values it ranks them, for example, 57, 58, 59, 6, 60, 61, 62....

Is there a way to rank them in the correct order?

I'm using a Colour ramp and so the colour for number 6 is as dark as numbers 59 and 60, when it should be much lighter.

enter image description here

share|improve this question
add comment

2 Answers 2

In that case you should use a graduated renderer. It will sort the values correctly.

Categorized renderers are meant for nominal scales.

Graduated renderer will only work with numerical values. So if your column is text, you'll have to convert it to numeric format first. As Andre noted in his comment to another answer, this can be done in field calculator with toint(old_fieldname).

share|improve this answer
add comment

Another idea would be to change the column of data to numbers from text (in ArcGIS I add a 'field', remove the shapefile from my work, and then import the .dbf file into open office Calc and turn the text into numbers in the new column then reopen the shapefile with the new improved column of data). Your color ramp will be correct if the software recognizes the numbers (instead of text). Things that look like numbers to me but text to my computer annoy me every day.

share|improve this answer
2  
I think this is the solution. In QGIS, you can add another field in attribute table with field calculator and use toint("<old_fieldname>" ) function to populate the column. You can check if the field is text or number in the fields section of the layers properties. –  Andre Joost Jan 30 '13 at 20:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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