tileScheme: Tile Scheme

Description Usage Arguments Value Non-overlapping buffers Examples

View source: R/tileScheme.R

Description

This function aims to provide an all-in-one tool for creating tiling schemes, which includes options for overlapping buffers and methods for describing tile sizes in various ways (i.e. using either distance units or cell numbers).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
tileScheme(
  input,
  tiledim,
  cells = FALSE,
  buffer = 0,
  bufferspill = FALSE,
  round = NA,
  roundDir = "out",
  crs = NULL,
  origin = NULL,
  removeEmpty = FALSE
)

Arguments

input

filename (character), Extent, Raster or a vector of four numbers

tiledim

numeric. Defines the 'x' and 'y' dimensions of each tile. By default, dimensions are in map units. If 'cells' is set to TRUE, then dimensions are in number of cells

cells

logical. If set to TRUE, tiledim and buffer dimensions will be in number of cells instead of map units

buffer

numeric. If set to >0, overlapping buffers will be created around each tile

bufferspill

logical. Default is FALSE, in which case the tiling grid will be pushed inwards so that the buffers of the outer tiles are within the extent of input. If set to TRUE, the buffers will extend outside of the extent of input

round

numeric. Round the extent of the input Extent to the number of digits specified here.

roundDir

character. The direction of the rounding, either in for inwards or out for outwards.

crs

character. PROJ4 string defining output coordinate reference system (CRS). If set to NULL, the function will attempt to get a CRS from input (only works if it is a raster). Set to NA to force the output to have no CRS.

origin

numeric. Optional vector of two numbers corresponding to a pair of coordinates to which the tiling scheme will be aligned. Cannot be used in conjunction with cells. The coordinates do not need to be within the extent of input

removeEmpty

logical. Default is FALSE. If set to TRUE, tiles containing only NA cell values will be removed from the tiling scheme. Can only be used when input is a Raster object.

Value

a 'tileScheme' object

Non-overlapping buffers

When processing a tiled dataset, using buffered tiles can help remove the edge effects along the individual tile borders. However, overlapping buffers generally need to be removed when recombining a series of tiles back into a single raster. Although this can be accomplished by using the unbuffered tile extent, this will also remove the buffered areas along the edge of the tile set. Once these unbuffered tiles are reassembled, the resulting raster will then be smaller than the original dataset before it was tiled.

This may not be a desirable result. The polygons located in the nbuffs slot will produce a set of polygons that correspond to the tile extents that conserve buffers only where they do not overlap onto neighboring tiles (i.e.: along the edge of the tile set). These polygons are useful for cropping out overlapping areas from buffered tiles in order to reassemble the tiles into a single raster.

Examples

1
2
3
4
5
6
7
8
## Not run: 
ts1 <- tileScheme(CHMdemo, tiledim = c(50,50))

ts2 <- tileScheme(CHMdemo, tiledim = c(100,120), cells = TRUE)

ts3 <- tileScheme(CHMdemo, tiledim = 40, buffer = 5, origin = c(0.5, 0.5))

## End(Not run)

Example output

TileManager - Please note that version 0.4.0 is NOT backwards compatible

TileManager documentation built on Feb. 2, 2022, 5:09 p.m.