sp_bind: Function to bind different spatial objects together.

View source: R/sp_bind.R

sp_bindR Documentation

Function to bind different spatial objects together.

Description

sp_bind combines spatial objects of the same type together. This function is useful for combining shapefiles or tables of WKT strings together. The feature IDs within line- and polygon-spatial objects must be manipulated for the binding to occur. The original, non-manipulated IDs are not preserved. sp_bind will still bind objects if their data slots contain different variables.

Usage

sp_bind(...)

Arguments

...

Spatial objects of the same type. ... can be a number of individual objects or a list containing many objects.

Details

For uniting geometries which exist in the same data object, use sp_unite.

Author(s)

Stuart K. Grange

See Also

sp_unite

Examples

## Not run: 

# Two objects
sp_london_two <- sp_bind(sp_croydon, sp_islington)

# Many objects
sp_london_many <- sp_bind(sp_croydon, sp_islington, sp_bexley, sp_brent)

# Or a list of many objects
sp_london_many_many <- sp_bind(sp_list_of_many)


# Load many files with plyr then bind together
# Get files
file_list <- list.files("data/shapefiles", "shp")

# Load files
sp_list <- llply(file_list, sp_read, verbose = FALSE)

# Bind all spatial objects
sp_bound <- sp_bind(sp_list)


## End(Not run)


skgrange/gissr documentation built on June 20, 2024, 12:02 a.m.