Spatial - Imports a spatial vector layer to an S4 Spatial object.
Source:R/spImportSpatial.R
spImportSpatial.Rd
Imports a spatial vector layer to an S4 Spatial object.
Arguments
- layer
Data frame object or String. Name of spatial layer. Can be layer with dsn, full pathname, including extension, or file name (with extension) in xy_dsn folder.
- dsn
String. Name of database where layer is. The dsn varies by driver. See gdal OGR vector formats (https://www.gdal.org/ogr_formats.html).
- sql
String. A sql syntax query to subset spatial layer.
- polyfix
Logical. If polyfix=TRUE, uses buffer with 0 width to clean up polygons.
- gui
Logical. If TRUE, search for layer within dsn.
Examples
# Import data from `FIESTA`, save as object in environment
WYbh <- spImportSpatial(system.file("extdata",
"sp_data/WYbighorn_adminbnd.shp",
package = "FIESTA"))