Dear list,

my problem concerns the library splancs and the use of a shapefile with a hole. I found a part of code in another thread (http://finzi.psych.upenn.edu/R/Rhelp02a/archive/61525.html) saying that if I've "more than one shape, and/or more than one ring in that shape, adjust the [[Shape]])[[ring]]" in the "getPolygonCoordsSlot(getPolygonsPolygonsSlot(getSpPpolygonsSlot(pol)[[2]])[[1]])". My problem is that I can choose with the two parameters between the hole studyarea (inkluding the hole) or the hole itself but not among the studyarea excluding the hole. Below you can find the code.

I appreciate every hint! Thanks

Marco


> library(splancs)
> library(maptools)
> setwd("c:/test")
> getwd()
[1] "c:/test"
> 
> pol <- readShapePoly("stadtreg_owin.shp", verbose=T)
Shapefile type: Polygon, (5), # of Shapes: 1
> edv <- read.table("C:/test/edv.txt", header=T,
+   sep=";", na.strings="NA", dec=",", strip.white=T)
> poi <- as.points(edv[,-c(1:25)])
> ls()
[1] "edv"          "poi"          "pol"          "splancs_poly"
> 
> poi <- coordinates(poi)
> splancs_poly <- getPolygonCoordsSlot(getPolygonsPolygonsSlot(
+   getSpPpolygonsSlot(pol)[[1]])[[2]])
> polymap(splancs_poly)

__________________________
Marco Helbich
ISR
A-1010 Vienna, Postgasse 7/4/2



	[[alternative HTML version deleted]]


