Skip to content

Commit

Permalink
Remove osm_bb() wrapper function
Browse files Browse the repository at this point in the history
`osm_bb()` simply wraps `osmdata::getbb()`. Unless function naming consistency (and thus renaming) is considered essential, it can be removed and the osmdata function can be called by the user or other functions directly.
  • Loading branch information
cforgaci committed Aug 26, 2024
1 parent 199d2ea commit 33d34ec
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 45 deletions.
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ export(get_target_points)
export(get_vertices)
export(merge_streets)
export(not_intersects)
export(osm_bb)
export(osmdata_as_sf)
export(simplify_network)
export(split_aoi)
Expand Down
2 changes: 1 addition & 1 deletion R/delineate-corridor.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ cap_corridor <- function(corridor_edges, river, crs, bb, cap = "city") {
#' @return A simple feature geometry
#' @export
delineate_corridor <- function(place, river, crs) {
bb <- CRiSp::osm_bb(place)
bb <- osmdata::getbb(place)

highways_value <- c("motorway", "primary", "secondary", "tertiary")
net <- CRiSp::osmdata_as_sf("highway", highways_value, bb) |>
Expand Down
14 changes: 0 additions & 14 deletions R/retreive-osm.R
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
#' Retrieve bounding box from OpenStreetMap
#'
#' @param name A character string with the name of the place to retrieve
#' the bounding box
#'
#' @return A list with the bounding box
#' @export
#'
#' @examples
#' osm_bb("Bucharest")
osm_bb <- function(name) {
osmdata::getbb(name)
}

#' Retrieve OpenStreetMap data as sf object
#'
#' Query the Overpass API for a key:value pair within a given bounding box.
Expand Down
21 changes: 0 additions & 21 deletions man/osm_bb.Rd

This file was deleted.

6 changes: 0 additions & 6 deletions tests/testthat/test-osm_bb.R

This file was deleted.

4 changes: 2 additions & 2 deletions vignettes/corridor-delineation.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ knitr::opts_chunk$set(
library(CRiSp)
library(sf)
library(dplyr)
library(osmdata)
```

In this notebook we explore how to delineate a river corridor using Bucharest as the study area. We focus on one of the rivers and use a specific projected CRS for the analysis. Also, we make sure that we include a given area around the city boundaries.
Expand All @@ -33,8 +34,7 @@ bbox_buffer <- 2000 # Buffer around the city boundary in meters

```{r aoi}
# Get the bounding box from the Nominatim API provided by OSM.
bb <- osm_bb(city_name)
bb <- getbb(city_name)
aoi <- define_aoi(bb, epsg_code, bbox_buffer)
```

Expand Down

0 comments on commit 33d34ec

Please sign in to comment.