[R-sig-Geo] How to clip a map using shapefiles?

Thiago Veloso thi_veloso at yahoo.com.br
Wed Jun 23 15:29:43 CEST 2010


  Dear r-siggers,
  Does anybody know how to clip, or cut a map using a previous loaded shapefile? To produce the attached map, I'm using the following code: image(lon,lat,testedec1[111:133,15:43],col=rainbow(10))par(new=T)plot(brazil)
  Where "brazil" is a shapefile loaded with maptools library. Is it possible to use this shape as a mask to filter the map values? The result would be only the values which are inside the contour...
  Thanks in advance,
  Thiago Veloso.


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20100623/d0ed8104/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sample_map.png
Type: image/png
Size: 42592 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20100623/d0ed8104/attachment.png>


More information about the R-sig-Geo mailing list