Skip to content
Prev 29169 / 29559 Next

Spatial nested grid in R

El 10/02/2023 a las 15:13, Roger Bivand escribi?:
Thank you Roger!

In the spirit of the evolving, I then suggest this to Manuel:

# define this function (if it is not in your? version of sf)

st_as_sf.tess <- sf:::st_as_sf.owin

# transform tesselations in sf's

Dsf <-? st_as_sf(D)
Csf <-? st_as_sf(C)
Bsf <- st_as_sf(B)
Asf <- st_as_sf(A)

# crop tesselations with spatial polygon

RDsf <- Dsf[R,]
RCsf <- Csf[R,]
RBsf <- Bsf[R,]
RAsf <- Asf[R,]

#overimpose cropped grids
plot(RAsf)
plot(RDsf, border="green", add=T)
plot(RCsf, border="blue", add=T)
plot(RBsf, border="red", add=T)
plot(RAsf, add=T)

Cheers,

Marcelino