[R-sig-Geo] Extracting one cell only with raster's rasterToPoints()

2014-09-05 Thread Daniel Rodolphe Schlaepfer
Hello all, I converted a large set of rasters to spatial points. One of the rasters had only one cell that was to be converted; the raster package function rasterToPoints() failed, but the function would work for spatial=FALSE and of course also if there is more than one cell to convert. Examp

Re: [R-sig-Geo] maptools/SpatialPolygons2PolySet produces ascending instead of descending POS numbers for polygons with holes

2014-08-07 Thread Daniel Rodolphe Schlaepfer
ols revision 283. My question is solved. Best -Daniel On Aug 6, 2014, at 8:54 PM, Roger Bivand wrote: > On Wed, 6 Aug 2014, Daniel Rodolphe Schlaepfer wrote: > >> Unfortunately, your suggestion to consider plotting order doesn’t work in >> general and not in my case; for in

Re: [R-sig-Geo] maptools/SpatialPolygons2PolySet produces ascending instead of descending POS numbers for polygons with holes

2014-08-06 Thread Daniel Rodolphe Schlaepfer
zn <- NULL if (pj == "UTM") { zn <- attr(pj, "zone") attr(pj, "zone") <- NULL } res <- as.PolySet(data.frame(PID = PID, SID = SID, POS = POS, X = X, Y = Y), projection = pj, zone = zn) res } Thanks, Daniel On A

Re: [R-sig-Geo] maptools/SpatialPolygons2PolySet produces ascending instead of descending POS numbers for polygons with holes

2014-08-06 Thread Daniel Rodolphe Schlaepfer
12:52 PM, Roger Bivand wrote: > On Wed, 6 Aug 2014, Daniel Rodolphe Schlaepfer wrote: > >> Hello all, >> >> I try to convert a sp SpatialPolygons object with a hole to a PBS PolySet >> object - my ultimate goal is to plot the polygon with hatching considering &

[R-sig-Geo] maptools/SpatialPolygons2PolySet produces ascending instead of descending POS numbers for polygons with holes

2014-08-06 Thread Daniel Rodolphe Schlaepfer
Hello all, I try to convert a sp SpatialPolygons object with a hole to a PBS PolySet object - my ultimate goal is to plot the polygon with hatching considering the hole. My problem is that maptools/SpatialPolygons2PolySet only produces PolySet objects with increasing POS even for polygons with