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 raster image (GeoTIFF) with integer values. I know how to visualise raster values in QGIS using colormaps or similar, but I would like to assign symbols to each colour value instead - just like a colormap, but with symbols.

Example: enter image description here

Question:
Is this possible and in that case how?

share|improve this question
    
well, you can use SVG symbols in colormaps, which will give some nice looking maps –  Curlew Jan 3 '13 at 13:07
    
Can you give me a hint to where I can learn about this? –  Chau Jan 3 '13 at 13:34
    
Using Curfew's answer I think I would work on getting each cell converted to a point (much like asc grid) to control the 1 symbol per value. But I don't see how you can get around converting to vector. –  Brad Nesom Jan 3 '13 at 15:21
    
It might be possible, but I think we need to know more about your raster. Is it really an image, how many bands does it have and how many "colors" does it have? N. –  nhopton Jan 3 '13 at 20:40
    
In this case my raster is a one band image with 10 different integer values - a simple case. But it could be neat to be able to style raster images on the fly in general. –  Chau Jan 4 '13 at 7:12
add comment

3 Answers

up vote 10 down vote accepted
  1. Polygonize your raster shape via the Raster-to-polygon tool in the raster menu. Use your field value as category
  2. Click on categorized styling, classify and double click on the symbol. Then select "SVG-FILL" and the following dialog should appear with some basic SVG icons coming with QGIS. enter image description here

  3. Choose an icon and remember to set the border line ("simple line") to no-pen. Otherwise the fields will be bordered with a small line. Your question displays such border line, so maybe you want to keep them.

  4. Apply and gaze upon your new styling. You could ease up the styling a lot, if you use rules and categories. Here a quick example of a forest with surrounding plains. The polygon was generated from a forest cover raster layer. enter image description here

This was done using the QGIS 1.9 Development Version, but is assume it should be possible in 1.8 as well. You can style your own SVG-Symbols using for instance the excellent Inkscape suite

share|improve this answer
1  
I fine solution. But I really prefer one where I don't have to alter my raster, in your example, to polygonise it. –  Chau Jan 4 '13 at 7:14
    
this could be very hard to realize, because as far as i know raster cells can only be displayed with RGB-colors. Something as complex as symbols clearly belong to the world of vector layers –  Curlew Jan 4 '13 at 10:19
1  
A raster is just a grid, so converting to points rather than polygonizing it might be closer to Chau's requirements. Then just symbolize the points accordingly and, if needed, lay a simple grid over the top at the same resolution as the raster to make it look exactly like Chau's example picture. –  MappaGnosis Jan 4 '13 at 11:16
add comment

Suggesting your raster is of pretty large scale (landuseage, weather,...), why don't you simply convert them to vector format ?

share|improve this answer
    
Because its a visualisation just like colormaps. –  Chau Jan 3 '13 at 12:59
3  
well, you can use SVG symbols in colormaps, which will give some nice looking maps –  Curlew Jan 3 '13 at 13:07
    
Can you give me a hint to where I can learn about this? –  Chau Jan 3 '13 at 13:34
add comment

I believe that QGIS still comes with gdal2xyz.py and using this you can convert your raster to a text file.

Open a terminal in the directory containing the raster and run:

gdal2xyz.py filename.tif filename.txt

The text file will contain space-delimited xyz triplets comprising an x ordinate, a y ordinate and a z value (from the raster).

You will need to add a new first line to the file, something like "x y z" (without the quotation marks). Having done this you will be able to load the file into QGIS using the "add delimited text" tool, selecting "space" as a delimiter.

In QGIS you can then style the points: Properties -> Style Tab -> Categorized and then use font symbols to style the points.

enter image description here

share|improve this answer
    
interesting example (+1). Is a XYZ-Layer a vector layer and how is this different from polygonizing the raster ? –  Curlew Jan 5 '13 at 11:18
1  
Well, if you polygonize a raster what you are doing is making polygons that enclose groups of pixels having the same value. But in this case what was required was to explode the raster to vector points, each point having an attribute-value taken from the raster. –  nhopton Jan 5 '13 at 11:36
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.