read_sf_ext | R Documentation |
An extended version of sf::read_sf()
that support reading spatial data
based on a file path, URL, or the data name and associated package.
Optionally provide a bounding box to filter data (not supported for all data
types). If a file path or url is provided for a GeoJSON file, the
read_sf_geojson function (using the suggested
geojsonsf package) is used.
read_sf_ext(..., bbox = NULL) read_sf_pkg(data, bbox = NULL, package = NULL, filetype = "gpkg", ...) read_sf_path(path, bbox = NULL, ...) read_sf_excel( path, sheet = NULL, bbox = NULL, coords = c("lon", "lat"), geo = FALSE, address = "address", from_crs = 4326, ... ) read_sf_csv( path, url = NULL, bbox = NULL, coords = c("lon", "lat"), geo = FALSE, address = "address", show_col_types = FALSE, from_crs = 4326, ... ) read_sf_url(url, bbox = NULL, coords = NULL, zm_drop = TRUE, ...) read_sf_geojson(url, path = NULL, geojson = NULL, bbox = NULL, ...) read_sf_gist(url, id = NULL, bbox = NULL, ...) read_sf_gmap(url, bbox = NULL, zm_drop = TRUE) read_sf_download( url, filename, bbox = NULL, path = NULL, filetype = "geojson", prefix = "date", method = "auto", unzip = FALSE, ... ) read_sf_gsheet( url, sheet = NULL, ss = NULL, bbox = NULL, coords = c("lon", "lat"), ask = FALSE, geo = FALSE, address = "address", from_crs = 4326, ... )
... |
Additional parameters passed to multiple functions; see details. |
bbox |
A bounding box object; defaults to |
data |
Character; name of dataset; used by |
package |
Character; package name; used by |
filetype |
File type supported for dsn parameter of |
path |
A file path. |
sheet |
Sheet to read. Either a string (the name of a sheet), or an
integer (the position of the sheet). Ignored if the sheet is specified via
|
coords |
Character vector with coordinate values. Coordinates must be latlon data (with coordinate reference system 4326). |
geo |
If |
address |
Address column name, Default: 'address' |
from_crs |
For df_to_sf, coordinate reference system used by coordinates or well known text in data frame. |
url |
A url for a spatial data file, a GitHub gist, or a ArcGIS
FeatureServer or MapServer to access with |
show_col_types |
If |
zm_drop |
If |
geojson |
string or vector of GeoJSON, or a URL or file pointing to a geojson file |
id |
The name of a column in which to store the file path. This is
useful when reading multiple input files and there is data in the file
paths, such as the data collection date. If |
filename |
File name; if file name is |
prefix |
File name prefix. "date" adds a date prefix, "time" adds a
date/time prefix; defaults to |
method |
Method to be used for downloading files. Current
download methods are The method can also be set through the option
|
unzip |
If |
ss |
Something that identifies a Google Sheet:
Processed through |
ask |
If |
Reading data from a url:
read_sf_url supports multiple types of urls:
A MapServer or FeatureServer URL
A URL for a GitHub gist with a single spatial data file (first file used if gist contains multiple)
A URL for a spatial data file or a CSV file
A Google Sheets URL
A public Google Maps URL
Reading data from a package:
read_sf_pkg looks for three types of package data:
Data loaded with the package
External data in the extdata
system files folder.
Cached data in the cache directory returned by rappdirs::user_cache_dir
Additional ... parameters:
read_sf_pkg and read_sf_download both pass additional parameters to read_sf_path which supports query, name_col, name, and table. name and name_col are ignored if a query parameter is provided. If table is not provided, a expected layer name is created based on the file path.
read_sf_url pass the where, name_col, and name for any ArcGIS FeatureServer or MapServer url (passed to get_esri_data) or sheet if the url is for a Google Sheet (passed to googlesheets4::read_sheet), or a query or wkt filter parameter if the url is some other type (passed to sf::read_sf).
read_sf_ext is a flexible function that only has bbox as a named parameter and all other parameters in ... are passed to one of the other overedge read_sf functions.
Other read_write:
make_filename()
,
read_sf_exif()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.