generate_grid {ElevDistr}R Documentation

Generate a grid around the input point

Description

Generate a grid around a longitude and latitude, with a defined square size and step size.

Usage

generate_grid(lon, lat, squareSize = 10, stepSize = 0.0025)

Arguments

lon

Longitude of the grid center (in degrees; WGS 84). One value, data type "numeric" and finite.

lat

Latitude of the grid center (in degrees; WGS 84). One value, data type "numeric" and finite.

squareSize

Square size (in km). One value, data type "numeric" and finite.

stepSize

Step size for the square sampling (in degree). One value, data type "numeric" and finite.

Value

A list containing a data frame with longitude and latitude of the grid and a vector containing the length of the longitudinal and latitudinal sequence.

Author(s)

Livio Bätscher, Jurriaan M. de Vos

Examples

#Generate a 10x10 km grid with a step size of 0.0025 degrees
temp <- generate_grid(lon = 8.728898, lat = 46.93756, squareSize = 10, stepSize = 0.0025)

#Part of the generated coordinates
temp$df[105:115,]

[Package ElevDistr version 1.0.8 Index]