make_grids {stppSim}R Documentation

Make square grids

Description

Generates a system of square grids over an area (boundary shapefile).

Usage

make_grids(poly, size = 350,
show_output = FALSE, interactive = FALSE)

Arguments

poly

(as spatialPolygons, spatialPolygonDataFrames, or ⁠simple features⁠). A polygon object over which square grids are to be created.

size

Size of square grids to be created. For example, the input size for a 350 by 350 square grids is 350.

show_output

(logical) Display the output. Default: FALSE

interactive

(logical) to show interactive map of the grids generated. Default: FALSE.

Details

Generates a square grid system in a shapefile format (in the same crs as the input poly). If interactive argument is TRUE, an interactive map is shown from which the centroid coordinates of any grid can be displayed by hovering the mouse over the grid. If internet connection is available on the PC, a basemap (OpenStreetmap) is added to help identify places.

Value

Returns a "SpatialPolygonsDataFrames" object representing a system of square grids covering the polygon area.

Examples

#load boundary of Camden
load(file = system.file("extdata", "camden.rda",
package="stppSim"))
boundary = camden$boundary
make_grids(poly=boundary, size = 350,
show_output = FALSE, interactive = FALSE)

[Package stppSim version 1.3.4 Index]