[R-sig-Geo] generate & plot elevation contour lines

karl.sommer at dpi.vic.gov.au karl.sommer at dpi.vic.gov.au
Fri Jun 30 01:19:52 CEST 2006


|---------+---------------------------->
|         |           e.pebesma at geo.uu.|
|         |           nl               |
|         |                            |
|         |           29/06/2006 17:28 |
|         |                            |
|---------+---------------------------->
  >------------------------------------------------------------------------------------------------------------------------------|
  |                                                                                                                              |
  |       To:       karl.sommer at dpi.vic.gov.au                                                                                   |
  |       cc:       r-sig-geo at stat.math.ethz.ch                                                                                  |
  |       Subject:  Re: [R-sig-Geo]  generate & plot elevation contour lines                                                     |
  >------------------------------------------------------------------------------------------------------------------------------|











contourLines is base graphics in R, so it needs arguments the
same way contour and image (in base) need them; read their
help pages, and it is especially important that you get x, y and
z right for the contourlines to have the right topology. But hey,
I believe I wrote a function as.image.SpatialGridDataFrame
in sp which does this for you.

Try:

contourLines(as.image(as(topo.idw, "SpatialGridDataFrame")))
--
Edzer

Eventually I had success with the following construct.

CL <- contourLines2SLDF(contourLines(as.image.SpatialGridDataFrame
      (as(topo.idw["var1.pred"],"SpatialGridDataFrame"))))
I then passed CL using sp.layout and it worked

The next challenge is how to pass the corresponding labels ?

Thanks

Karl




More information about the R-sig-Geo mailing list