Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Description: Match, download, convert and import Open Street Map data extracts
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
Roxygen: list(markdown = TRUE)
URL: https://docs.ropensci.org/osmextract/, https://github.com/ropensci/osmextract
BugReports: https://github.com/ropensci/osmextract/issues
Expand Down
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

* The default directory used to store `.osm.pbf` and `.gpkg` files downloaded or created by this package has changed from `tempdir()` to `tools::R_user_dir("osmextract", "data")` ([#302](https://github.com/ropensci/osmextract/issues/302)).
* Bump minimum R version to 4.1.0 because that's a requirement for one of our indirect dependencies (i.e. svglite). This also ensures that we can properly use `tools::R_user_dir()` since that function was introduced in R 4.0.0 ([#302](https://github.com/ropensci/osmextract/issues/302)).
* Updated the behaviour of the `oe_get` function when a `sf/sfc/bbox` is provided as input for `place`. If `boundary` is not provided, it is automatically set to match `place` so only the relevant portion of the extract is processed.

# osmextract 0.5.3

Expand Down
11 changes: 10 additions & 1 deletion R/get.R
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@
#' display a progress bar.
#' @param boundary An `sf`/`sfc`/`bbox` object that will be used to create a
#' spatial filter during the vectortranslate operations. The type of filter
#' can be chosen using the argument `boundary_type`.
#' can be chosen using the argument `boundary_type`. If `place` is an `sf`/`sfc`
#' polygon or a `bbox`, then it will be used as `boundary` if the latter is not
#' specified.
#' @param boundary_type A character vector of length 1 specifying the type of
#' spatial filter. The `spat` filter selects only those features that
#' intersect a given area, while `clipsrc` also clips the geometries. Check
Expand Down Expand Up @@ -262,6 +264,13 @@ oe_get = function(
file_url = matched_zone[["url"]]
file_size = matched_zone[["file_size"]]

# If place is an sf/sfc polygon or bbox, use it as boundary
if (is.null(boundary) && (inherits(place, "bbox") || (inherits(place, c("sf", "sfc")) && sf::st_dimension(place) == 2))) {
message("Setting boundary = place to geographically subset the output.")
message("Use boundary = NULL to import full extract.")
boundary = place
}

oe_read(
file_path = file_url,
layer = layer,
Expand Down
4 changes: 3 additions & 1 deletion man/oe_get.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/oe_read.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/oe_vectortranslate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading