tileShapefile: Divide SpatialPolygonsDataFrame into smaller tiles

Description Usage Arguments Details Examples

View source: R/tileShapefile.R

Description

The tileShapefile function splits large shapefiles into up into 1 or 2 degree tiles while preserving the zonal polygons. The purpose of this is to prevent memory issues when reading Daymet records.

Usage

1
tileShapefile(shapefile, tileDegree)

Arguments

shapefile

A SpatialPolygonsDataFrame of the zones which will be assigned climate records. The object should be in the WGS geographic coordinate system to match the netCDF files (proj4string = "+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +towgs84=0,0,0").

tileDegree

A numeric value of either 1 or 2 indicating the length of the tile edge in lat/lon degrees.

Details

Polygons are assigned to tiles based on where their centroids are located. The spatial object should be in the Daymet coordinate system before executing the function. This function only works for SpatialPolygonsDataFrame with units that are lat/lon. The "spTransform" function can be used to transform the object from a projected to a geographic coordinate system.

Examples

1
2
tileShapefile(shapefile  = spatialPolygonsDataFrame,
              tileDegree = 2)

Conte-Ecology/zonalDaymet documentation built on Aug. 11, 2021, 12:52 a.m.