[R-sig-Geo] Bug in rasterToPoints() ?

Agustin Lobo alobolistas at gmail.com
Tue Jul 20 08:46:16 CEST 2010


While 
test <-rasterToPoints(Br025,fun=function(x){x>0},asSpatialPoints=T)
does not work, the following works:
> test <-rasterToPoints(Br025,fun=function(x){x>0},asSpatialPoints=F)
> test <- as.data.frame(test)
> coordinates(test) <- c("x","y")
> class(test)
[1] "SpatialPointsDataFrame"
attr(,"package")
[1] "sp"
> test at proj4string <- CRS(projection(Br025))
> projection(test)
[1] "+proj=longlat +ellps=WGS84"

> summary(test)
Object of class SpatialPointsDataFrame
Coordinates:
    min   max
x -8.75 28.00
y 41.50 59.75
Is projected: FALSE 
proj4string : [+proj=longlat +ellps=WGS84]
Number of points: 2576
Data attributes:
   Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   0.50    7.00   33.75  178.00  152.10 3638.00 

although the value of slot "Is projected:" indicates some problem.

Agus
-- 
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Bug-in-rasterToPoints-tp5294219p5315475.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list