osmextract
osmextract copied to clipboard
Add remove_gpkg argument
First tests with remove_gpkg argument, see #235. I think that, at the moment, the only problem is that the function removes existing gpkg files. For example:
# packages
library(osmextract)
#> Data (c) OpenStreetMap contributors, ODbL 1.0. https://www.openstreetmap.org/copyright.
#> Check the package website, https://docs.ropensci.org/osmextract/, for more details.
options("sf_max_print" = 0L)
# data
pbf_path <- system.file("its-example.osm.pbf", package = "osmextract")
# new behaviour
oe_read(pbf_path, remove_gpkg = TRUE, quiet = TRUE)
list.files(system.file(package = "osmextract"), "pbf|gpkg")
#> [1] "its-example.osm.pbf"
# default behaviour
oe_read(pbf_path, quiet = TRUE)
list.files(system.file(package = "osmextract"), "pbf|gpkg")
#> [1] "its-example.gpkg" "its-example.osm.pbf"
# problem
oe_read(pbf_path, remove_gpkg = TRUE, quiet = TRUE)
list.files(system.file(package = "osmextract"), "pbf|gpkg")
#> [1] "its-example.osm.pbf"
Created on 2021-12-01 by the reprex package (v2.0.1)
TODO: add examples and tests