[GRASS-user] Exporting labels of a raster

Moritz Lennert mlennert at club.worldonline.be
Tue Jul 5 04:12:22 EDT 2011


[Please keep the discussion on the list]

On 04/07/11 23:32, Luisa Peña wrote:
> Thanks Moritz
> as soon as I arrive to my office I will give a try. But, for instance,
> how can I associate those files? I mean, I export myu geotiff as A.tif
> and my csv as B.csv. How can a GIS software recongize that they are
> associated with each other?

You would have to find a raster file format which supports this. I don't 
think geotiff allows you to store the labels, although maybe it is 
possible within the metadata, but then I'm not sure many programs would 
recognize this information (e.g. see metadata on colors which GRASS puts 
into a geotiff but which QGIS does not seem to recognize). Some of the 
raster formats with header files might allow this, but I don't know.

And as each program handles the information differently, it is often 
easier to provide the info as separate text files and have the user then 
import them into their program according to its mode of operation.


Moritz

> Thanks
>
> 2011/7/1 Moritz Lennert <mlennert at club.worldonline.be
> <mailto:mlennert at club.worldonline.be>>
>
>     On 01/07/11 15:18, Luisa Peña wrote:
>
>         Uhm. If this is not possible, how can I export a raster map with
>         labels
>         in a legend?
>
>
>     In my experience, the classical way would be to export your raster
>     map into the desired format and then export the labels as a separate
>     legend (text) file with r.category. E.g.:
>
>     r.out.gdal landclass96 at PERMANENT type=Int32 out=myraster.tif
>     r.category landclass96 at PERMANENT fs=";" > myrasterlegend.csv
>
>     and possibly:
>
>     r.colors.out landclass96 at PERMANENT rules=myrastercolors.txt
>
>     Moritz
>
>




More information about the grass-user mailing list