[R-sig-Geo] projection string when using asSGDF_GROD()

Paul Hiemstra p.hiemstra at geo.uu.nl
Mon Dec 8 22:26:24 CET 2008


Hi Harry,

Without the output of traceback() to show what exactly went wrong in 
what function it is hard to say what is wrong. A small piece of sample 
code reproducing the error would also make this diagnosis much easier.

good luck and cheers,
Paul

Harry Kim wrote:
> Dear r-sig-geoers,
>
>       I need some help reading in a raster data and at the same time
> project it so I can use the overlay() function. The data I am reading
> in is quite big, so I managed to source in the subset of the data by
> running:
>
>       wetland= asSGDF_GROD(x, offset=c(3600,20400), region.dim=c(8140,18000))
>
>       Running summary(wetland) gives:
>
>       Object of class SpatialGridDataFrame
> Coordinates:
>         min      max
> x -9.999992 140.0000
> y -7.833337  60.0000
> Is projected: NA
> proj4string : [NA]
> Number of points: 2
> Grid attributes:
>   cellcentre.offset    cellsize cells.dim
> x         -9.995825 0.008333334     18000
> y         -7.829171 0.008333334      8140
> Data attributes:
>         Min.      1st Qu.       Median         Mean      3rd Qu.         Max.
> 1.000000e+00 3.000000e+00 4.000000e+00 5.594000e+00 9.000000e+00 1.200000e+01
>         NA's
> 1.396304e+08
> ----------------------------------------------------------------------------------------------------------------------------------
>
> The original data is geocoded in latitude and longitude spanning from
> -180 to 180 for longitude and from -90 to 90 for latitude. As you
> probably noticed, the read-in raster image does not inherit the
> projection.
> I tried to project the data by running:
>
> asSGDF_GROD(x, offset=c(3600,20400),
> region.dim=c(8140,18000),CRS("+proj=longlat" ))
>
> and I get a message that says
>
> Error: object is not subsettable
>
> If anybody could help me out, I would greatly appreciate it.
>
> Thank you
> Harry
>
> _______________________________________________
> 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