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

Robert J. Hijmans r.hijmans at gmail.com
Tue Jul 20 18:34:01 CEST 2010


Thanks Agus, I fixed this in raster version 1.3-0. Robert

On Mon, Jul 19, 2010 at 11:46 PM, Agustin Lobo <alobolistas at gmail.com> wrote:
>
> 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.
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list