Rolf,
I converted my raster from SpatialGridDataFrame to SpatialPointsDataFrame,
then to Spatial Point Pattern in spatstat :
tls.dtm.SPDF <- SpatialPointsDataFrame(xy.sp, z.df)
tls.dtm.spp <- as(tls.dtm.SPDF, "ppp")
But what method do you suggest next for subsetting the spp ?
Nathalie
--
Vie
For information, it worked with Robert's suggestions for 1 layer raster with
:
e <- extent(457446, 457506, 5384573, 5384633)
b <- raster(tls.dtm)
bb <- crop(b, e)
# Or
b <- brick(tls.dtm)
b <- raster(b, 1)
bb <- crop(b, e)
Cheers,
Nathalie
--
View this message in context:
http://r-sig-ge
Natalie,
library(raster)
b <- brick(SGDF)
e <- extent(457446, 457506, 5384573, 5384633)
bb <- crop(b, e)
# not sure what you want to do next, perhaps
sge <- as(bb, 'SpatialGridDataFrame')
Robert
On Mon, Oct 15, 2012 at 5:54 PM, Nathalie Morin <
nathalie.m.mo...@usherbrooke.ca> wrote:
> Hel
This can be easily done in the "spatstat" package if you convert
the object of interest to a spatial point pattern (object of class "ppp").
See the vignette "shapefiles" for some guidance on how to do the
conversion.
cheers,
Rolf Turner
On 16/10/12 13:54, Nathalie Morin wrote:
Hel
Hello !
I am trying to subset elements from a SpatialGridDataFrame not by attribute,
nor by indexing of rows/columns such as X[rows, columns], but by retrieving
the xy coordinates from the bounding box.
Example :
> bbox(SGDF)
min max
x 457446 457512
y 5384573 5384637
The