[R-sig-Geo] A new ASTER Global DEM data set

Pierre Roudier pierre.roudier at gmail.com
Mon Nov 23 23:33:19 CET 2009


Sorry for my previous HTML-formatted message, here it is again:

Another package I find useful for shaded views of spatial data is the rgl
package.

It is most useful because of its ability to zoom and turn the map
interactively.

>From surface3d() help page :

data(volcano)
z <- 2 * volcano
x <- 10 * (1:nrow(z))
y <- 10 * (1:ncol(z))
zlim <- range(y)
zlen <- zlim[2] - zlim[1] + 1
colorlut <- terrain.colors(zlen)
col <- colorlut[ z-zlim[1]+1 ]
library(rgl)
open3d()
surface3d(x, y, z, color=col, back="lines")

Pierre



2009/11/24 Pierre Roudier <pierre.roudier at gmail.com>:
> Another package I find useful for shaded views of spatial data is the rgl
> package.
>
> It is most useful because of its ability to zoom and turn the map
> interactively.
>
> From surface3d() help page :
>
> data(volcano)
> z <- 2 * volcano
> x <- 10 * (1:nrow(z))
> y <- 10 * (1:ncol(z))
> zlim <- range(y)
> zlen <- zlim[2] - zlim[1] + 1
> colorlut <- terrain.colors(zlen)
> col <- colorlut[ z-zlim[1]+1 ]
> library(rgl)
> open3d()
> surface3d(x, y, z, color=col, back="lines")
>
> Pierre
>
> 2009/11/24 Karl Ove Hufthammer <karl at huftis.org>
>>
>> On Mon, 23 Nov 2009 14:16:35 +0100 Paul Hiemstra <p.hiemstra at geo.uu.nl>
>> wrote:
>> > > The maps with shading look quite nice. Is there an R package/function
>> > > which can create similar images?
>> > >
>> > A good place to look for these kinds of graphs and how to make them is
>> > the R graph gallery [1]. Check out this one for example [2].
>>
>> Excellent idea. I have of course used 'persp' many times, but had
>> forgotten about its 'shade' option. With it, I can create very good-
>> looking (and useful!) 3D maps. I use it on a bathymetry (ocean depths)
>> dataset, and using this shading and 3D visualisation gives a whole new
>> perspective (sorry).
>>
>> One alternative that I discovered is the hillshading feature of the free
>> GIS software SAGA. It's even available in R using the 'RSAGA' package.
>> See "http://sourceforge.net/apps/trac/saga-gis/wiki/Climbing%20Mount%
>> 20St.%20Helens" for a nice example of its output. (I didn't manage to
>> get it to automatically use 'natural' colours for ocean and
>> land/terrain, though.)
>>
>> --
>> Karl Ove Hufthammer
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
>



More information about the R-sig-Geo mailing list