sp_bind | R Documentation |
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.
sp_bind(...)
... |
Spatial objects of the same type. |
For uniting geometries which exist in the same data object, use
sp_unite
.
Stuart K. Grange
sp_unite
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.