getID: Derive 1 degree cell IDs

Description Usage Arguments Value Note Author(s) See Also Examples

Description

Derives ID's of the 1 degree cells in the default land mask for a given polygon defining the spatial domain of interest.

Usage

1
2
3
## S4 method for signature 'SpatialPolygons'
getID(obj, pixsize = 3/3600, empty.tif = FALSE, 
      compress = FALSE, zipname = set.file.extension(tempfile(tmpdir = getwd()), "zip"))

Arguments

obj

object of class "SpatialPolygons"; must be in geographical coordinates (WGS84)

pixsize

grid cell size in decimal degrees (set at 0.0008333333 or 100 m around equator)

empty.tif

logical; specify whether a GeoTiff mask file should be created

compress

logical; specify whether to compress GeoTiffs

zipname

(optional); zip archive file name

Value

The output is a vector of grid cell ID names e.g. W79_N83. These can be further used to automate digital soil mapping for large areas.

Note

This operation can be time consuming for large areas (e.g. continents).

Author(s)

Tomislav Hengl

See Also

landmask

Examples

1
2
3
4
5
6
7
library(sp)
## Bounding box for Malawi:
bbox = expand.grid(lon=c(32.67152, 35.915046), lat=c(-17.12721, -9.363796))
bbox[5,] <- bbox[1,]
crs = CRS("+proj=longlat +datum=WGS84")
x <- SpatialPolygons(list(Polygons(list(Polygon(bbox)), ID="1")), proj4string=crs)
ID.lst <- getID(x)

GSIF documentation built on May 2, 2019, 5:44 p.m.

Related to getID in GSIF...