Read shapefile from any file or folder (trying to infer the format)
Source:R/shapefile_xyz.R
shapefile_from_any.Rd
Read shapefile from any file or folder (trying to infer the format)
Usage
shapefile_from_any(
path = NULL,
cleanit = TRUE,
crs = 4269,
layer = NULL,
inputname = NULL,
...
)
Arguments
- path
path of file(s) that is/are .gdb, .zip, .shp, .geojson, .json, etc., or folder
If .zip or folder that has more than one shapefile in it, cannot be read by this function, and must be unzipped and handled separately.
If folder, tries to read with
shapefile_from_folder()
Folder must contain one each of files with extensions .shp, .shx, .dbf, and .prjIf .zip containing a folder, unzips, then tries to read with
shapefile_from_folder()
orshapefile_from_gdbzip()
?If .zip containing .gdb, reads with
shapefile_from_gdbzip()
If .gdb, reads with
shapefile_from_gdb()
If .json or .geojson, reads with
shapefile_from_json()
If .kml or .shp, uses
sf::st_read()
If vector of .shp, .shx, .dbf, and .prj file names (that may include paths), reads with
shapefile_from_filepaths()
- cleanit
set to FALSE if you want to skip validation and dropping invalid rows
- crs
passed to shapefile_from_filepaths() etc. and default is crs = 4269 or Geodetic CRS NAD83
- layer
optional layer name passed to
sf::st_read()
- inputname
vector of shiny fileInput uploaded filenames
- ...
passed to
sf::st_read()
Value
a simple feature sf::sf class object using sf::st_read()