[R-sig-Geo] displayDataset command

Tomislav Hengl hengl at science.uva.nl
Tue May 20 16:48:06 CEST 2008

If it is of any help, you might want to take a look at this guide:

"Creating Maps for Publication using R Graphics"

The second example demonstrates how to visualize a remote sensing band using grey levels and then
overlay various vector layers.

Tom Hengl

-----Original Message-----
From: r-sig-geo-bounces at stat.math.ethz.ch [mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of
Roger Bivand
Sent: dinsdag 20 mei 2008 16:38
To: Monica Pisica
Cc: r-sig-geo at stat.math.ethz.ch
Subject: Re: [R-sig-Geo] displayDataset command

On Tue, 20 May 2008, Monica Pisica wrote:

> Hi,
> I am trying to display a geotiff using displayDataset command from rgdal 
> ..... which i can do pretty successfully but i cannot display axes for 
> my map .... i tried to use axes = TRUE and i got the error that axes is 
> matched by multiple arguments and if i try to set xaxs and yaxs as equal 
> to "i" or "r" they are simply ignored .....
> Suppose my geotiff is named d1 ...
> x <- GDAL.open(d1)
> displayDataset(x, zlim = c(-2, 5.7), col = rainbow(20), xaxs = "r", yaxs 
> = "r")
> And i get a nice image display but no axes what so ever ;-)

If you look in the code, you'll see that axes are set to FALSE internally, 
and the drawing units are manipulated, so the graphics display does not 
know where they should go or which units they should be in. Since you can 
use output.dim= in readGDAL too, I'd go with

image(readGDAL(d1), col=grey.colors(20), axes=TRUE)

adding arguments to readGDAL() to decimate the image if there are many 
pixels. You don't get the color palette, though, but it could be retrieved 
if need be.


> I will really appreciate any help you can provide,
> Thanks,
> Monica
> _________________________________________________________________
> E-mail for the greater good. Join the i’m Initiative from Microsoft.
> ood
> 	[[alternative HTML version deleted]]

Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, 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

More information about the R-sig-Geo mailing list