[R-sig-Geo] superimpose polygons on a grid

Paul Hiemstra p.hiemstra at geo.uu.nl
Thu Sep 4 13:01:44 CEST 2008


Hi,

There are two ways to do this, one is to use the "first = FALSE" argument
in the call to sp.layout. Like:

spplot(myspgrid, sp.layout(list("sp.polygon",mysppolygon, first = FALSE)))

A more complex way, but more flexible, is to use a custom panel function
like on the R wiki tips:

http://wiki.r-project.org/rwiki/doku.php?id=tips:spatial-data:spatial_data_visualization

Read the paragraph on "Adding GIS data as layout".

cheers,
Paul

ps The first e-mail with the error was caused by me

>
> Hi all,
>
> is there a way to plot polygons over a grid? It seems that:
>
>> spplot(myspgrid, sp.layout(list("sp.polygon",mysppolygon)))
>
> always plots the grid on top of the polygon (as in
> <http://r-spatial.sourceforge.net/gallery/#fig07.R> and contrary to
> lines and points).
>
> Is there any way to change this (for instance to plot a lake area on top
> of a raster DEM)?
>
> cheers
> Wouter
>
> _______________________________________________
> 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