Skip to content

Commit

Permalink
Rebase out branch with osmdata_data_frame
Browse files Browse the repository at this point in the history
  • Loading branch information
jmaspons committed Dec 13, 2022
1 parent 2b553ff commit 96362f8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
6 changes: 5 additions & 1 deletion R/get-osmdata.R
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,6 @@ getbb_sc <- function (x) {

#' Return an OSM Overpass query as a \link{data.frame} object.
#'
# TODO: recommend queries with `out tags;` when implemented.
#'
#' @inheritParams osmdata_sp
#' @param q An object of class `overpass_query` constructed with
Expand All @@ -593,6 +592,11 @@ getbb_sc <- function (x) {
#' coerced to factors?
#' @return A `data.frame` with id, type and tags of the the objects from the query.
#'
#' @details If you are not interested in the geometries of the results, it's a
#' good option to query for objects that match the features only and forget
#' about members of the ways and relations. You can achieve this by passing
#' the parameter `body = "tags"` to \code{\link{opq}}.
#'
#' @family extract
#' @export
#'
Expand Down
6 changes: 6 additions & 0 deletions man/osmdata_data_frame.Rd

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

7 changes: 2 additions & 5 deletions tests/testthat/test-data_frame-osm.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,14 +180,12 @@ test_that ("date", {

test_that ("out meta & diff", {
q <- getbb ("Conflent", featuretype = "relation") %>%
opq (nodes_only = TRUE, datetime = "2020-11-07T00:00:00Z",
opq (nodes_only = TRUE, out = "meta", datetime = "2020-11-07T00:00:00Z",
datetime2 = "2022-12-04T00:00:00Z") %>%
add_osm_feature ("natural", "peak") %>%
add_osm_feature ("prominence") %>%
add_osm_feature ("name:ca")

q$suffix <- ");\n(._;>;);\nout meta;"

osm_meta_diff <- test_path ("fixtures", "osm-meta_diff.osm")
doc <- xml2::read_xml (osm_meta_diff)

Expand Down Expand Up @@ -218,13 +216,12 @@ test_that ("out meta & diff", {

test_that ("out meta & adiff", {
q <- getbb ("Conflent", featuretype = "relation") %>%
opq (nodes_only = TRUE, datetime = "2020-11-07T00:00:00Z") %>%
opq (nodes_only = TRUE, out = "meta", datetime = "2020-11-07T00:00:00Z") %>%
add_osm_feature ("natural", "peak") %>%
add_osm_feature ("prominence") %>%
add_osm_feature ("name:ca")

q$prefix <- gsub ("date:", "adiff:", q$prefix)
q$suffix <- ");\n(._;>;);\nout meta;"

osm_meta_adiff <- test_path ("fixtures", "osm-meta_adiff.osm")
doc <- xml2::read_xml (osm_meta_adiff)
Expand Down

0 comments on commit 96362f8

Please sign in to comment.