Werner Wernersen
2008-Oct-10 09:57 UTC
[R] map + some arbitrary locations' heights: some kind of perspective or contour plot possible?
Hi, I thought about this but programming it seems rather difficult so I was wondering if a function exists for this in R (as most of the times it turns out that it does): I have a map (shapefile) and for about 50 points on that map (GPS locations) I have heights. Is there a function which can make a perspective plot or contour plot or the like from this little data? Or maybe some function I can abuse? Thanks for any suggestions, Werner
Roger Bivand
2008-Oct-10 18:00 UTC
[R] map + some arbitrary locations' heights: some kind of perspective or contour plot possible?
Werner Wernersen <pensterfuzzer <at> yahoo.de> writes:> > Hi, > > I thought about this but programming it seems rather difficult so I was > wondering if a function exists for > this in R (as most of the times it turns out that it does): > I have a map (shapefile) and for about 50 points on that map (GPS locations) > I have heights. Is there a > function which can make a perspective plot or contour plot or the like from > this little data? Or maybe some > function I can abuse? >The perspective, image, and contour plots all expect you to have interpolated to a regular grid first. It is perhaps easiest to use interp() in the akima package for this, although there are lots of alternatives. There has just been a thread on this on R-sig-geo, subject: "interp.old and write.ascii.grid", showing how also to export the interpolated values to a grid file. Roger Bivand> Thanks for any suggestions, > Werner >