An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20100622/5dfd0394/attachment.pl>
Plot (image( )) Real RGB Colors of an Imported GeoTIFF (readGDAL( ))
4 messages · Rodrigo Aluizio, Robert J. Hijmans, Edzer Pebesma
Rodrigo, you can try plotRGB in raster. Robert
On Tue, Jun 22, 2010 at 6:57 AM, Rodrigo Aluizio <r.aluizio at gmail.com> wrote:
Hi List members.
I?m actually able to import a Georeferenced image (.tiff) using readGDAL
{rgdal} and plot it using image {Graphics}.
But the colors options available in the image function (topo.colors,
heat.colors, terrain.colors, etc) aren?t able to adequately reproduce the
original image. The tiff file represent land and ocean, so I need brow and
green tones to land and blue tones to ocean. I was able to create the blue
tones with colorRampPalette () but these blue tones are also applied to the
land.
Once imported the object containing the raster georeferenced file brings
three data columns with bands (RGB maybe) values of each cell (I guess).
Isn?t there a way to reproduce the real colors using these columns
information or any other way to do so?
Thank you on advance for the patience and help.
Below, some useful information on the object:
BC<-readGDAL('C:/Users/Rodrigo/Documents/Shapefiles/Campos/BaciaCampos-GE-SA
D69-LongLat.tiff')
C:/Users/Rodrigo/Documents/Shapefiles/Campos/BaciaCampos-GE-SAD69-LongLat.ti
ff has GDAL driver GTiff
and has 3350 rows and 3015 columns
summary(BC)
Object of class SpatialGridDataFrame Coordinates: ? ? ? ?min ? ? ? max x -42.15808 -39.58503 y -23.74079 -21.08709 Is projected: FALSE proj4string : [+proj=longlat +ellps=aust_SA +no_defs] Number of points: 2 Grid attributes: ?cellcentre.offset ? ? cellsize cells.dim x ? ? ? ? -42.15765 0.0008534147 ? ? ?3015 y ? ? ? ? -23.74040 0.0007921499 ? ? ?3350 Data attributes: ? ? band1 ? ? ? ? ? ?band2 ? ? ? ? ? ?band3 ?Min. ? : ?0.00 ? Min. ? : ?0.00 ? Min. ? : ?0.0 ?1st Qu.: 48.00 ? 1st Qu.: 67.00 ? 1st Qu.: 95.0 ?Median : 70.00 ? Median : 89.00 ? Median :117.0 ?Mean ? : 65.17 ? Mean ? : 83.37 ? Mean ? :117.7 ?3rd Qu.: 76.00 ? 3rd Qu.: 97.00 ? 3rd Qu.:150.0 ?Max. ? :255.00 ? Max. ? :255.00 ? Max. ? :255.0 Regards ------------------------------------------------------------- MSc. ?<mailto:r.aluizio at gmail.com> Rodrigo Aluizio Centro de Estudos do Mar/UFPR Laborat?rio de Micropaleontologia Avenida Beira Mar s/n - CEP 83255-000 Pontal do Paran? - PR - Brasil ? ? ? ?[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Asssuming r g and b are on a 0 - 255 scale and form the first, second
and third band in obj, which was read through readGDAL, you could use
image(obj, red = 1, green = 2, blue = 3)
which is image { sp } and not image { graphics }. See also
library(sp)
?image.SpatialGridDataFrame
On 06/22/2010 03:57 PM, Rodrigo Aluizio wrote:
Hi List members.
I?m actually able to import a Georeferenced image (.tiff) using readGDAL
{rgdal} and plot it using image {Graphics}.
But the colors options available in the image function (topo.colors,
heat.colors, terrain.colors, etc) aren?t able to adequately reproduce the
original image. The tiff file represent land and ocean, so I need brow and
green tones to land and blue tones to ocean. I was able to create the blue
tones with colorRampPalette () but these blue tones are also applied to the
land.
Once imported the object containing the raster georeferenced file brings
three data columns with bands (RGB maybe) values of each cell (I guess).
Isn?t there a way to reproduce the real colors using these columns
information or any other way to do so?
Thank you on advance for the patience and help.
Below, some useful information on the object:
BC<-readGDAL('C:/Users/Rodrigo/Documents/Shapefiles/Campos/BaciaCampos-GE-SA
D69-LongLat.tiff')
C:/Users/Rodrigo/Documents/Shapefiles/Campos/BaciaCampos-GE-SAD69-LongLat.ti
ff has GDAL driver GTiff
and has 3350 rows and 3015 columns
summary(BC)
Object of class SpatialGridDataFrame
Coordinates:
min max
x -42.15808 -39.58503
y -23.74079 -21.08709
Is projected: FALSE
proj4string : [+proj=longlat +ellps=aust_SA +no_defs]
Number of points: 2
Grid attributes:
cellcentre.offset cellsize cells.dim
x -42.15765 0.0008534147 3015
y -23.74040 0.0007921499 3350
Data attributes:
band1 band2 band3
Min. : 0.00 Min. : 0.00 Min. : 0.0
1st Qu.: 48.00 1st Qu.: 67.00 1st Qu.: 95.0
Median : 70.00 Median : 89.00 Median :117.0
Mean : 65.17 Mean : 83.37 Mean :117.7
3rd Qu.: 76.00 3rd Qu.: 97.00 3rd Qu.:150.0
Max. :255.00 Max. :255.00 Max. :255.0
Regards
-------------------------------------------------------------
MSc. <mailto:r.aluizio at gmail.com> Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laborat?rio de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paran? - PR - Brasil
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Edzer Pebesma Institute for Geoinformatics (ifgi), University of M?nster Weseler Stra?e 253, 48151 M?nster, Germany. Phone: +49 251 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de http://www.52north.org/geostatistics e.pebesma at wwu.de
Excelent!
Sorry for asking such a simple question. But, I was blind for such obvious
thing.
Rodrigo.
-----Mensagem original-----
De: r-sig-geo-bounces at stat.math.ethz.ch
[mailto:r-sig-geo-bounces at stat.math.ethz.ch] Em nome de Edzer Pebesma
Enviada em: ter?a-feira, 22 de junho de 2010 13:28
Para: r-sig-geo at stat.math.ethz.ch
Assunto: Re: [R-sig-Geo] Plot (image( )) Real RGB Colors of an Imported
GeoTIFF (readGDAL( ))
Asssuming r g and b are on a 0 - 255 scale and form the first, second
and third band in obj, which was read through readGDAL, you could use
image(obj, red = 1, green = 2, blue = 3)
which is image { sp } and not image { graphics }. See also
library(sp)
?image.SpatialGridDataFrame
On 06/22/2010 03:57 PM, Rodrigo Aluizio wrote:
Hi List members.
I?m actually able to import a Georeferenced image (.tiff) using readGDAL
{rgdal} and plot it using image {Graphics}.
But the colors options available in the image function (topo.colors,
heat.colors, terrain.colors, etc) aren?t able to adequately reproduce the
original image. The tiff file represent land and ocean, so I need brow and
green tones to land and blue tones to ocean. I was able to create the blue
tones with colorRampPalette () but these blue tones are also applied to
the
land. Once imported the object containing the raster georeferenced file brings three data columns with bands (RGB maybe) values of each cell (I guess). Isn?t there a way to reproduce the real colors using these columns information or any other way to do so? Thank you on advance for the patience and help. Below, some useful information on the object:
BC<-readGDAL('C:/Users/Rodrigo/Documents/Shapefiles/Campos/BaciaCampos-GE-SA
D69-LongLat.tiff')
C:/Users/Rodrigo/Documents/Shapefiles/Campos/BaciaCampos-GE-SAD69-LongLat.ti
ff has GDAL driver GTiff and has 3350 rows and 3015 columns
summary(BC)
Object of class SpatialGridDataFrame
Coordinates:
min max
x -42.15808 -39.58503
y -23.74079 -21.08709
Is projected: FALSE
proj4string : [+proj=longlat +ellps=aust_SA +no_defs]
Number of points: 2
Grid attributes:
cellcentre.offset cellsize cells.dim
x -42.15765 0.0008534147 3015
y -23.74040 0.0007921499 3350
Data attributes:
band1 band2 band3
Min. : 0.00 Min. : 0.00 Min. : 0.0
1st Qu.: 48.00 1st Qu.: 67.00 1st Qu.: 95.0
Median : 70.00 Median : 89.00 Median :117.0
Mean : 65.17 Mean : 83.37 Mean :117.7
3rd Qu.: 76.00 3rd Qu.: 97.00 3rd Qu.:150.0
Max. :255.00 Max. :255.00 Max. :255.0
Regards
-------------------------------------------------------------
MSc. <mailto:r.aluizio at gmail.com> Rodrigo Aluizio
Centro de Estudos do Mar/UFPR
Laborat?rio de Micropaleontologia
Avenida Beira Mar s/n - CEP 83255-000
Pontal do Paran? - PR - Brasil
[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo
Edzer Pebesma Institute for Geoinformatics (ifgi), University of M?nster Weseler Stra?e 253, 48151 M?nster, Germany. Phone: +49 251 8333081, Fax: +49 251 8339763 http://ifgi.uni-muenster.de http://www.52north.org/geostatistics e.pebesma at wwu.de _______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo