Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add remove_gpkg argument #237

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft

Add remove_gpkg argument #237

wants to merge 1 commit into from

Conversation

agila5
Copy link
Collaborator

@agila5 agila5 commented Dec 1, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant