[R-sig-Geo] gdal color tables

Agustin Lobo alobolistas at gmail.com
Sun Dec 23 21:00:35 CET 2012


Roger,

The problem is not getting a color table as colmat in your
example, but writing colmat in gdal format to create pseudocolor raster
files, best using either writeRaster() or writeGDAL() (a bit like you
would display a raster layer
in R using plot() and the col argument).
The way I was thinking on was writing
the greylevel raster with the current writeRaster() and then writing
an R function to create a
vrt file that, from one single layer, is essentially the color palette
in gdal format
(see http://trac.osgeo.org/gdal/wiki/FAQRaster#Howtocreateormodifyanimagecolortable).
Then the vrt file can be translated to any other format using gdal_translate.
But then I thought that a more direct function could already exist in
R, thus I asked.

The mention to rgb2pct.py was just to show the format of the palette.

On Sun, Dec 23, 2012 at 3:54 PM, Roger Bivand <Roger.Bivand at nhh.no> wrote:
> .../...
>
> Wrapping this in cat() and paste() to get the desired XML should not be
> hard.

...which definitely  means that the function does not exist. I'll try,
either as you say
or perhaps using R package xml. At least I'll write a function to make
QGIS color tables,
I think the format is the same as in gdal.

Agus


> Hope this clarifies,
>
> Roger
>
>
>>
>> An alternative could be using
>>
>> http://en.geopublishing.org/gdal%20colorpalette%20to%20symbology%20encoding
>>
>> but have not tried myself (yet).
>>
>> I understand, that, as far as you know, such a function does not exist.
>>
>> Agus
>>
>>> Barry
>>>
>>> _______________________________________________
>>> R-sig-Geo mailing list
>>> R-sig-Geo at r-project.org
>>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at r-project.org
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>
> --
> Roger Bivand
> Department of Economics, NHH Norwegian School of Economics,
> Helleveien 30, N-5045 Bergen, Norway.
> voice: +47 55 95 93 55; fax +47 55 95 95 43
> e-mail: Roger.Bivand at nhh.no
>
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo



More information about the R-sig-Geo mailing list