Reading 8-bit palette from tif

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Reading 8-bit palette from tif

manuel.schneider
Dear list

our mobile GPS performs very well with paletted tif. I have therefore cropped
large ortophotos to the local area of investigation and save them as tifs with
8-bit color palette from ArcGIS. The files are also attractive to be accessed
from R to be used as background in the display of results.
I can read the files easily using readGDAL. However, to display with image I
need the color table. I suceeded doing this using displayDataset from rgdal.
This looks like
im <-readGDAL(file)
cl <- displayDataset(GDAL.open(file))$col
image(im,col=cl)

My questions are:
- Is there is another, more direct way to the color palette infomation? I have
tried getColorTable() but this is giving something else.
- How can the automatic production of a plot by displayDataset be suppressed?
- How/if the 8-bit colorpalette in ArcGIS translates to any of GDALs tif options?

Any hints appreciated
Manuel

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Reply | Threaded
Open this post in threaded view
|

Re: Reading 8-bit palette from tif

Michael Sumner-2
The raster package can do this, raster(file) may give a directly plottable
object with everything done right.

It's worth a try then dig deeper if needed.

Best, Mike

On Friday, October 28, 2011, Manuel Schneider <[hidden email]>
wrote:
> Dear list
>
> our mobile GPS performs very well with paletted tif. I have therefore
cropped
> large ortophotos to the local area of investigation and save them as tifs
with
> 8-bit color palette from ArcGIS. The files are also attractive to be
accessed
> from R to be used as background in the display of results.
> I can read the files easily using readGDAL. However, to display with image
I
> need the color table. I suceeded doing this using displayDataset from
rgdal.
> This looks like
> im <-readGDAL(file)
> cl <- displayDataset(GDAL.open(file))$col
> image(im,col=cl)
>
> My questions are:
> - Is there is another, more direct way to the color palette infomation? I
have
> tried getColorTable() but this is giving something else.
> - How can the automatic production of a plot by displayDataset be
suppressed?
> - How/if the 8-bit colorpalette in ArcGIS translates to any of GDALs tif
options?
>
> Any hints appreciated
> Manuel
>
> _______________________________________________
> R-sig-Geo mailing list
> [hidden email]
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

--
Michael Sumner
Institute for Marine and Antarctic Studies, University of Tasmania
Hobart, Australia
e-mail: [hidden email]

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
[hidden email]
https://stat.ethz.ch/mailman/listinfo/r-sig-geo