diff --git a/NAMESPACE b/NAMESPACE index 30f2b69a..a10b5602 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -31,17 +31,15 @@ export(osm_delete_gpx) export(osm_delete_note) export(osm_delete_object) export(osm_details_logged_user) -export(osm_details_user) -export(osm_details_users) export(osm_diff_upload_changeset) export(osm_download_changeset) export(osm_feed_notes) -export(osm_fetch_objects) -export(osm_full_object) export(osm_get_data_gpx) export(osm_get_metadata_gpx) +export(osm_get_objects) export(osm_get_points_gps) export(osm_get_preferences_user) +export(osm_get_user_details) export(osm_hide_comment_changeset_discussion) export(osm_history_object) export(osm_list_gpxs) @@ -50,7 +48,6 @@ export(osm_query_changesets) export(osm_read_bbox_notes) export(osm_read_changeset) export(osm_read_note) -export(osm_read_object) export(osm_redaction_object) export(osm_relations_object) export(osm_reopen_note) @@ -61,7 +58,6 @@ export(osm_unsubscribe_changeset_discussion) export(osm_update_changeset) export(osm_update_gpx) export(osm_update_object) -export(osm_version_object) export(osm_ways_node) export(osmchange_create) export(osmchange_delete) diff --git a/R/osm_get_objects.R b/R/osm_get_objects.R new file mode 100644 index 00000000..b119ccf0 --- /dev/null +++ b/R/osm_get_objects.R @@ -0,0 +1,215 @@ +#' Get OSM objects +#' +#' Retrieve objects by `type`, `id` and `version`. +#' +#' @param osm_type A vector with the type of the objects (`"node"`, `"way"` or `"relation"`). Recycled if it has a +#' different length than `osm_id`. +#' @param osm_id Object ids represented by a numeric or a character vector. +#' @param version An optional vector with the version number for each object. If missing, the last version will be +#' retrieved. Recycled if it has different length than `osm_id`. +#' @param full_objects If `TRUE`, retrieves all other objects referenced by ways or relations. Not compatible with +#' `version`. +#' @param format Format of the output. Can be `R` (default), `xml`, or `json`. +#' @param tags_in_columns If `FALSE` (default), the tags of the objects are saved in a single list column `tags``` +#' containing a `data.frame` for each OSM object with the keys and values. If `TRUE`, add a column for each key. +#' Ignored if `format != "R"`. +#' +#' @details +#' `full_objects = TRUE` does not support specifying `version`. +#' For ways, `full_objects = TRUE` implies that it will return the way specified plus all nodes referenced by the way. +#' For a relation, it will return the following: +#' * The relation itself +#' * All nodes, ways, and relations that are members of the relation +#' * Plus all nodes used by ways from the previous step +#' * The same recursive logic is not applied to relations. This means: If relation r1 contains way w1 and relation r2, +#' and w1 contains nodes n1 and n2, and r2 contains node n3, then a "full" request for r1 will give you r1, r2, w1, +#' n1, and n2. Not n3. +#' +#' @note +#' For downloading data for purposes other than editing or exploring the history of the objects, perhaps is better to +#' use the Overpass API. A similar function to download OSM objects by `type` and `id` using Overpass, is implemented in +#' [osmdata::opq_osm_id()]. +#' +#' @return +#' @family get OSM objects' functions +#' @export +#' +#' @examples +#' \dontrun{ +#' obj <- osm_get_objects( +#' osm_type = c("node", "way", "way", "relation", "relation", "node"), +#' osm_id = c("35308286", "13073736", "235744929", "40581", "341530", "1935675367"), +#' version = c(1, 3, 2, 5, 7, 1) +#' ) +#' obj +#' } +osm_get_objects <- function(osm_type, osm_id, version, full_objects = FALSE, + format = c("R", "xml", "json"), tags_in_columns = FALSE) { + format <- match.arg(format) + + stopifnot( + '`osm_type` must be a vector containing values "node", "way" or "relation".' = + all(osm_type %in% c("node", "way", "relation")) + ) + + if (!missing(version) && full_objects) { + stop("Getting full objects with specific version is not supported.") + } + if (length(osm_id) %% length(osm_type) != 0 || length(osm_type) > length(osm_id)) { + stop("`osm_id` length must be a multiple of `osm_type` length.") + } + + if (length(osm_id) == 1) { + if (full_objects && osm_type %in% c("way", "relation")) { + out <- osm_full_object(osm_type = osm_type, osm_id = osm_id, format = format, tags_in_columns = tags_in_columns) + } else if (!missing(version)) { + out <- osm_version_object( + osm_type = osm_type, osm_id = osm_id, version = version, format = format, tags_in_columns = tags_in_columns + ) + } else { + out <- osm_read_object(osm_type = osm_type, osm_id = osm_id, format = format, tags_in_columns = tags_in_columns) + } + + return(out) + } + + type_id <- data.frame(type = osm_type, id = osm_id) + if (!missing(version)) { + if (length(version) %% nrow(type_id) != 0 || length(version) > nrow(type_id)) { + stop("`osm_id` length must be a multiple of `version` length.") + } + type_id$version <- version + } + + if (nrow(type_id) > nrow(type_id <- unique(type_id))) { + warning("Duplicated elements discarded.") + } + + type_idL <- split(type_id, type_id$type) + + if (full_objects) { + out <- mapply(function(type, ids) { + if (type %in% c("way", "relation")) { + full_objL <- lapply(ids$id, function(id) { + osm_full_object(osm_type = type, osm_id = id, format = format) + }) + + if (format == "R") { + full_obj <- do.call(rbind, full_objL) + } else if (format == "xml") { + full_obj <- full_objL[[1]] + + full_obj <- xml2::xml_new_root(full_objL[[1]]) + for (i in seq_len(length(full_objL) - 1)) { + for (j in seq_len(xml2::xml_length(full_objL[[i + 1]]))) { + xml2::xml_add_child(full_obj, xml2::xml_child(full_objL[[i + 1]], search = j)) + } + } + } else if (format == "json") { + full_obj <- full_objL[[1]] + if (length(full_objL) > 1) { + full_obj$elements <- do.call(c, c(list(full_obj$elements), lapply(full_objL[-1], function(x) x$elements))) + } + } + } else { + full_obj <- osm_fetch_objects(osm_type = paste0(type, "s"), osm_ids = ids$id, format = format) + } + full_obj + }, type = names(type_idL), ids = type_idL, SIMPLIFY = FALSE) + } else { # no full_objects + type_plural <- paste0(names(type_idL), "s") # type in plural for osm_fetch_objects() + + if (missing(version)) { + out <- mapply(function(type, ids) { + osm_fetch_objects(osm_type = type, osm_ids = ids$id, format = format) + }, type = type_plural, ids = type_idL, SIMPLIFY = FALSE) + } else { + out <- mapply(function(type, ids) { + osm_fetch_objects(osm_type = type, osm_ids = ids$id, versions = ids$version, format = format) + }, type = type_plural, ids = type_idL, SIMPLIFY = FALSE) + } + } + + + ## Order objects + + if (full_objects) { + # Order by types (node, way, relation) + + if (format == "R") { + out <- do.call(rbind, out[intersect(c("node", "way", "relation"), names(ord_out))]) + out <- rbind(out[out$type == "node", ], out[out$type == "way", ]) + out <- rbind(out, out[out$type == "relation", ]) + } else if (format == "xml") { + ## TODO: test. Use xml2::xml_find_all()? + out <- out[intersect(c("node", "way", "relation"), names(out))] + out_ordered <- xml2::xml_new_root(out[[1]]) + for (i in seq_len(length(out) - 1)) { + for (j in seq_len(xml2::xml_length(out[[i + 1]]))) { + xml2::xml_add_child(out_ordered, xml2::xml_child(out[[i + 1]], search = j)) + } + } + out <- out_ordered + } else if (format == "json") { + ord_out <- lapply(out, function(x) { + vapply(x$elements, function(y) do.call(paste, y[names(type_id)]), FUN.VALUE = character(1)) + }) + ord <- unlist(ord_out[intersect(c("node", "way", "relation"), names(ord_out))]) + ord <- c(ord[grep("^node", ord)], ord[grep("^way", ord)], ord[grep("^relation", ord)]) + ord <- data.frame(type = gsub("[0-9]+$", "", names(ord)), pos = as.integer(gsub("^[a-z.]+", "", names(ord)))) + ord$pos[is.na(ord$pos)] <- 1 # for types with only 1 object + + out_ordered <- out[[1]][setdiff(names(out[[1]]), "elements")] + out_ordered$elements <- apply(ord, 1, function(x) { + out[[x[1]]]$elements[[as.integer(x[2])]] + }, simplify = FALSE) + out <- out_ordered + } + } else { + ## Original order + + ord_ori <- do.call(paste, type_id) + + if (format == "R") { + out <- do.call(rbind, out) + ord_out <- do.call(paste, out[, intersect(names(type_id), c("type", "id", "version"))]) + out <- out[match(ord_ori, ord_out), ] + rownames(out) <- NULL + + if (tags_in_columns) { + out <- tags_list2wide(out) + } + } else if (format == "xml") { + ord_out <- lapply(out, function(x) { + out_type_id <- object_xml2DF(x) + do.call(paste, out_type_id[, names(type_id)]) + }) + ordL <- lapply(ord_out, function(x) match(ord_ori, x)) + ord <- sort(unlist(ordL)) + ord <- data.frame(type = gsub("[0-9]+$", "", names(ord)), pos = as.integer(gsub("^[a-z.]+", "", names(ord)))) + ord$pos[is.na(ord$pos)] <- 1 # for types with only 1 object + + out_ordered <- xml2::xml_new_root(out[[ord$type[1]]]) + xml2::xml_remove(xml2::xml_children(out_ordered)) + for (i in seq_len(nrow(ord))) { + xml2::xml_add_child(out_ordered, xml2::xml_child(out[[ord$type[i]]], search = ord$pos[i])) + } + out <- out_ordered + } else if (format == "json") { + ord_out <- lapply(out, function(x) { + vapply(x$elements, function(y) do.call(paste, y[names(type_id)]), FUN.VALUE = character(1)) + }) + ordL <- lapply(ord_out, function(x) match(ord_ori, x)) + ord <- sort(unlist(ordL)) + ord <- data.frame(type = gsub("[0-9]+$", "", names(ord)), pos = as.integer(gsub("^[a-z.]+", "", names(ord)))) + + out_ordered <- out[[1]][setdiff(names(out[[1]]), "elements")] + out_ordered$elements <- apply(ord, 1, function(x) { + out[[x[1]]]$elements[[as.integer(x[2])]] + }, simplify = FALSE) + out <- out_ordered + } + } + + return(out) +} diff --git a/R/osm_get_user_details.R b/R/osm_get_user_details.R new file mode 100644 index 00000000..6d0cbc32 --- /dev/null +++ b/R/osm_get_user_details.R @@ -0,0 +1,26 @@ +#' Details of users +#' +#' @param user_id The ids of the users to retrieve the details for, represented by a numeric or a character value (not +#' the display names). +#' @param format Format of the output. Can be `R` (default), `xml`, or `json`. +#' +#' @return +#' @family users' functions +#' @export +#' +#' @examples +#' \dontrun{ +#' usrs <- osm_details_users(user_ids = c(1, 24, 44, 45, 46, 48, 49, 50)) +#' usrs +#' } +osm_get_user_details <- function(user_id, format = c("R", "xml", "json")) { + format <- match.arg(format) + + if (length(user_id) == 1) { + out <- osm_details_user(user_id = user_id, format = format) + } else { + out <- osm_details_users(user_ids = user_id, format = format) + } + + return(out) +} diff --git a/R/osmapi_connection.R b/R/osmapiR_connection.R similarity index 100% rename from R/osmapi_connection.R rename to R/osmapiR_connection.R diff --git a/R/osmapi_methods.R b/R/osmapiR_methods.R similarity index 100% rename from R/osmapi_methods.R rename to R/osmapiR_methods.R diff --git a/R/osmapi_request.R b/R/osmapiR_request.R similarity index 100% rename from R/osmapi_request.R rename to R/osmapiR_request.R diff --git a/R/changeset_discussion.R b/R/osmapi_changeset_discussion.R similarity index 100% rename from R/changeset_discussion.R rename to R/osmapi_changeset_discussion.R diff --git a/R/changesets.R b/R/osmapi_changesets.R similarity index 100% rename from R/changesets.R rename to R/osmapi_changesets.R diff --git a/R/elements.R b/R/osmapi_elements.R similarity index 99% rename from R/elements.R rename to R/osmapi_elements.R index 4533f04b..e923bd80 100644 --- a/R/elements.R +++ b/R/osmapi_elements.R @@ -200,8 +200,8 @@ osm_create_object <- function(x, changeset_id) { #' Ignored if `format != "R"`. #' #' @return -#' @family get OSM objects' functions -#' @export +# @family get OSM objects' functions +#' @noRd #' #' @examples #' \dontrun{ @@ -586,8 +586,8 @@ osm_history_object <- function(osm_type = c("node", "way", "relation"), osm_id, #' Ignored if `format != "R"`. #' #' @return -#' @family get OSM objects' functions -#' @export +# @family get OSM objects' functions +#' @noRd #' #' @examples #' \dontrun{ @@ -665,8 +665,8 @@ osm_version_object <- function(osm_type = c("node", "way", "relation"), osm_id, #' [osmdata::opq_osm_id()]. #' #' @return -#' @family get OSM objects' functions -#' @export +# @family get OSM objects' functions +#' @noRd #' #' @examples #' \dontrun{ @@ -690,12 +690,14 @@ osm_fetch_objects <- function(osm_type = c("nodes", "ways", "relations"), osm_id } if (format == "json") { - osm_type <- paste0(osm_type, ".json") + osm_type_endpoint <- paste0(osm_type, ".json") + } else { + osm_type_endpoint <- osm_type } req <- osmapi_request() req <- httr2::req_method(req, "GET") - req <- httr2::req_url_path_append(req, osm_type) + req <- httr2::req_url_path_append(req, osm_type_endpoint) if (osm_type == "nodes") { req <- httr2::req_url_query(req, nodes = paste(osm_ids, collapse = ",")) @@ -875,8 +877,8 @@ osm_ways_node <- function(node_id, format = c("R", "xml", "json"), tags_in_colum #' [osmdata::opq_osm_id()]. #' #' @return -#' @family get OSM objects' functions -#' @export +# @family get OSM objects' functions +#' @noRd #' #' @examples #' \dontrun{ diff --git a/R/gps_traces.R b/R/osmapi_gps_traces.R similarity index 100% rename from R/gps_traces.R rename to R/osmapi_gps_traces.R diff --git a/R/map_notes.R b/R/osmapi_map_notes.R similarity index 100% rename from R/map_notes.R rename to R/osmapi_map_notes.R diff --git a/R/miscellaneous.R b/R/osmapi_miscellaneous.R similarity index 100% rename from R/miscellaneous.R rename to R/osmapi_miscellaneous.R diff --git a/R/user_data.R b/R/osmapi_user_data.R similarity index 99% rename from R/user_data.R rename to R/osmapi_user_data.R index e9dbc1c2..3dbe182c 100644 --- a/R/user_data.R +++ b/R/osmapi_user_data.R @@ -48,8 +48,8 @@ #' @param format Format of the output. Can be `R` (default), `xml`, or `json`. #' #' @return -#' @family users' functions -#' @export +# @family users' functions +#' @noRd #' #' @examples #' \dontrun{ @@ -141,8 +141,8 @@ osm_details_user <- function(user_id, format = c("R", "xml", "json")) { #' @param format Format of the output. Can be `R` (default), `xml`, or `json`. #' #' @return -#' @family users' functions -#' @export +# @family users' functions +#' @noRd #' #' @examples #' \dontrun{ diff --git a/R/osmchange.R b/R/osmchange.R index c284d8f3..00d3a18c 100644 --- a/R/osmchange.R +++ b/R/osmchange.R @@ -13,7 +13,7 @@ #' @details #' `x` should follow the format of `osmapi_objects` with tags in wide format or a `tags` column with a list of #' data.frames with `key` and `value` columns. Missing tags or tags with `NA` in the value will be removed. See -#' [osm_read_object()] for examples of the format. +#' [osm_get_objects()] for examples of the format. #' #' @return #' @family OsmChange's functions diff --git a/R/tags_list-wide.r b/R/tags_list-wide.r index 5ad9b2d3..8562e0ff 100644 --- a/R/tags_list-wide.r +++ b/R/tags_list-wide.r @@ -5,7 +5,7 @@ #' to change the format of the tags. #' #' @rdname tags_list-wide -#' @param x An `osmapi_objects` or `osmapi_changesets` objects as returned by, for example, [osm_read_object()] or +#' @param x An `osmapi_objects` or `osmapi_changesets` objects as returned by, for example, [osm_get_objects()] or #' [osm_read_changeset()]. #' #' @details diff --git a/inst/httptest2/redact.R b/inst/httptest2/redact.R index 0ded7a11..e5d03358 100644 --- a/inst/httptest2/redact.R +++ b/inst/httptest2/redact.R @@ -13,10 +13,18 @@ function(response) { fixed = TRUE ) + # xml response <- httptest2::gsub_response( response, - 'generator="CGImap 0.8.8 \\([0-9]+ .+.openstreetmap.org\\)" copyright="OpenStreetMap and contributors"', - 'generator="CGImap 0.8.8 (012345 ******.openstreetmap.org)" copyright="OpenStreetMap and contributors"' + 'generator="CGImap ([0-9.]+) \\([0-9]+ .+\\.openstreetmap\\.org\\)" copyright="OpenStreetMap and contributors"', + 'generator="CGImap \\1 (012345 ******.openstreetmap.org)" copyright="OpenStreetMap and contributors"' + ) + + # json + response <- httptest2::gsub_response( + response, + '"CGImap ([0-9.]+) \\([0-9]+ .+\\.openstreetmap\\.org\\)",', + '"CGImap \\1 (012345 ******.openstreetmap.org)",', ) return(response) diff --git a/man/API_configuration.Rd b/man/API_configuration.Rd index 0fb3c167..94069f9e 100644 --- a/man/API_configuration.Rd +++ b/man/API_configuration.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/osmapi_connection.R +% Please edit documentation in R/osmapiR_connection.R \name{set_osmapi_connection} \alias{set_osmapi_connection} \alias{get_osmapi_url} diff --git a/man/authenticate_osmapiR.Rd b/man/authenticate_osmapiR.Rd index 9a4683b0..8ca19dae 100644 --- a/man/authenticate_osmapiR.Rd +++ b/man/authenticate_osmapiR.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/osmapi_connection.R +% Please edit documentation in R/osmapiR_connection.R \name{authenticate_osmapi} \alias{authenticate_osmapi} \alias{logout_osmapi} diff --git a/man/osm_api_versions.Rd b/man/osm_api_versions.Rd index 9a72ec17..071618bd 100644 --- a/man/osm_api_versions.Rd +++ b/man/osm_api_versions.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/miscellaneous.R +% Please edit documentation in R/osmapi_miscellaneous.R \name{osm_api_versions} \alias{osm_api_versions} \title{Available API versions} diff --git a/man/osm_bbox_objects.Rd b/man/osm_bbox_objects.Rd index 4c990aed..bbbc43ad 100644 --- a/man/osm_bbox_objects.Rd +++ b/man/osm_bbox_objects.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/miscellaneous.R +% Please edit documentation in R/osmapi_miscellaneous.R \name{osm_bbox_objects} \alias{osm_bbox_objects} \title{Retrieve map data by bounding box} @@ -51,12 +51,9 @@ map_data } \seealso{ Other get OSM objects' functions: -\code{\link{osm_fetch_objects}()}, -\code{\link{osm_full_object}()}, +\code{\link{osm_get_objects}()}, \code{\link{osm_history_object}()}, -\code{\link{osm_read_object}()}, \code{\link{osm_relations_object}()}, -\code{\link{osm_version_object}()}, \code{\link{osm_ways_node}()} } \concept{get OSM objects' functions} diff --git a/man/osm_capabilities.Rd b/man/osm_capabilities.Rd index 7aa68962..e77e6e6e 100644 --- a/man/osm_capabilities.Rd +++ b/man/osm_capabilities.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/miscellaneous.R +% Please edit documentation in R/osmapi_miscellaneous.R \name{osm_capabilities} \alias{osm_capabilities} \title{Capabilities of the API} diff --git a/man/osm_close_note.Rd b/man/osm_close_note.Rd index 2b0ac77f..490a01e8 100644 --- a/man/osm_close_note.Rd +++ b/man/osm_close_note.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map_notes.R +% Please edit documentation in R/osmapi_map_notes.R \name{osm_close_note} \alias{osm_close_note} \title{Close a note} diff --git a/man/osm_comment_changeset_discussion.Rd b/man/osm_comment_changeset_discussion.Rd index f61d5f8a..b53cd815 100644 --- a/man/osm_comment_changeset_discussion.Rd +++ b/man/osm_comment_changeset_discussion.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changeset_discussion.R +% Please edit documentation in R/osmapi_changeset_discussion.R \name{osm_comment_changeset_discussion} \alias{osm_comment_changeset_discussion} \title{Comment a changeset} diff --git a/man/osm_create_changeset.Rd b/man/osm_create_changeset.Rd index 608b5fc5..57396886 100644 --- a/man/osm_create_changeset.Rd +++ b/man/osm_create_changeset.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changesets.R +% Please edit documentation in R/osmapi_changesets.R \name{osm_create_changeset} \alias{osm_create_changeset} \alias{osm_update_changeset} diff --git a/man/osm_create_comment_note.Rd b/man/osm_create_comment_note.Rd index 9932c0b1..fcefeb79 100644 --- a/man/osm_create_comment_note.Rd +++ b/man/osm_create_comment_note.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map_notes.R +% Please edit documentation in R/osmapi_map_notes.R \name{osm_create_comment_note} \alias{osm_create_comment_note} \title{Create a new comment in a note} diff --git a/man/osm_create_gpx.Rd b/man/osm_create_gpx.Rd index c5d5bb6d..e105afbc 100644 --- a/man/osm_create_gpx.Rd +++ b/man/osm_create_gpx.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gps_traces.R +% Please edit documentation in R/osmapi_gps_traces.R \name{osm_create_gpx} \alias{osm_create_gpx} \title{Create GPS trace} diff --git a/man/osm_create_note.Rd b/man/osm_create_note.Rd index 2eb16e3d..7f2568a0 100644 --- a/man/osm_create_note.Rd +++ b/man/osm_create_note.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map_notes.R +% Please edit documentation in R/osmapi_map_notes.R \name{osm_create_note} \alias{osm_create_note} \title{Create a new note} diff --git a/man/osm_create_object.Rd b/man/osm_create_object.Rd index d2e9e516..ed425108 100644 --- a/man/osm_create_object.Rd +++ b/man/osm_create_object.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R +% Please edit documentation in R/osmapi_elements.R \name{osm_create_object} \alias{osm_create_object} \title{Create an OSM object} diff --git a/man/osm_delete_gpx.Rd b/man/osm_delete_gpx.Rd index c982f273..32728aca 100644 --- a/man/osm_delete_gpx.Rd +++ b/man/osm_delete_gpx.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gps_traces.R +% Please edit documentation in R/osmapi_gps_traces.R \name{osm_delete_gpx} \alias{osm_delete_gpx} \title{Delete GPS trace} diff --git a/man/osm_delete_note.Rd b/man/osm_delete_note.Rd index b9deea11..f32722f1 100644 --- a/man/osm_delete_note.Rd +++ b/man/osm_delete_note.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map_notes.R +% Please edit documentation in R/osmapi_map_notes.R \name{osm_delete_note} \alias{osm_delete_note} \title{Delete a note} diff --git a/man/osm_delete_object.Rd b/man/osm_delete_object.Rd index 1e2bcd8b..8810d702 100644 --- a/man/osm_delete_object.Rd +++ b/man/osm_delete_object.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R +% Please edit documentation in R/osmapi_elements.R \name{osm_delete_object} \alias{osm_delete_object} \title{Delete an OSM object} diff --git a/man/osm_details_logged_user.Rd b/man/osm_details_logged_user.Rd index e2f3143b..14cd8db2 100644 --- a/man/osm_details_logged_user.Rd +++ b/man/osm_details_logged_user.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/user_data.R +% Please edit documentation in R/osmapi_user_data.R \name{osm_details_logged_user} \alias{osm_details_logged_user} \title{Details of the logged-in user} @@ -23,8 +23,7 @@ usr_details } \seealso{ Other users' functions: -\code{\link{osm_details_users}()}, -\code{\link{osm_details_user}()}, -\code{\link{osm_get_preferences_user}()} +\code{\link{osm_get_preferences_user}()}, +\code{\link{osm_get_user_details}()} } \concept{users' functions} diff --git a/man/osm_details_user.Rd b/man/osm_details_user.Rd deleted file mode 100644 index a6745e69..00000000 --- a/man/osm_details_user.Rd +++ /dev/null @@ -1,29 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/user_data.R -\name{osm_details_user} -\alias{osm_details_user} -\title{Details of a user} -\usage{ -osm_details_user(user_id, format = c("R", "xml", "json")) -} -\arguments{ -\item{user_id}{The id of the user to retrieve represented by a numeric or a character value (not the display name).} - -\item{format}{Format of the output. Can be \code{R} (default), \code{xml}, or \code{json}.} -} -\description{ -Details of a user -} -\examples{ -\dontrun{ -usr <- osm_details_user(user_id = "11725140") -usr -} -} -\seealso{ -Other users' functions: -\code{\link{osm_details_logged_user}()}, -\code{\link{osm_details_users}()}, -\code{\link{osm_get_preferences_user}()} -} -\concept{users' functions} diff --git a/man/osm_diff_upload_changeset.Rd b/man/osm_diff_upload_changeset.Rd index e8061740..f601eb49 100644 --- a/man/osm_diff_upload_changeset.Rd +++ b/man/osm_diff_upload_changeset.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changesets.R +% Please edit documentation in R/osmapi_changesets.R \name{osm_diff_upload_changeset} \alias{osm_diff_upload_changeset} \title{Diff (OsmChange format) upload to a changeset} diff --git a/man/osm_download_changeset.Rd b/man/osm_download_changeset.Rd index be46da4e..6f15e072 100644 --- a/man/osm_download_changeset.Rd +++ b/man/osm_download_changeset.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changesets.R +% Please edit documentation in R/osmapi_changesets.R \name{osm_download_changeset} \alias{osm_download_changeset} \title{Download a changeset in OsmChange format} diff --git a/man/osm_feed_notes.Rd b/man/osm_feed_notes.Rd index 51ea3434..53efa782 100644 --- a/man/osm_feed_notes.Rd +++ b/man/osm_feed_notes.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map_notes.R +% Please edit documentation in R/osmapi_map_notes.R \name{osm_feed_notes} \alias{osm_feed_notes} \title{RSS Feed of notes in a bbox} diff --git a/man/osm_fetch_objects.Rd b/man/osm_fetch_objects.Rd deleted file mode 100644 index 6506c080..00000000 --- a/man/osm_fetch_objects.Rd +++ /dev/null @@ -1,59 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R -\name{osm_fetch_objects} -\alias{osm_fetch_objects} -\title{Fetch objects} -\usage{ -osm_fetch_objects( - osm_type = c("nodes", "ways", "relations"), - osm_ids, - versions, - format = c("R", "xml", "json"), - tags_in_columns = FALSE -) -} -\arguments{ -\item{osm_type}{Type of the objects(\code{"nodes"}, \code{"ways"} or \code{"relations"}).} - -\item{osm_ids}{Object ids represented by a numeric or a character vector.} - -\item{versions}{Version numbers for each object may be optionally provided.} - -\item{format}{Format of the output. Can be \code{R} (default), \code{xml}, or \code{json}.} - -\item{tags_in_columns}{If \code{FALSE} (default), the tags of the objects are saved in a single list column \code{tags} -containing a \code{data.frame} for each OSM object with the keys and values. If \code{TRUE}, add a column for each key. -Ignored if \code{format != "R"}.} -} -\description{ -Fetch multiple objects of the same type at once. -} -\note{ -For downloading data for purposes other than editing or exploring the history of the objects, perhaps is better to -use the Overpass API. A similar function to download OSM objects by \code{type} and \code{id} using Overpass, is implemented in -\code{\link[osmdata:opq_osm_id]{osmdata::opq_osm_id()}}. -} -\examples{ -\dontrun{ -node <- osm_fetch_objects(osm_type = "nodes", osm_ids = c(35308286, 1935675367)) -node - -way <- osm_fetch_objects(osm_type = "ways", osm_ids = c(13073736L, 235744929L)) -way - -# Specific versions -rel <- osm_fetch_objects(osm_type = "relations", osm_ids = c("40581", "341530"), versions = c(3, 1)) -rel -} -} -\seealso{ -Other get OSM objects' functions: -\code{\link{osm_bbox_objects}()}, -\code{\link{osm_full_object}()}, -\code{\link{osm_history_object}()}, -\code{\link{osm_read_object}()}, -\code{\link{osm_relations_object}()}, -\code{\link{osm_version_object}()}, -\code{\link{osm_ways_node}()} -} -\concept{get OSM objects' functions} diff --git a/man/osm_full_object.Rd b/man/osm_full_object.Rd deleted file mode 100644 index 6dd05487..00000000 --- a/man/osm_full_object.Rd +++ /dev/null @@ -1,64 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R -\name{osm_full_object} -\alias{osm_full_object} -\title{Full object} -\usage{ -osm_full_object( - osm_type = c("way", "relation"), - osm_id, - format = c("R", "xml", "json"), - tags_in_columns = FALSE -) -} -\arguments{ -\item{osm_type}{Object type (\code{"way"} or \code{"relation"}).} - -\item{osm_id}{Object id represented by a numeric or a character value.} - -\item{format}{Format of the output. Can be \code{R} (default), \code{xml}, or \code{json}.} - -\item{tags_in_columns}{If \code{FALSE} (default), the tags of the objects are saved in a single list column \code{tags} -containing a \code{data.frame} for each OSM object with the keys and values. If \code{TRUE}, add a column for each key. -Ignored if \code{format != "R"}.} -} -\description{ -This API call retrieves a way or relation and all other objects referenced by it. -} -\details{ -For a way, it will return the way specified plus all nodes referenced by the way. -For a relation, it will return the following: -\itemize{ -\item The relation itself -\item All nodes, ways, and relations that are members of the relation -\item Plus all nodes used by ways from the previous step -\item The same recursive logic is not applied to relations. This means: If relation r1 contains way w1 and relation r2, -and w1 contains nodes n1 and n2, and r2 contains node n3, then a "full" request for r1 will give you r1, r2, w1, -n1, and n2. Not n3. -} -} -\note{ -For downloading data for purposes other than editing or exploring the history of the objects, perhaps is better to -use the Overpass API. A similar function to download OSM objects by \code{type} and \code{id} using Overpass, is implemented in -\code{\link[osmdata:opq_osm_id]{osmdata::opq_osm_id()}}. -} -\examples{ -\dontrun{ -way <- osm_full_object(osm_type = "way", osm_id = 13073736) -way - -rel <- osm_full_object(osm_type = "relation", osm_id = "40581") -rel -} -} -\seealso{ -Other get OSM objects' functions: -\code{\link{osm_bbox_objects}()}, -\code{\link{osm_fetch_objects}()}, -\code{\link{osm_history_object}()}, -\code{\link{osm_read_object}()}, -\code{\link{osm_relations_object}()}, -\code{\link{osm_version_object}()}, -\code{\link{osm_ways_node}()} -} -\concept{get OSM objects' functions} diff --git a/man/osm_get_data_gpx.Rd b/man/osm_get_data_gpx.Rd index 7e9826bc..b44e37ab 100644 --- a/man/osm_get_data_gpx.Rd +++ b/man/osm_get_data_gpx.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gps_traces.R +% Please edit documentation in R/osmapi_gps_traces.R \name{osm_get_data_gpx} \alias{osm_get_data_gpx} \title{Download GPS Track Data} diff --git a/man/osm_get_metadata_gpx.Rd b/man/osm_get_metadata_gpx.Rd index e47c9720..436e1f9c 100644 --- a/man/osm_get_metadata_gpx.Rd +++ b/man/osm_get_metadata_gpx.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gps_traces.R +% Please edit documentation in R/osmapi_gps_traces.R \name{osm_get_metadata_gpx} \alias{osm_get_metadata_gpx} \title{Download GPS Track Metadata} diff --git a/man/osm_get_objects.Rd b/man/osm_get_objects.Rd new file mode 100644 index 00000000..4b4cdf8d --- /dev/null +++ b/man/osm_get_objects.Rd @@ -0,0 +1,70 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/osm_get_objects.R +\name{osm_get_objects} +\alias{osm_get_objects} +\title{Get OSM objects} +\usage{ +osm_get_objects( + osm_type, + osm_id, + version, + full_objects = FALSE, + format = c("R", "xml", "json"), + tags_in_columns = FALSE +) +} +\arguments{ +\item{osm_type}{A vector with the type of the objects (\code{"node"}, \code{"way"} or \code{"relation"}). Recycled if it has a +different length than \code{osm_id}.} + +\item{osm_id}{Object ids represented by a numeric or a character vector.} + +\item{version}{An optional vector with the version number for each object. If missing, the last version will be +retrieved. Recycled if it has different length than \code{osm_id}.} + +\item{full_objects}{If \code{TRUE}, retrieves all other objects referenced by ways or relations. Not compatible with +\code{version}.} + +\item{format}{Format of the output. Can be \code{R} (default), \code{xml}, or \code{json}.} + +\item{tags_in_columns}{If \code{FALSE} (default), the tags of the objects are saved in a single list column \verb{tags``` containing a }data.frame\verb{for each OSM object with the keys and values. If}TRUE\verb{, add a column for each key. Ignored if }format != "R"`.} +} +\description{ +Retrieve objects by \code{type}, \code{id} and \code{version}. +} +\details{ +\code{full_objects = TRUE} does not support specifying \code{version}. +For ways, \code{full_objects = TRUE} implies that it will return the way specified plus all nodes referenced by the way. +For a relation, it will return the following: +\itemize{ +\item The relation itself +\item All nodes, ways, and relations that are members of the relation +\item Plus all nodes used by ways from the previous step +\item The same recursive logic is not applied to relations. This means: If relation r1 contains way w1 and relation r2, +and w1 contains nodes n1 and n2, and r2 contains node n3, then a "full" request for r1 will give you r1, r2, w1, +n1, and n2. Not n3. +} +} +\note{ +For downloading data for purposes other than editing or exploring the history of the objects, perhaps is better to +use the Overpass API. A similar function to download OSM objects by \code{type} and \code{id} using Overpass, is implemented in +\code{\link[osmdata:opq_osm_id]{osmdata::opq_osm_id()}}. +} +\examples{ +\dontrun{ +obj <- osm_get_objects( + osm_type = c("node", "way", "way", "relation", "relation", "node"), + osm_id = c("35308286", "13073736", "235744929", "40581", "341530", "1935675367"), + version = c(1, 3, 2, 5, 7, 1) +) +obj +} +} +\seealso{ +Other get OSM objects' functions: +\code{\link{osm_bbox_objects}()}, +\code{\link{osm_history_object}()}, +\code{\link{osm_relations_object}()}, +\code{\link{osm_ways_node}()} +} +\concept{get OSM objects' functions} diff --git a/man/osm_get_points_gps.Rd b/man/osm_get_points_gps.Rd index 8085eb47..35dbb09d 100644 --- a/man/osm_get_points_gps.Rd +++ b/man/osm_get_points_gps.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gps_traces.R +% Please edit documentation in R/osmapi_gps_traces.R \name{osm_get_points_gps} \alias{osm_get_points_gps} \title{Get GPS Points} diff --git a/man/osm_get_preferences_user.Rd b/man/osm_get_preferences_user.Rd index d4473eaf..45f8758d 100644 --- a/man/osm_get_preferences_user.Rd +++ b/man/osm_get_preferences_user.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/user_data.R +% Please edit documentation in R/osmapi_user_data.R \name{osm_get_preferences_user} \alias{osm_get_preferences_user} \title{Preferences of the logged-in user} @@ -23,7 +23,6 @@ prefs \seealso{ Other users' functions: \code{\link{osm_details_logged_user}()}, -\code{\link{osm_details_users}()}, -\code{\link{osm_details_user}()} +\code{\link{osm_get_user_details}()} } \concept{users' functions} diff --git a/man/osm_details_users.Rd b/man/osm_get_user_details.Rd similarity index 53% rename from man/osm_details_users.Rd rename to man/osm_get_user_details.Rd index 53082b45..85af80bc 100644 --- a/man/osm_details_users.Rd +++ b/man/osm_get_user_details.Rd @@ -1,19 +1,19 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/user_data.R -\name{osm_details_users} -\alias{osm_details_users} -\title{Details of multiple users} +% Please edit documentation in R/osm_get_user_details.R +\name{osm_get_user_details} +\alias{osm_get_user_details} +\title{Details of users} \usage{ -osm_details_users(user_ids, format = c("R", "xml", "json")) +osm_get_user_details(user_id, format = c("R", "xml", "json")) } \arguments{ -\item{user_ids}{The ids of the users to retrieve represented by a numeric or a character value (not the display -names).} +\item{user_id}{The ids of the users to retrieve the details for, represented by a numeric or a character value (not +the display names).} \item{format}{Format of the output. Can be \code{R} (default), \code{xml}, or \code{json}.} } \description{ -Details of multiple users +Details of users } \examples{ \dontrun{ @@ -24,7 +24,6 @@ usrs \seealso{ Other users' functions: \code{\link{osm_details_logged_user}()}, -\code{\link{osm_details_user}()}, \code{\link{osm_get_preferences_user}()} } \concept{users' functions} diff --git a/man/osm_hide_comment_changeset_discussion.Rd b/man/osm_hide_comment_changeset_discussion.Rd index 2f8c72f7..78fc98ba 100644 --- a/man/osm_hide_comment_changeset_discussion.Rd +++ b/man/osm_hide_comment_changeset_discussion.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changeset_discussion.R +% Please edit documentation in R/osmapi_changeset_discussion.R \name{osm_hide_comment_changeset_discussion} \alias{osm_hide_comment_changeset_discussion} \title{Hide changeset comment} diff --git a/man/osm_history_object.Rd b/man/osm_history_object.Rd index ef5d7df6..7979293e 100644 --- a/man/osm_history_object.Rd +++ b/man/osm_history_object.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R +% Please edit documentation in R/osmapi_elements.R \name{osm_history_object} \alias{osm_history_object} \title{Get the history of an object} @@ -40,11 +40,8 @@ rel \seealso{ Other get OSM objects' functions: \code{\link{osm_bbox_objects}()}, -\code{\link{osm_fetch_objects}()}, -\code{\link{osm_full_object}()}, -\code{\link{osm_read_object}()}, +\code{\link{osm_get_objects}()}, \code{\link{osm_relations_object}()}, -\code{\link{osm_version_object}()}, \code{\link{osm_ways_node}()} } \concept{get OSM objects' functions} diff --git a/man/osm_list_gpxs.Rd b/man/osm_list_gpxs.Rd index 68deedd0..5bddc1f5 100644 --- a/man/osm_list_gpxs.Rd +++ b/man/osm_list_gpxs.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gps_traces.R +% Please edit documentation in R/osmapi_gps_traces.R \name{osm_list_gpxs} \alias{osm_list_gpxs} \title{List user's GPX traces} diff --git a/man/osm_permissions.Rd b/man/osm_permissions.Rd index 99c19ae4..19884d21 100644 --- a/man/osm_permissions.Rd +++ b/man/osm_permissions.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/miscellaneous.R +% Please edit documentation in R/osmapi_miscellaneous.R \name{osm_permissions} \alias{osm_permissions} \title{Retrieving permissions} diff --git a/man/osm_query_changesets.Rd b/man/osm_query_changesets.Rd index d4642166..3aa54194 100644 --- a/man/osm_query_changesets.Rd +++ b/man/osm_query_changesets.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changesets.R +% Please edit documentation in R/osmapi_changesets.R \name{osm_query_changesets} \alias{osm_query_changesets} \title{Query changesets} diff --git a/man/osm_read_bbox_notes.Rd b/man/osm_read_bbox_notes.Rd index a8f61b83..8ea264a5 100644 --- a/man/osm_read_bbox_notes.Rd +++ b/man/osm_read_bbox_notes.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map_notes.R +% Please edit documentation in R/osmapi_map_notes.R \name{osm_read_bbox_notes} \alias{osm_read_bbox_notes} \title{Retrieve notes by bounding box} diff --git a/man/osm_read_changeset.Rd b/man/osm_read_changeset.Rd index 0c1c382b..714e98fe 100644 --- a/man/osm_read_changeset.Rd +++ b/man/osm_read_changeset.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changesets.R +% Please edit documentation in R/osmapi_changesets.R \name{osm_read_changeset} \alias{osm_read_changeset} \title{Read a changeset} diff --git a/man/osm_read_note.Rd b/man/osm_read_note.Rd index 088446aa..41d30d5b 100644 --- a/man/osm_read_note.Rd +++ b/man/osm_read_note.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map_notes.R +% Please edit documentation in R/osmapi_map_notes.R \name{osm_read_note} \alias{osm_read_note} \title{Read notes} diff --git a/man/osm_read_object.Rd b/man/osm_read_object.Rd deleted file mode 100644 index e9b2c7fe..00000000 --- a/man/osm_read_object.Rd +++ /dev/null @@ -1,50 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R -\name{osm_read_object} -\alias{osm_read_object} -\title{Read an object} -\usage{ -osm_read_object( - osm_type = c("node", "way", "relation"), - osm_id, - format = c("R", "xml", "json"), - tags_in_columns = FALSE -) -} -\arguments{ -\item{osm_type}{Object type (\code{"node"}, \code{"way"} or \code{"relation"}).} - -\item{osm_id}{Object id represented by a numeric or a character value.} - -\item{format}{Format of the output. Can be \code{R} (default), \code{xml}, or \code{json}.} - -\item{tags_in_columns}{If \code{FALSE} (default), the tags of the objects are saved in a single list column \code{tags} -containing a \code{data.frame} for each OSM object with the keys and values. If \code{TRUE}, add a column for each key. -Ignored if \code{format != "R"}.} -} -\description{ -Returns the representation of an object from OSM. -} -\examples{ -\dontrun{ -node <- osm_read_object(osm_type = "node", osm_id = 35308286) -node - -way <- osm_read_object(osm_type = "way", osm_id = 13073736L) -way - -rel <- osm_read_object(osm_type = "relation", osm_id = "40581") -rel -} -} -\seealso{ -Other get OSM objects' functions: -\code{\link{osm_bbox_objects}()}, -\code{\link{osm_fetch_objects}()}, -\code{\link{osm_full_object}()}, -\code{\link{osm_history_object}()}, -\code{\link{osm_relations_object}()}, -\code{\link{osm_version_object}()}, -\code{\link{osm_ways_node}()} -} -\concept{get OSM objects' functions} diff --git a/man/osm_redaction_object.Rd b/man/osm_redaction_object.Rd index b239c0da..c45a0791 100644 --- a/man/osm_redaction_object.Rd +++ b/man/osm_redaction_object.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R +% Please edit documentation in R/osmapi_elements.R \name{osm_redaction_object} \alias{osm_redaction_object} \title{Redact an object version} diff --git a/man/osm_relations_object.Rd b/man/osm_relations_object.Rd index e5e6a10c..24ec68d6 100644 --- a/man/osm_relations_object.Rd +++ b/man/osm_relations_object.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R +% Please edit documentation in R/osmapi_elements.R \name{osm_relations_object} \alias{osm_relations_object} \title{Relations of an object} @@ -38,11 +38,8 @@ rel \seealso{ Other get OSM objects' functions: \code{\link{osm_bbox_objects}()}, -\code{\link{osm_fetch_objects}()}, -\code{\link{osm_full_object}()}, +\code{\link{osm_get_objects}()}, \code{\link{osm_history_object}()}, -\code{\link{osm_read_object}()}, -\code{\link{osm_version_object}()}, \code{\link{osm_ways_node}()} } \concept{get OSM objects' functions} diff --git a/man/osm_reopen_note.Rd b/man/osm_reopen_note.Rd index a216552f..aa641dcf 100644 --- a/man/osm_reopen_note.Rd +++ b/man/osm_reopen_note.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map_notes.R +% Please edit documentation in R/osmapi_map_notes.R \name{osm_reopen_note} \alias{osm_reopen_note} \title{Reopen a note} diff --git a/man/osm_search_notes.Rd b/man/osm_search_notes.Rd index b7f6779d..2b2307d0 100644 --- a/man/osm_search_notes.Rd +++ b/man/osm_search_notes.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map_notes.R +% Please edit documentation in R/osmapi_map_notes.R \name{osm_search_notes} \alias{osm_search_notes} \title{Search for notes} diff --git a/man/osm_subscribe_changeset_discussion.Rd b/man/osm_subscribe_changeset_discussion.Rd index d56581c1..e0b5bbd6 100644 --- a/man/osm_subscribe_changeset_discussion.Rd +++ b/man/osm_subscribe_changeset_discussion.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changeset_discussion.R +% Please edit documentation in R/osmapi_changeset_discussion.R \name{osm_subscribe_changeset_discussion} \alias{osm_subscribe_changeset_discussion} \title{Subscribe to a changeset discussion} diff --git a/man/osm_unhide_comment_changeset_discussion.Rd b/man/osm_unhide_comment_changeset_discussion.Rd index b8b52f36..3cf9c9dc 100644 --- a/man/osm_unhide_comment_changeset_discussion.Rd +++ b/man/osm_unhide_comment_changeset_discussion.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changeset_discussion.R +% Please edit documentation in R/osmapi_changeset_discussion.R \name{osm_unhide_comment_changeset_discussion} \alias{osm_unhide_comment_changeset_discussion} \title{Unhide changeset comment} diff --git a/man/osm_unsubscribe_changeset_discussion.Rd b/man/osm_unsubscribe_changeset_discussion.Rd index ec2383fb..14f8d652 100644 --- a/man/osm_unsubscribe_changeset_discussion.Rd +++ b/man/osm_unsubscribe_changeset_discussion.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/changeset_discussion.R +% Please edit documentation in R/osmapi_changeset_discussion.R \name{osm_unsubscribe_changeset_discussion} \alias{osm_unsubscribe_changeset_discussion} \title{Unsubscribe from a changeset discussion} diff --git a/man/osm_update_gpx.Rd b/man/osm_update_gpx.Rd index 3357d40f..f1107f76 100644 --- a/man/osm_update_gpx.Rd +++ b/man/osm_update_gpx.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/gps_traces.R +% Please edit documentation in R/osmapi_gps_traces.R \name{osm_update_gpx} \alias{osm_update_gpx} \title{Update GPS trace} diff --git a/man/osm_update_object.Rd b/man/osm_update_object.Rd index f6855d68..8d388559 100644 --- a/man/osm_update_object.Rd +++ b/man/osm_update_object.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R +% Please edit documentation in R/osmapi_elements.R \name{osm_update_object} \alias{osm_update_object} \title{Update an OSM object} diff --git a/man/osm_version_object.Rd b/man/osm_version_object.Rd deleted file mode 100644 index 96bac5a4..00000000 --- a/man/osm_version_object.Rd +++ /dev/null @@ -1,53 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R -\name{osm_version_object} -\alias{osm_version_object} -\title{Get a version of an object} -\usage{ -osm_version_object( - osm_type = c("node", "way", "relation"), - osm_id, - version, - format = c("R", "xml", "json"), - tags_in_columns = FALSE -) -} -\arguments{ -\item{osm_type}{Object type (\code{"node"}, \code{"way"} or \code{"relation"}).} - -\item{osm_id}{Object id represented by a numeric or a character value.} - -\item{version}{Version of the object to retrieve.} - -\item{format}{Format of the output. Can be \code{R} (default), \code{xml}, or \code{json}.} - -\item{tags_in_columns}{If \code{FALSE} (default), the tags of the objects are saved in a single list column \code{tags} -containing a \code{data.frame} for each OSM object with the keys and values. If \code{TRUE}, add a column for each key. -Ignored if \code{format != "R"}.} -} -\description{ -Retrieves a specific version of an object from OSM. -} -\examples{ -\dontrun{ -node <- osm_version_object(osm_type = "node", osm_id = 35308286, version = 1) -node - -way <- osm_version_object(osm_type = "way", osm_id = 13073736L, version = 2) -way - -rel <- osm_version_object(osm_type = "relation", osm_id = "40581", version = 3) -rel -} -} -\seealso{ -Other get OSM objects' functions: -\code{\link{osm_bbox_objects}()}, -\code{\link{osm_fetch_objects}()}, -\code{\link{osm_full_object}()}, -\code{\link{osm_history_object}()}, -\code{\link{osm_read_object}()}, -\code{\link{osm_relations_object}()}, -\code{\link{osm_ways_node}()} -} -\concept{get OSM objects' functions} diff --git a/man/osm_ways_node.Rd b/man/osm_ways_node.Rd index 7437b321..40ed59fd 100644 --- a/man/osm_ways_node.Rd +++ b/man/osm_ways_node.Rd @@ -1,5 +1,5 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/elements.R +% Please edit documentation in R/osmapi_elements.R \name{osm_ways_node} \alias{osm_ways_node} \title{Ways of a node} @@ -25,11 +25,8 @@ ways_node \seealso{ Other get OSM objects' functions: \code{\link{osm_bbox_objects}()}, -\code{\link{osm_fetch_objects}()}, -\code{\link{osm_full_object}()}, +\code{\link{osm_get_objects}()}, \code{\link{osm_history_object}()}, -\code{\link{osm_read_object}()}, -\code{\link{osm_relations_object}()}, -\code{\link{osm_version_object}()} +\code{\link{osm_relations_object}()} } \concept{get OSM objects' functions} diff --git a/man/osmchange_modify.Rd b/man/osmchange_modify.Rd index d7a4e685..39930735 100644 --- a/man/osmchange_modify.Rd +++ b/man/osmchange_modify.Rd @@ -24,7 +24,7 @@ Update tags, members and/or latitude and longitude. \details{ \code{x} should follow the format of \code{osmapi_objects} with tags in wide format or a \code{tags} column with a list of data.frames with \code{key} and \code{value} columns. Missing tags or tags with \code{NA} in the value will be removed. See -\code{\link[=osm_read_object]{osm_read_object()}} for examples of the format. +\code{\link[=osm_get_objects]{osm_get_objects()}} for examples of the format. } \seealso{ Other OsmChange's functions: diff --git a/man/tags_list-wide.Rd b/man/tags_list-wide.Rd index 651bf4ae..798122a5 100644 --- a/man/tags_list-wide.Rd +++ b/man/tags_list-wide.Rd @@ -10,7 +10,7 @@ tags_list2wide(x) tags_wide2list(x) } \arguments{ -\item{x}{An \code{osmapi_objects} or \code{osmapi_changesets} objects as returned by, for example, \code{\link[=osm_read_object]{osm_read_object()}} or +\item{x}{An \code{osmapi_objects} or \code{osmapi_changesets} objects as returned by, for example, \code{\link[=osm_get_objects]{osm_get_objects()}} or \code{\link[=osm_read_changeset]{osm_read_changeset()}}.} } \description{ diff --git a/tests/testthat/mock_details_user/osm.org/api/0.6/user/11725140.xml b/tests/testthat/mock_details_user/osm.org/api/0.6/user/11725140.xml index 205d5113..6d325584 100644 --- a/tests/testthat/mock_details_user/osm.org/api/0.6/user/11725140.xml +++ b/tests/testthat/mock_details_user/osm.org/api/0.6/user/11725140.xml @@ -1,11 +1,12 @@ - + [Fòrums d'OSM](https://community.openstreetmap.org/u/jmaspons) - [Wiki d'OSM](https://wiki.openstreetmap.org/wiki/User:Jmaspons) - [OSM help](https://help.openstreetmap.org/users/23509/jmaspons) + - + diff --git a/tests/testthat/mock_details_users/osm.org/api/0.6/users-c7389c.xml b/tests/testthat/mock_details_user/osm.org/api/0.6/user/61942.xml similarity index 73% rename from tests/testthat/mock_details_users/osm.org/api/0.6/users-c7389c.xml rename to tests/testthat/mock_details_user/osm.org/api/0.6/user/61942.xml index c5dc3738..50dcc0ff 100644 --- a/tests/testthat/mock_details_users/osm.org/api/0.6/users-c7389c.xml +++ b/tests/testthat/mock_details_user/osm.org/api/0.6/user/61942.xml @@ -7,20 +7,20 @@ I mainly map footpaths and other out-of-town things. Also see related profile o There are some bits and pieces (including [two](https://github.com/SomeoneElseOSM/SomeoneElse-style) [parts](https://github.com/SomeoneElseOSM/openstreetmap-carto-AJT) of an OSM-Carto-derived rendering style designed for out-of-town England and Wales) over at [Github](https://github.com/SomeoneElseOSM) that look like [this](https://map.atownsend.org.uk/maps/map/map.html). There are some wiki pages behind [here](https://wiki.openstreetmap.org/wiki/User:SomeoneElse) (mostly to do with tileserver setup). -I'm a member of the [Data Working Group](http://wiki.openstreetmap.org/wiki/Data_working_group) (that's what the blue star above means), but if you've you've got any issues to raise with the DWG the [group email address](http://wiki.osmfoundation.org/wiki/Data_Working_Group#Contact) is the best one to use. +I'm a member of the [Data Working Group](http://wiki.openstreetmap.org/wiki/Data_working_group) (that's what the blue star above means), but if you've got any issues to raise with the DWG the [group email address](http://wiki.osmfoundation.org/wiki/Data_Working_Group#Contact) is the best one to use. Other related accounts are [SomeoneElse2](http://www.openstreetmap.org/user/SomeoneElse2). [SomeoneElseSC](https://www.openstreetmap.org/user/SomeoneElseSC) and [SomeoneElse_Revert](http://www.openstreetmap.org/user/SomeoneElse_Revert), which is mainly used where people have requested that I help with reversions. - +The "User id" of this account is "61942". I mention that because there have been a few attempts over the years to impersonate DWG members, including me, using names such as "SomeoneEIse" (with a capital "i" instead of a lower case "l") and others with various UTF-8 versions of characters that look similar to, but are not, regular ascii characters. - - + + - + diff --git a/tests/testthat/mock_details_users/osm.org/api/0.6/users-48e738.xml b/tests/testthat/mock_details_users/osm.org/api/0.6/users-48e738.xml new file mode 100644 index 00000000..aa2c07c4 --- /dev/null +++ b/tests/testthat/mock_details_users/osm.org/api/0.6/users-48e738.xml @@ -0,0 +1,53 @@ + + + + I live near York (UK), though I do occasionally [venture further afield](http://yosmhm.neis-one.org/?zoom=6&lat=53.08324&lon=-2.42578&layers=B000TTF&u=SomeoneElse). +I mainly map footpaths and other out-of-town things. Also see related profile on +<a rel="me" href="https://en.osm.town/@SomeoneElse">Mastodon</a>. + +There are some bits and pieces (including [two](https://github.com/SomeoneElseOSM/SomeoneElse-style) [parts](https://github.com/SomeoneElseOSM/openstreetmap-carto-AJT) of an OSM-Carto-derived rendering style designed for out-of-town England and Wales) over at [Github](https://github.com/SomeoneElseOSM) that look like [this](https://map.atownsend.org.uk/maps/map/map.html). There are some wiki pages behind [here](https://wiki.openstreetmap.org/wiki/User:SomeoneElse) (mostly to do with tileserver setup). + +I'm a member of the [Data Working Group](http://wiki.openstreetmap.org/wiki/Data_working_group) (that's what the blue star above means), but if you've got any issues to raise with the DWG the [group email address](http://wiki.osmfoundation.org/wiki/Data_Working_Group#Contact) is the best one to use. + +Other related accounts are [SomeoneElse2](http://www.openstreetmap.org/user/SomeoneElse2). [SomeoneElseSC](https://www.openstreetmap.org/user/SomeoneElseSC) and [SomeoneElse_Revert](http://www.openstreetmap.org/user/SomeoneElse_Revert), which is mainly used where people have requested that I help with reversions. + +The "User id" of this account is "61942". I mention that because there have been a few attempts over the years to impersonate DWG members, including me, using names such as "SomeoneEIse" (with a capital "i" instead of a lower case "l") and others with various UTF-8 versions of characters that look similar to, but are not, regular ascii characters. + + + + + + + + + + + + + Занимаюсь Тюменской областью (Россия). Родной город – Заводоуковск. Также эта учётная запись была использована рабочей группой по данным (например, для откатов пакетов правок). +Je mappe Oblast de Tioumen (Russie). Ma ville natale est Zavodooukovsk. Aussi ce compte d'utilisateur été utilisé par le Data Working Group (par exemple, pour les retours des groupes des modifications). +I map Tyumen Oblast (Russia). My native town is Zavodoukovsk. Also this account was used by Data Working Group (for example, the reverts of the changesets). +============================================================= +*Забытые страницы сайта:* + +https://www.openstreetmap.org/fixthemap +https://www.openstreetmap.org/user_blocks +https://www.openstreetmap.org/redactions + +*Некоторые настройки сервера:* + +https://www.openstreetmap.org/api/versions +https://www.openstreetmap.org/api/capabilities + + + + + + + + + + + + + diff --git a/tests/testthat/mock_details_users/osm.org/api/0.6/users-ea3712.xml b/tests/testthat/mock_details_users/osm.org/api/0.6/users-ea3712.xml index 9b994166..0c2546f5 100644 --- a/tests/testthat/mock_details_users/osm.org/api/0.6/users-ea3712.xml +++ b/tests/testthat/mock_details_users/osm.org/api/0.6/users-ea3712.xml @@ -5,7 +5,7 @@ - + @@ -16,7 +16,7 @@ - + @@ -54,7 +54,7 @@ mm-&lt;date&gt;-mtk.gpx - maemo mapper + BT-Q1000 (MTK Chip) - + diff --git a/tests/testthat/mock_full_object/osm.org/api/0.6/nodes-41cde1.xml b/tests/testthat/mock_full_object/osm.org/api/0.6/nodes-41cde1.xml new file mode 100644 index 00000000..345f2961 --- /dev/null +++ b/tests/testthat/mock_full_object/osm.org/api/0.6/nodes-41cde1.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/tests/testthat/mock_full_object/osm.org/api/0.6/way/235744929/full.xml b/tests/testthat/mock_full_object/osm.org/api/0.6/way/235744929/full.xml new file mode 100644 index 00000000..9ee9e049 --- /dev/null +++ b/tests/testthat/mock_full_object/osm.org/api/0.6/way/235744929/full.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/testthat/mock_full_object_json/osm.org/api/0.6/nodes.json-41cde1.json b/tests/testthat/mock_full_object_json/osm.org/api/0.6/nodes.json-41cde1.json new file mode 100644 index 00000000..df13745f --- /dev/null +++ b/tests/testthat/mock_full_object_json/osm.org/api/0.6/nodes.json-41cde1.json @@ -0,0 +1,29 @@ +{ + "version": "0.6", + "generator": "CGImap 0.8.10 (012345 ******.openstreetmap.org)", + "copyright": "OpenStreetMap and contributors", + "attribution": "http://www.openstreetmap.org/copyright", + "license": "http://opendatacommons.org/licenses/odbl/1-0/", + "elements": [ + { + "type": "node", + "id": 35308286, + "lat": 42.5189047, + "lon": 2.4565596, + "timestamp": "2023-08-24T20:19:22Z", + "version": 17, + "changeset": 140341361, + "user": "jmaspons", + "uid": 11725140, + "tags": { + "ele": "2784.66", + "name": "Pic du Canigou", + "name:ca": "Pic del Canigó", + "natural": "peak", + "prominence": "550", + "summit:cross": "yes", + "summit:register": "no" + } + } + ] +} diff --git a/tests/testthat/mock_full_object_json/osm.org/api/0.6/relation/6002785/full.json.json b/tests/testthat/mock_full_object_json/osm.org/api/0.6/relation/6002785/full.json.json new file mode 100644 index 00000000..69d09285 --- /dev/null +++ b/tests/testthat/mock_full_object_json/osm.org/api/0.6/relation/6002785/full.json.json @@ -0,0 +1,814 @@ +{ + "version": "0.6", + "generator": "CGImap 0.8.10 (012345 ******.openstreetmap.org)", + "copyright": "OpenStreetMap and contributors", + "attribution": "http://www.openstreetmap.org/copyright", + "license": "http://opendatacommons.org/licenses/odbl/1-0/", + "elements": [ + { + "type": "node", + "id": 1987589881, + "lat": 42.3229954, + "lon": 3.1666430, + "timestamp": "2012-10-28T20:10:51Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589883, + "lat": 42.3230133, + "lon": 3.1667173, + "timestamp": "2012-10-28T20:10:51Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589884, + "lat": 42.3230151, + "lon": 3.1665900, + "timestamp": "2012-10-28T20:10:51Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589885, + "lat": 42.3230247, + "lon": 3.1666301, + "timestamp": "2012-10-28T20:10:51Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589889, + "lat": 42.3231233, + "lon": 3.1664855, + "timestamp": "2012-10-28T20:10:51Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589892, + "lat": 42.3231325, + "lon": 3.1663394, + "timestamp": "2012-10-28T20:10:51Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589893, + "lat": 42.3231357, + "lon": 3.1665367, + "timestamp": "2012-10-28T20:10:51Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589897, + "lat": 42.3231635, + "lon": 3.1664677, + "timestamp": "2012-10-28T20:10:52Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589898, + "lat": 42.3231718, + "lon": 3.1666472, + "timestamp": "2012-10-28T20:10:52Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589905, + "lat": 42.3232138, + "lon": 3.1668208, + "timestamp": "2012-10-28T20:10:52Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589916, + "lat": 42.3233439, + "lon": 3.1661016, + "timestamp": "2012-10-28T20:10:53Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589921, + "lat": 42.3233850, + "lon": 3.1662278, + "timestamp": "2012-10-28T20:10:53Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589933, + "lat": 42.3234704, + "lon": 3.1660394, + "timestamp": "2012-10-28T20:10:53Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589935, + "lat": 42.3234977, + "lon": 3.1666206, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589936, + "lat": 42.3235105, + "lon": 3.1666418, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589937, + "lat": 42.3235115, + "lon": 3.1666892, + "timestamp": "2012-10-28T20:10:53Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589939, + "lat": 42.3235273, + "lon": 3.1666569, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589943, + "lat": 42.3235423, + "lon": 3.1662378, + "timestamp": "2012-10-28T20:10:54Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589944, + "lat": 42.3235467, + "lon": 3.1666646, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589947, + "lat": 42.3235669, + "lon": 3.1666642, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589948, + "lat": 42.3235861, + "lon": 3.1666558, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589951, + "lat": 42.3236026, + "lon": 3.1666400, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589952, + "lat": 42.3236056, + "lon": 3.1661989, + "timestamp": "2012-10-28T20:10:54Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589954, + "lat": 42.3236149, + "lon": 3.1666184, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589955, + "lat": 42.3236182, + "lon": 3.1665392, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589957, + "lat": 42.3236220, + "lon": 3.1665928, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589959, + "lat": 42.3236231, + "lon": 3.1665656, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589963, + "lat": 42.3236310, + "lon": 3.1665463, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589964, + "lat": 42.3236449, + "lon": 3.1665461, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589969, + "lat": 42.3236576, + "lon": 3.1665386, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589970, + "lat": 42.3236551, + "lon": 3.1664593, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589971, + "lat": 42.3236671, + "lon": 3.1665250, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589973, + "lat": 42.3236720, + "lon": 3.1665074, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589974, + "lat": 42.3236655, + "lon": 3.1664718, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589975, + "lat": 42.3236714, + "lon": 3.1664887, + "timestamp": "2016-02-24T07:36:48Z", + "version": 2, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 1987589979, + "lat": 42.3236933, + "lon": 3.1664322, + "timestamp": "2012-10-28T20:10:55Z", + "version": 1, + "changeset": 13666675, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138933, + "lat": 42.3232726, + "lon": 3.1664407, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138934, + "lat": 42.3233105, + "lon": 3.1666218, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138935, + "lat": 42.3233486, + "lon": 3.1664116, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138936, + "lat": 42.3233865, + "lon": 3.1665927, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138937, + "lat": 42.3235035, + "lon": 3.1666319, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138938, + "lat": 42.3235185, + "lon": 3.1666502, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138939, + "lat": 42.3235368, + "lon": 3.1666617, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138940, + "lat": 42.3235568, + "lon": 3.1666654, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138941, + "lat": 42.3235767, + "lon": 3.1666609, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138942, + "lat": 42.3235947, + "lon": 3.1666487, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138943, + "lat": 42.3236093, + "lon": 3.1666298, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138944, + "lat": 42.3236191, + "lon": 3.1666060, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138945, + "lat": 42.3236214, + "lon": 3.1665521, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138946, + "lat": 42.3236233, + "lon": 3.1665793, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138947, + "lat": 42.3236244, + "lon": 3.1665436, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138948, + "lat": 42.3236380, + "lon": 3.1665471, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138949, + "lat": 42.3236515, + "lon": 3.1665432, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138950, + "lat": 42.3236608, + "lon": 3.1664648, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138951, + "lat": 42.3236629, + "lon": 3.1665324, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138952, + "lat": 42.3236691, + "lon": 3.1664798, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138953, + "lat": 42.3236702, + "lon": 3.1665165, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 4023138954, + "lat": 42.3236724, + "lon": 3.1664980, + "timestamp": "2016-02-24T07:36:47Z", + "version": 1, + "changeset": 37406198, + "user": "EliziR", + "uid": 605366 + }, + { + "type": "node", + "id": 9042634094, + "lat": 42.3232736, + "lon": 3.1662770, + "timestamp": "2021-08-28T10:35:49Z", + "version": 1, + "changeset": 110374887, + "user": "Xevi", + "uid": 100124, + "tags": { + "entrance": "yes" + } + }, + { + "type": "node", + "id": 9042634095, + "lat": 42.3231531, + "lon": 3.1664245, + "timestamp": "2021-08-28T10:35:49Z", + "version": 1, + "changeset": 110374887, + "user": "Xevi", + "uid": 100124, + "tags": { + "entrance": "yes" + } + }, + { + "type": "node", + "id": 9042634109, + "lat": 42.3234134, + "lon": 3.1660674, + "timestamp": "2021-08-28T10:35:49Z", + "version": 1, + "changeset": 110374887, + "user": "Xevi", + "uid": 100124, + "tags": { + "entrance": "main" + } + }, + { + "type": "way", + "id": 188131984, + "timestamp": "2021-08-28T10:35:49Z", + "version": 4, + "changeset": 110374887, + "user": "Xevi", + "uid": 100124, + "nodes": [ + 1987589955, + 4023138947, + 1987589963, + 4023138948, + 1987589964, + 4023138949, + 1987589969, + 4023138951, + 1987589971, + 4023138953, + 1987589973, + 4023138954, + 1987589975, + 4023138952, + 1987589974, + 4023138950, + 1987589970, + 1987589979, + 1987589952, + 1987589943, + 1987589933, + 9042634109, + 1987589916, + 1987589921, + 9042634094, + 1987589892, + 9042634095, + 1987589897, + 1987589889, + 1987589893, + 1987589884, + 1987589885, + 1987589881, + 1987589883, + 1987589898, + 1987589905, + 1987589937, + 1987589935, + 4023138937, + 1987589936, + 4023138938, + 1987589939, + 4023138939, + 1987589944, + 4023138940, + 1987589947, + 4023138941, + 1987589948, + 4023138942, + 1987589951, + 4023138943, + 1987589954, + 4023138944, + 1987589957, + 4023138946, + 1987589959, + 4023138945, + 1987589955 + ] + }, + { + "type": "way", + "id": 399588560, + "timestamp": "2022-12-11T21:22:32Z", + "version": 3, + "changeset": 129976247, + "user": "jmaspons", + "uid": 11725140, + "nodes": [ + 4023138936, + 4023138934, + 4023138933, + 4023138935, + 4023138936 + ], + "tags": { + "leisure": "garden", + "name": "Claustre", + "name:ca": "Claustre" + } + }, + { + "type": "relation", + "id": 6002785, + "timestamp": "2021-12-23T15:52:41Z", + "version": 6, + "changeset": 115301929, + "user": "jmaspons", + "uid": 11725140, + "members": [ + { + "type": "way", + "ref": 188131984, + "role": "outer" + }, + { + "type": "way", + "ref": 399588560, + "role": "inner" + } + ], + "tags": { + "amenity": "place_of_worship", + "building": "yes", + "denomination": "catholic", + "historic": "monastery", + "internet_access": "wlan", + "name": "Monestir de Sant Pere de Rodes", + "name:ca": "Monestir de Sant Pere de Rodes", + "religion": "christian", + "tourism": "attraction", + "type": "multipolygon", + "wikidata": "Q798606", + "wikipedia": "ca:Sant Pere de Rodes" + } + } + ] +} diff --git a/tests/testthat/mock_full_object_json/osm.org/api/0.6/way/13073736/full.json.json b/tests/testthat/mock_full_object_json/osm.org/api/0.6/way/13073736/full.json.json new file mode 100644 index 00000000..7522caf2 --- /dev/null +++ b/tests/testthat/mock_full_object_json/osm.org/api/0.6/way/13073736/full.json.json @@ -0,0 +1,767 @@ +{ + "version": "0.6", + "generator": "CGImap 0.8.10 (012345 ******.openstreetmap.org)", + "copyright": "OpenStreetMap and contributors", + "attribution": "http://www.openstreetmap.org/copyright", + "license": "http://opendatacommons.org/licenses/odbl/1-0/", + "elements": [ + { + "type": "node", + "id": 4856486143, + "lat": 39.4760324, + "lon": -0.3838247, + "timestamp": "2020-06-11T21:02:34Z", + "version": 2, + "changeset": 86534163, + "user": "MikelCalo", + "uid": 11126976 + }, + { + "type": "node", + "id": 4902243087, + "lat": 39.4762336, + "lon": -0.3837994, + "timestamp": "2019-11-08T13:10:11Z", + "version": 3, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 4902243088, + "lat": 39.4762362, + "lon": -0.3838279, + "timestamp": "2019-11-08T13:10:11Z", + "version": 3, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6771540792, + "lat": 39.4757710, + "lon": -0.3837962, + "timestamp": "2019-11-22T22:35:38Z", + "version": 2, + "changeset": 77447443, + "user": "Georg_M_Weber", + "uid": 10241965 + }, + { + "type": "node", + "id": 6771540793, + "lat": 39.4757529, + "lon": -0.3839320, + "timestamp": "2019-11-22T22:35:38Z", + "version": 2, + "changeset": 77447443, + "user": "Georg_M_Weber", + "uid": 10241965 + }, + { + "type": "node", + "id": 6771540804, + "lat": 39.4759211, + "lon": -0.3839627, + "timestamp": "2019-11-08T13:10:11Z", + "version": 2, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6771540805, + "lat": 39.4759415, + "lon": -0.3839663, + "timestamp": "2019-11-08T13:10:11Z", + "version": 2, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6771540806, + "lat": 39.4759429, + "lon": -0.3839482, + "timestamp": "2019-11-08T13:10:11Z", + "version": 2, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6771540812, + "lat": 39.4759107, + "lon": -0.3839952, + "timestamp": "2019-11-08T13:10:11Z", + "version": 2, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6790061967, + "lat": 39.4759295, + "lon": -0.3838642, + "timestamp": "2019-11-08T13:10:11Z", + "version": 2, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604940, + "lat": 39.4756556, + "lon": -0.3838435, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912, + "tags": { + "entrance": "yes" + } + }, + { + "type": "node", + "id": 6957604941, + "lat": 39.4758753, + "lon": -0.3838351, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912, + "tags": { + "entrance": "yes" + } + }, + { + "type": "node", + "id": 6957604951, + "lat": 39.4755912, + "lon": -0.3838750, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604952, + "lat": 39.4759225, + "lon": -0.3839451, + "timestamp": "2019-11-22T22:35:38Z", + "version": 2, + "changeset": 77447443, + "user": "Georg_M_Weber", + "uid": 10241965 + }, + { + "type": "node", + "id": 6957604954, + "lat": 39.4758125, + "lon": -0.3838357, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604955, + "lat": 39.4755967, + "lon": -0.3838455, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604959, + "lat": 39.4755836, + "lon": -0.3839789, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604960, + "lat": 39.4757046, + "lon": -0.3839958, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604961, + "lat": 39.4756574, + "lon": -0.3840390, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604962, + "lat": 39.4758791, + "lon": -0.3840280, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604963, + "lat": 39.4757087, + "lon": -0.3839836, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604964, + "lat": 39.4758031, + "lon": -0.3839996, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604965, + "lat": 39.4756803, + "lon": -0.3840288, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604966, + "lat": 39.4756202, + "lon": -0.3840332, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604967, + "lat": 39.4757196, + "lon": -0.3838412, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604968, + "lat": 39.4759713, + "lon": -0.3838621, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604969, + "lat": 39.4759036, + "lon": -0.3840060, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604972, + "lat": 39.4759330, + "lon": -0.3838343, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604973, + "lat": 39.4758114, + "lon": -0.3840119, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604974, + "lat": 39.4756003, + "lon": -0.3840164, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604975, + "lat": 39.4755807, + "lon": -0.3839573, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604977, + "lat": 39.4756984, + "lon": -0.3840076, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604979, + "lat": 39.4756322, + "lon": -0.3840382, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604980, + "lat": 39.4757118, + "lon": -0.3839693, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604981, + "lat": 39.4756695, + "lon": -0.3840350, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604982, + "lat": 39.4757140, + "lon": -0.3839557, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604983, + "lat": 39.4756899, + "lon": -0.3840195, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957604984, + "lat": 39.4759704, + "lon": -0.3838325, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611385, + "lat": 39.4756442, + "lon": -0.3840402, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611387, + "lat": 39.4757906, + "lon": -0.3839351, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611388, + "lat": 39.4756105, + "lon": -0.3840266, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611389, + "lat": 39.4758740, + "lon": -0.3840303, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611391, + "lat": 39.4755913, + "lon": -0.3840016, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611392, + "lat": 39.4759266, + "lon": -0.3838346, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611397, + "lat": 39.4757154, + "lon": -0.3839416, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611399, + "lat": 39.4757157, + "lon": -0.3839290, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611401, + "lat": 39.4758241, + "lon": -0.3840238, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611402, + "lat": 39.4757905, + "lon": -0.3839518, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611404, + "lat": 39.4757286, + "lon": -0.3837929, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611405, + "lat": 39.4758927, + "lon": -0.3840178, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611406, + "lat": 39.4757954, + "lon": -0.3839814, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611407, + "lat": 39.4755879, + "lon": -0.3838926, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611408, + "lat": 39.4758357, + "lon": -0.3840299, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611410, + "lat": 39.4758510, + "lon": -0.3840329, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611412, + "lat": 39.4757897, + "lon": -0.3839350, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611414, + "lat": 39.4757920, + "lon": -0.3839677, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611416, + "lat": 39.4759168, + "lon": -0.3839802, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611417, + "lat": 39.4757672, + "lon": -0.3839332, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912, + "tags": { + "addr:housenumber": "90", + "addr:postcode": "46001", + "addr:street": "Carrer de Guillem de Castro", + "entrance": "yes" + } + }, + { + "type": "node", + "id": 6957611418, + "lat": 39.4758625, + "lon": -0.3840327, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "node", + "id": 6957611421, + "lat": 39.4758168, + "lon": -0.3837998, + "timestamp": "2019-11-08T13:10:11Z", + "version": 1, + "changeset": 76811325, + "user": "editemapes_imports", + "uid": 10063912 + }, + { + "type": "way", + "id": 13073736, + "timestamp": "2023-08-22T01:47:19Z", + "version": 27, + "changeset": 140205821, + "user": "SomeoneElse_Revert", + "uid": 1778799, + "nodes": [ + 6771540804, + 6771540805, + 6771540806, + 6957604952, + 6790061967, + 6957604968, + 4902243088, + 4902243087, + 4856486143, + 6957604984, + 6957604972, + 6957611392, + 6957604941, + 6957604954, + 6957611421, + 6771540792, + 6957611404, + 6957604967, + 6957604940, + 6957604955, + 6957604951, + 6957611407, + 6957604975, + 6957604959, + 6957611391, + 6957604974, + 6957611388, + 6957604966, + 6957604979, + 6957611385, + 6957604961, + 6957604981, + 6957604965, + 6957604983, + 6957604977, + 6957604960, + 6957604963, + 6957604980, + 6957604982, + 6957611397, + 6957611399, + 6771540793, + 6957611417, + 6957611412, + 6957611387, + 6957611402, + 6957611414, + 6957611406, + 6957604964, + 6957604973, + 6957611401, + 6957611408, + 6957611410, + 6957611418, + 6957611389, + 6957604962, + 6957611405, + 6957604969, + 6771540812, + 6957611416, + 6771540804 + ], + "tags": { + "alt_name:ca": "Torres de Quart", + "building": "tower", + "building:levels": "4", + "building:material": "stone", + "height": "34", + "historic": "city_gate", + "name": "Torres de Quart", + "name:ca": "Torres de Quart", + "name:es": "Porta de Quart", + "name:ru": "Башни Куарта", + "wikidata": "Q2343754", + "wikipedia": "ca:Porta de Quart" + } + } + ] +} diff --git a/tests/testthat/mock_full_object_json/osm.org/api/0.6/way/235744929/full.json.json b/tests/testthat/mock_full_object_json/osm.org/api/0.6/way/235744929/full.json.json new file mode 100644 index 00000000..f9a69bea --- /dev/null +++ b/tests/testthat/mock_full_object_json/osm.org/api/0.6/way/235744929/full.json.json @@ -0,0 +1,80 @@ +{ + "version": "0.6", + "generator": "CGImap 0.8.10 (012345 ******.openstreetmap.org)", + "copyright": "OpenStreetMap and contributors", + "attribution": "http://www.openstreetmap.org/copyright", + "license": "http://opendatacommons.org/licenses/odbl/1-0/", + "elements": [ + { + "type": "node", + "id": 2438033107, + "lat": 41.3838674, + "lon": 2.1824148, + "timestamp": "2016-03-12T21:57:59Z", + "version": 2, + "changeset": 37791155, + "user": "Jose Antonio Fontaneda", + "uid": 2130444 + }, + { + "type": "node", + "id": 2438033109, + "lat": 41.3836273, + "lon": 2.1822465, + "timestamp": "2016-03-12T21:57:59Z", + "version": 2, + "changeset": 37791155, + "user": "Jose Antonio Fontaneda", + "uid": 2130444 + }, + { + "type": "node", + "id": 2992282983, + "lat": 41.3836295, + "lon": 2.1822400, + "timestamp": "2016-03-12T21:58:00Z", + "version": 2, + "changeset": 37791155, + "user": "Jose Antonio Fontaneda", + "uid": 2130444 + }, + { + "type": "node", + "id": 2992282984, + "lat": 41.3838706, + "lon": 2.1824067, + "timestamp": "2016-03-12T21:58:00Z", + "version": 2, + "changeset": 37791155, + "user": "Jose Antonio Fontaneda", + "uid": 2130444 + }, + { + "type": "way", + "id": 235744929, + "timestamp": "2021-12-24T03:46:41Z", + "version": 7, + "changeset": 115317958, + "user": "jmaspons", + "uid": 11725140, + "nodes": [ + 2438033107, + 2438033109, + 2992282983, + 2992282984, + 2438033107 + ], + "tags": { + "architect": "Carme Fiol", + "barrier": "wall", + "historic": "memorial", + "inscription": "Al fossar de les moreres no s'hi enterra cap traïdor;fins perdent nostres banderes serà l'urna de l'honor.", + "name": "Fossar de les Moreres", + "name:ca": "Fossar de les Moreres", + "start_date": "1989", + "wikidata": "Q2749521", + "wikipedia": "ca:Fossar de les Moreres" + } + } + ] +} diff --git a/tests/testthat/test-elements.R b/tests/testthat/test-elements.R index 969e84f3..c36da65f 100644 --- a/tests/testthat/test-elements.R +++ b/tests/testthat/test-elements.R @@ -14,9 +14,9 @@ class_columns <- list( test_that("osm_read_object works", { read <- list() with_mock_dir("mock_read_object", { - read$node <- osm_read_object(osm_type = "node", osm_id = 35308286) - read$way <- osm_read_object(osm_type = "way", osm_id = 13073736L) - read$rel <- osm_read_object(osm_type = "relation", osm_id = "40581") + read$node <- osm_get_objects(osm_type = "node", osm_id = 35308286) + read$way <- osm_get_objects(osm_type = "way", osm_id = 13073736L) + read$rel <- osm_get_objects(osm_type = "relation", osm_id = "40581") }) lapply(read, expect_s3_class, c("osmapi_objects", "data.frame")) @@ -147,9 +147,9 @@ test_that("osm_history_object works", { test_that("osm_version_object works", { version <- list() with_mock_dir("mock_version_object", { - version$node <- osm_version_object(osm_type = "node", osm_id = 35308286, version = 1) - version$way <- osm_version_object(osm_type = "way", osm_id = 13073736L, version = 2) - version$rel <- osm_version_object(osm_type = "relation", osm_id = "40581", version = 3) + version$node <- osm_get_objects(osm_type = "node", osm_id = 35308286, version = 1) + version$way <- osm_get_objects(osm_type = "way", osm_id = 13073736L, version = 2) + version$rel <- osm_get_objects(osm_type = "relation", osm_id = "40581", version = 3) }) lapply(version, expect_s3_class, c("osmapi_objects", "data.frame")) @@ -174,16 +174,16 @@ test_that("osm_fetch_objects works", { fetch <- list() fetch_xml <- list() with_mock_dir("mock_fetch_objects", { - fetch$node <- osm_fetch_objects(osm_type = "nodes", osm_ids = c(35308286, 1935675367)) - fetch$way <- osm_fetch_objects(osm_type = "ways", osm_ids = c(13073736L, 235744929L)) + fetch$node <- osm_get_objects(osm_type = "node", osm_id = c(35308286, 1935675367)) + fetch$way <- osm_get_objects(osm_type = "way", osm_id = c(13073736L, 235744929L)) # Specific versions - fetch$rel <- osm_fetch_objects(osm_type = "relations", osm_ids = c("40581", "341530"), versions = c(3, 1)) + fetch$rel <- osm_get_objects(osm_type = "relation", osm_id = c("40581", "341530"), version = c(3, 1)) - fetch_xml$node <- osm_fetch_objects(osm_type = "nodes", osm_ids = c(35308286, 1935675367), format = "xml") - fetch_xml$way <- osm_fetch_objects(osm_type = "ways", osm_ids = c(13073736L, 235744929L), format = "xml") + fetch_xml$node <- osm_get_objects(osm_type = "node", osm_id = c(35308286, 1935675367), format = "xml") + fetch_xml$way <- osm_get_objects(osm_type = "way", osm_id = c(13073736L, 235744929L), format = "xml") # Specific versions - fetch_xml$rel <- osm_fetch_objects( - osm_type = "relations", osm_ids = c("40581", "341530"), versions = c(3, 1), format = "xml" + fetch_xml$rel <- osm_get_objects( + osm_type = "relation", osm_id = c("40581", "341530"), version = c(3, 1), format = "xml" ) }) @@ -260,8 +260,13 @@ test_that("osm_ways_node works", { test_that("osm_full_object works", { full <- list() with_mock_dir("mock_full_object", { - full$way <- osm_full_object(osm_type = "way", osm_id = 13073736) - full$rel <- osm_full_object(osm_type = "relation", osm_id = "6002785") + full$way <- osm_get_objects(osm_type = "way", osm_id = 13073736, full_objects = TRUE) + full$rel <- osm_get_objects(osm_type = "relation", osm_id = "6002785", full_objects = TRUE) + full_xml <- osm_get_objects( + osm_type = c("relation", "way", "way", "node"), + osm_id = c(6002785, 13073736, 235744929, 35308286), + full_objects = TRUE, format = "xml" + ) }) lapply(full, expect_s3_class, c("osmapi_objects", "data.frame")) @@ -274,6 +279,25 @@ test_that("osm_full_object works", { # methods lapply(print(full), expect_s3_class, c("osmapi_objects", "data.frame")) + + + ## xml + expect_s3_class(full_xml, "xml_document") + + + ## json + with_mock_dir("mock_full_object_json", { + full_json <- osm_get_objects( + osm_type = c("relation", "way", "way", "node"), + osm_id = c(6002785, 13073736, 235744929, 35308286), + full_objects = TRUE, format = "json" + ) + }) + expect_type(full_json, "list") + expect_named(full_json, c("version", "generator", "copyright", "attribution", "license", "elements")) + lapply(full_json$elements, function(x) { + expect_contains(names(x), c("type", "id", "timestamp", "version", "changeset", "user", "uid")) + }) }) diff --git a/tests/testthat/test-user_data.R b/tests/testthat/test-user_data.R index 3218babe..43962ee5 100644 --- a/tests/testthat/test-user_data.R +++ b/tests/testthat/test-user_data.R @@ -14,17 +14,21 @@ class_columns <- list( ## Details of a user: `GET /api/0.6/user/#id` ---- test_that("osm_details_user works", { + usr <- list() with_mock_dir("mock_details_user", { - usr <- osm_details_user(user_id = "11725140") + usr$usr <- osm_get_user_details(user_id = "11725140") + usr$mod <- osm_get_user_details(user_id = 61942) }) - expect_s3_class(usr, "data.frame") - expect_named(usr, column_users) + lapply(usr, expect_s3_class, "data.frame") + lapply(usr, function(x) expect_named(x, column_users)) - mapply(function(x, cl) expect_true(inherits(x, cl)), x = usr, cl = class_columns[names(usr)]) + lapply(usr, lapply, function(x) { + mapply(function(y, cl) expect_true(inherits(y, cl)), y = x, cl = class_columns[names(x)]) + }) # Check that time is extracted, otherwise it's 00:00:00 in local time - expect_false(strftime(as.POSIXct(usr$account_created), format = "%M:%S") == "00:00") + lapply(usr, function(x) expect_false(all(strftime(as.POSIXct(x$account_created), format = "%M:%S") == "00:00"))) }) @@ -33,8 +37,8 @@ test_that("osm_details_user works", { test_that("osm_details_users works", { usrs <- list() with_mock_dir("mock_details_users", { - usrs$usrs <- osm_details_users(user_ids = c(1, 24, 44, 45, 46, 48, 49, 50)) - usrs$mod <- osm_details_users(user_ids = 61942) + usrs$usrs <- osm_get_user_details(user_id = c(1, 24, 44, 45, 46, 48, 49, 50)) + usrs$mod <- osm_get_user_details(user_id = c(61942, 564990)) }) lapply(usrs, expect_s3_class, "data.frame")