[R-sig-Geo] writeGDAL: pseudocolor image?

Vikram Ranga babuawara at gmail.com
Mon Feb 27 11:56:55 CET 2012


Hello Agus,
Have you tried writeRaster() command from raster package?
I have tried it and it works wonderfully. I have tried it like this
octstack<-stack(croctb1,croctb2,croctb3,croctb4,croctb5,croctb7)
writeRaster(octstack,"H:/....../map_oct.tif", overwrite=T)
you can also write *.img and a number of other formats, check out raster 
package.

I hope it would help.
Good luck.
Vikram.

On 2/26/2012 11:10 PM, Agustin Lobo wrote:
> Hi!
> Is it possible to write a pseudocolor image as a  geotif with embedded
> color table using
> writeGDAL() or any other R command?
> I mean an image such as:
>
> $ gdalinfo pseudocolorv2.tif
> Driver: GTiff/GeoTIFF
> Files: pseudocolorv2.tif
>         pseudocolorv2.tif.aux.xml
> Size is 217, 232
> Coordinate System is `'
> Metadata:
>    TIFFTAG_IMAGEDESCRIPTION=ImageJ=1.43l
>
> Image Structure Metadata:
>    INTERLEAVE=BAND
> Corner Coordinates:
> Upper Left  (    0.0,    0.0)
> Lower Left  (    0.0,  232.0)
> Upper Right (  217.0,    0.0)
> Lower Right (  217.0,  232.0)
> Center      (  108.5,  116.0)
> Band 1 Block=217x37 Type=Byte, ColorInterp=Palette
>    Min=0.000 Max=255.000
>    Minimum=0.000, Maximum=255.000, Mean=116.873, StdDev=70.651
>    Metadata:
>      STATISTICS_MAXIMUM=255
>      STATISTICS_MEAN=116.87251708247
>      STATISTICS_MINIMUM=0
>      STATISTICS_STDDEV=70.651436875893
>    Color Table (RGB with 256 entries)
>      0: 0,6,21,255
>      1: 0,13,98,255
> ...
> 255: 67,142,93,255
>
> Thanks,
>
> Agus
>
> _______________________________________________
> 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