Description Usage Arguments Value Examples
Read shapefiles data from anywhere using a function defined by you
1 2 3 4 | import_shp(pathshp, FUN = rgdal::readOGR, dsnlayerbind = F,
data_source = flyio_get_datasource(),
bucket = flyio_get_bucket(data_source), dir = flyio_get_dir(),
delete_file = TRUE, show_progress = FALSE, ...)
|
pathshp |
path of the shp file to be read |
FUN |
the function using which the file is to be read |
dsnlayerbind |
if the FUN needs dsn and layer binded or not |
data_source |
the name of the data source, if not set globally. s3, gcs or local |
bucket |
the name of the bucket, if not set globally |
dir |
the directory to store intermediate files |
delete_file |
logical. to delete the file downloaded |
show_progress |
logical. Shows progress of the download operation |
... |
other parameters for the FUN function defined above |
the output of the FUN function
1 2 3 4 5 6 7 8 | ## Not run:
# import shapefile from Google Cloud
flyio_set_datasource("gcs")
flyio_set_bucket("your-bucket-name")
t = import_shp("shptest-on-cloud.shp", FUN = readOGR, dsnlayerbind = F, dir = tempdir())
t = import_shp("shptest-on-cloud.shp", FUN = raster::shapefile, dsnlayerbind = T, dir = tempdir())
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.