[R-sig-Geo] plotting holes of esri shape files

sluedtke sluedtke at gfz-potsdam.de
Thu Sep 20 10:32:58 CEST 2012


Dear friends, 


am trying to overlay a polygon data set as a SpatialPolygonDateFrame to
an existing plot. The data set has a hole in the middle, and I do not
want to have any filling in there. If a check the shape in a GIS,
everything looks fine, but using the following commands to do the plot,
the hole is filled. 

That is the code I am using, the data is attached. Thanks in advance!

Stefan



################################################################################################

library(sp)
library(rgdal)
library(raster)
library(latticeExtra)


###############################################################################################
#read the DEM from the ASCII format

dem_ascii=raster(readGDAL("./zerafshan_mod_dem.asc"))


###############################################################################################
# read additional data for printing
mask=readOGR("./", "mask_zerafshan")

###############################################################################################

#plot this stuff
plot_dem=spplot(dem_ascii, col.regions=terrain.colors(400),
colorkey=list(width=1, space="right"))+
layer(sp.polygons(mask,fill="lightgray"))

print(plot_dem) 
################################################################################################



mask_zerafshan.dbf (110 bytes) <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/0/mask_zerafshan.dbf>
mask_zerafshan.prj (143 bytes) <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/1/mask_zerafshan.prj>
mask_zerafshan.shp (173K) <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/2/mask_zerafshan.shp>
mask_zerafshan.shx (150 bytes) <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/3/mask_zerafshan.shx>
zerafshan_mod_dem.asc (1M) <http://r-sig-geo.2731867.n2.nabble.com/attachment/7580992/4/zerafshan_mod_dem.asc>




--
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/plotting-holes-of-esri-shape-files-tp7580992.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list