diff --git a/articles/ex_leaflet.html b/articles/ex_leaflet.html index 4c0f15d..476363e 100644 --- a/articles/ex_leaflet.html +++ b/articles/ex_leaflet.html @@ -301,7 +301,7 @@

Session info#> jsonlite 1.8.9 2024-09-20 [1] RSPM #> KernSmooth 2.23-24 2024-05-17 [3] CRAN (R 4.4.2) #> knitr 1.49 2024-11-08 [1] RSPM -#> later 1.4.0 2024-11-26 [1] RSPM +#> later 1.4.1 2024-11-27 [1] RSPM #> leaflet * 2.2.2 2024-03-26 [1] RSPM #> leaflet.providers 2.0.0 2023-10-17 [1] RSPM #> lifecycle 1.0.4 2023-11-07 [1] RSPM @@ -311,7 +311,7 @@

Session info#> pillar 1.9.0 2023-03-22 [1] RSPM #> pkgconfig 2.0.3 2019-09-22 [1] RSPM #> pkgdown 2.1.1 2024-09-17 [1] any (@2.1.1) -#> promises 1.3.1 2024-11-26 [1] RSPM +#> promises 1.3.2 2024-11-28 [1] RSPM #> proxy 0.4-27 2022-06-09 [1] RSPM #> purrr 1.0.2 2023-08-10 [1] RSPM #> R.cache 0.16.0 2022-07-21 [1] RSPM diff --git a/index.html b/index.html index 27f8dc5..b3c19a2 100644 --- a/index.html +++ b/index.html @@ -196,10 +196,10 @@

Geocoding and reverse geocodingOnly latitude and longitude are returned from the geocoder service in this example, but full_results = TRUE can be used to return all of the data from the geocoder service.

----++++ @@ -237,9 +237,9 @@

Geocoding and reverse geocoding#> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100%

query
---+++ diff --git a/pkgdown.yml b/pkgdown.yml index 3ebdd26..9ec1a67 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -4,7 +4,7 @@ pkgdown_sha: ~ articles: articles/ex_leaflet: ex_leaflet.html nominatimlite: nominatimlite.html -last_built: 2024-11-28T12:41Z +last_built: 2024-11-28T16:01Z urls: reference: https://dieghernan.github.io/nominatimlite/reference article: https://dieghernan.github.io/nominatimlite/articles diff --git a/reference/figures/README-pizzahut-1.png b/reference/figures/README-pizzahut-1.png index eebda61..b8f8b3d 100644 Binary files a/reference/figures/README-pizzahut-1.png and b/reference/figures/README-pizzahut-1.png differ diff --git a/reference/geo_lite_struct.html b/reference/geo_lite_struct.html index efd5c9f..6b521cc 100644 --- a/reference/geo_lite_struct.html +++ b/reference/geo_lite_struct.html @@ -193,7 +193,7 @@

Examples dplyr::glimpse(pl_mayor) -#> Rows: 33 +#> Rows: 32 #> Columns: 43 #> $ q_amenity <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ q_street <chr> "Plaza Mayor", "Plaza Mayor", "Plaza Mayor", … @@ -204,19 +204,20 @@

Examples#> $ q_postalcode <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ lat <dbl> 40.41539, 40.96503, 41.65206, 36.65621, 36.65… #> $ lon <dbl> -3.7069974, -5.6640558, -4.7285484, -4.480330… -#> $ address <chr> "Plaza Mayor, Barrio de los Austrias, Sol, Ce… -#> $ place_id <int> 270938992, 270518370, 270013325, 273036660, 2… +#> $ address <chr> "Plaza Mayor, Túnel de la Plaza Mayor, Barrio… +#> $ place_id <int> 270939058, 270518370, 270013255, 273036660, 2… #> $ licence <chr> "Data © OpenStreetMap contributors, ODbL 1.0.… #> $ osm_type <chr> "relation", "way", "way", "node", "node", "wa… #> $ osm_id <dbl> 16657232, 78180390, 24432960, 11715993300, 75… -#> $ category <chr> "highway", "highway", "highway", "railway", "… -#> $ type <chr> "pedestrian", "pedestrian", "pedestrian", "ha… -#> $ place_rank <int> 26, 26, 26, 30, 30, 26, 26, 30, 26, 26, 26, 2… +#> $ category <chr> "tourism", "highway", "tourism", "railway", "… +#> $ type <chr> "attraction", "pedestrian", "attraction", "ha… +#> $ place_rank <int> 30, 26, 30, 30, 30, 26, 26, 30, 26, 26, 26, 3… #> $ importance <dbl> 0.43955427, 0.37221179, 0.32357442, 0.2548236… -#> $ addresstype <chr> "road", "road", "road", "railway", "railway",… +#> $ addresstype <chr> "tourism", "road", "tourism", "railway", "rai… #> $ name <chr> "Plaza Mayor", "Plaza Mayor", "Plaza Mayor", … -#> $ display_name <chr> "Plaza Mayor, Barrio de los Austrias, Sol, Ce… -#> $ address.road <chr> "Plaza Mayor", "Plaza Mayor", "Plaza Mayor", … +#> $ display_name <chr> "Plaza Mayor, Túnel de la Plaza Mayor, Barrio… +#> $ address.tourism <chr> "Plaza Mayor", NA, "Plaza Mayor", NA, NA, NA,… +#> $ address.road <chr> "Túnel de la Plaza Mayor", "Plaza Mayor", "Ca… #> $ address.neighbourhood <chr> "Barrio de los Austrias", NA, NA, NA, NA, NA,… #> $ address.quarter <chr> "Sol", NA, NA, NA, NA, "El Berrocal", NA, NA,… #> $ address.city_district <chr> "Centro", "Centro", NA, NA, NA, NA, NA, NA, N… @@ -234,7 +235,6 @@

Examples#> $ address.borough <chr> NA, NA, NA, "Churriana", "Churriana", NA, NA,… #> $ address.county <chr> NA, NA, NA, "Málaga-Costa del Sol", "Málaga-C… #> $ address.town <chr> NA, NA, NA, NA, NA, "Plasencia", NA, "Vic", N… -#> $ address.tourism <chr> NA, NA, NA, NA, NA, NA, NA, "Plaça Major", NA… #> $ address.region <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, "l'Al… #> $ address.village <chr> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ boundingbox <list> <40.414988, 40.415813, -3.708121, -3.706630>… diff --git a/search.json b/search.json index 5fe8d49..9f201f0 100644 --- a/search.json +++ b/search.json @@ -1 +1 @@ -[{"path":"https://dieghernan.github.io/nominatimlite/articles/ex_leaflet.html","id":"example","dir":"Articles","previous_headings":"","what":"Example","title":"Example: nominatimlite and leaflet maps","text":"following example shows possible create nice leaflet map data retrieved nominatimlite. widget browsable filterable thanks crosstalk reactable:","code":"# Coffee Shops and Restaurants around the Eiffel Tower library(nominatimlite) library(sf) library(leaflet) library(dplyr) library(tidyr) library(reactable) library(crosstalk) # Step 1: Eiffel Tower eiffel_tower <- geo_lite_sf(\"Eiffel Tower, Paris, France\", points_only = FALSE) # Step 2: Coffee Shops and Restaurants nearby # Create a buffer of 1km around the Eiffel Tower buff <- eiffel_tower %>% st_transform(3857) %>% st_centroid() %>% st_buffer(1000) cf_bk <- geo_amenity_sf(buff, amenity = c(\"cafe\", \"restaurant\"), limit = 50, full_results = TRUE, custom_query = list(extratags = TRUE) ) %>% # Build address with street, house number, suburb and postcode unite(\"addr\", address.road, address.house_number, address.postcode, address.suburb, sep = \", \", na.rm = TRUE ) #> | | | 0% | |========================= | 50% | |==================================================| 100% # Labels and icons labs <- paste0(\"\", cf_bk$name, \"<\/strong>
\", cf_bk$addr) # Assign icons # Base url for icons icon_url <- paste0( \"https://raw.githubusercontent.com/dieghernan/arcgeocoder/\", \"main/vignettes/articles/\" ) leaf_icons <- icons( ifelse(cf_bk$type == \"cafe\", paste0(icon_url, \"coffee-cup.png\"), paste0(icon_url, \"restaurant.png\") ), iconWidth = 20, iconHeight = 20, iconAnchorX = 10, iconAnchorY = 10 ) # Step 3: Crosstalk object cf_bk_data <- cf_bk %>% select( Place = name, Type = type, Address = addr, City = address.city, URL = extratags.website, Phone = extratags.phone ) %>% SharedData$new(group = \"Food\") # Step 4: Leaflet map with crosstalk # Init leaflet map lmend <- leaflet( data = cf_bk_data, elementId = \"EiffelTower\", width = \"100%\", height = \"60vh\", options = leafletOptions(minZoom = 12) ) %>% addProviderTiles( provider = \"CartoDB.Positron\", group = \"CartoDB.Positron\" ) %>% addTiles(group = \"OSM\") %>% addPolygons(data = eiffel_tower) %>% addMarkers(popup = labs, icon = leaf_icons) %>% addLayersControl( baseGroups = c(\"CartoDB.Positron\", \"OSM\"), position = \"topleft\", options = layersControlOptions(collapsed = FALSE) ) # Step 5: Reactable for filtering tb <- reactable(cf_bk_data, selection = \"multiple\", onClick = \"select\", rowStyle = list(cursor = \"pointer\"), filterable = TRUE, searchable = TRUE, showPageSizeOptions = TRUE, striped = TRUE, defaultColDef = colDef(vAlign = \"center\", minWidth = 150), paginationType = \"jump\", elementId = \"coffees\", columns = list( Place = colDef( sticky = \"left\", rowHeader = TRUE, name = \"\", cell = function(value) { htmltools::strong(value) } ), URL = colDef(cell = function(value) { # Render as a link if (is.null(value) | is.na(value)) { return(\"\") } htmltools::a(href = value, target = \"_blank\", as.character(value)) }), Phone = colDef(cell = function(value) { # Render as a link if (is.null(value) | is.na(value)) { return(\"\") } clearphone <- gsub(\"-\", \"\", value) clearphone <- gsub(\" \", \"\", clearphone) htmltools::a( href = paste0(\"tel:\", clearphone), target = \"_blank\", as.character(value) ) }) ) )"},{"path":"https://dieghernan.github.io/nominatimlite/articles/ex_leaflet.html","id":"widget","dir":"Articles","previous_headings":"","what":"Widget","title":"Example: nominatimlite and leaflet maps","text":"","code":"# Last step: Display all htmltools::browsable( htmltools::tagList(lmend, tb) )"},{"path":"https://dieghernan.github.io/nominatimlite/articles/ex_leaflet.html","id":"attributions","dir":"Articles","previous_headings":"","what":"Attributions","title":"Example: nominatimlite and leaflet maps","text":"Eiffel tower icons created Freepik - Flaticon Mug icons created Freepik - Flaticon Food icons created Freepik - Flaticon","code":""},{"path":"https://dieghernan.github.io/nominatimlite/articles/ex_leaflet.html","id":"session-info","dir":"Articles","previous_headings":"","what":"Session info","title":"Example: nominatimlite and leaflet maps","text":"","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.4.2 (2024-10-31 ucrt) #> os Windows Server 2022 x64 (build 20348) #> system x86_64, mingw32 #> ui RTerm #> language en #> collate English_United States.utf8 #> ctype English_United States.utf8 #> tz UTC #> date 2024-11-28 #> pandoc 3.1.11 @ C:/HOSTED~1/windows/pandoc/31F387~1.11/x64/PANDOC~1.11/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> bslib 0.8.0 2024-07-29 [1] RSPM #> cachem 1.1.0 2024-05-16 [1] RSPM #> class 7.3-22 2023-05-03 [3] CRAN (R 4.4.2) #> classInt 0.4-10 2023-09-05 [1] RSPM #> cli 3.6.3 2024-06-21 [1] RSPM #> crosstalk * 1.2.1 2023-11-23 [1] RSPM #> DBI 1.2.3 2024-06-02 [1] RSPM #> desc 1.4.3 2023-12-10 [1] RSPM #> digest 0.6.37 2024-08-19 [1] RSPM #> dplyr * 1.1.4 2023-11-17 [1] RSPM #> e1071 1.7-16 2024-09-16 [1] RSPM #> evaluate 1.0.1 2024-10-10 [1] RSPM #> fansi 1.0.6 2023-12-08 [1] RSPM #> fastmap 1.2.0 2024-05-15 [1] RSPM #> fs 1.6.5 2024-10-30 [1] RSPM #> generics 0.1.3 2022-07-05 [1] RSPM #> glue 1.8.0 2024-09-30 [1] RSPM #> htmltools 0.5.8.1 2024-04-04 [1] RSPM #> htmlwidgets 1.6.4 2023-12-06 [1] RSPM #> httpuv 1.6.15 2024-03-26 [1] RSPM #> jquerylib 0.1.4 2021-04-26 [1] RSPM #> jsonlite 1.8.9 2024-09-20 [1] RSPM #> KernSmooth 2.23-24 2024-05-17 [3] CRAN (R 4.4.2) #> knitr 1.49 2024-11-08 [1] RSPM #> later 1.4.0 2024-11-26 [1] RSPM #> leaflet * 2.2.2 2024-03-26 [1] RSPM #> leaflet.providers 2.0.0 2023-10-17 [1] RSPM #> lifecycle 1.0.4 2023-11-07 [1] RSPM #> magrittr 2.0.3 2022-03-30 [1] RSPM #> mime 0.12 2021-09-28 [1] RSPM #> nominatimlite * 0.4.1 2024-11-28 [1] local #> pillar 1.9.0 2023-03-22 [1] RSPM #> pkgconfig 2.0.3 2019-09-22 [1] RSPM #> pkgdown 2.1.1 2024-09-17 [1] any (@2.1.1) #> promises 1.3.1 2024-11-26 [1] RSPM #> proxy 0.4-27 2022-06-09 [1] RSPM #> purrr 1.0.2 2023-08-10 [1] RSPM #> R.cache 0.16.0 2022-07-21 [1] RSPM #> R.methodsS3 1.8.2 2022-06-13 [1] RSPM #> R.oo 1.27.0 2024-11-01 [1] RSPM #> R.utils 2.12.3 2023-11-18 [1] RSPM #> R6 2.5.1 2021-08-19 [1] RSPM #> ragg 1.3.3 2024-09-11 [1] RSPM #> Rcpp 1.0.13-1 2024-11-02 [1] RSPM #> reactable * 0.4.4 2023-03-12 [1] RSPM #> reactR 0.6.1 2024-09-14 [1] RSPM #> rlang 1.1.4 2024-06-04 [1] RSPM #> rmarkdown 2.29 2024-11-04 [1] RSPM #> s2 1.1.7 2024-07-17 [1] RSPM #> sass 0.4.9 2024-03-15 [1] RSPM #> sessioninfo * 1.2.2 2021-12-06 [1] any (@1.2.2) #> sf * 1.0-19 2024-11-05 [1] RSPM #> shiny 1.9.1 2024-08-01 [1] RSPM #> styler 1.10.3 2024-04-07 [1] RSPM #> systemfonts 1.1.0 2024-05-15 [1] RSPM #> textshaping 0.4.0 2024-05-24 [1] RSPM #> tibble 3.2.1 2023-03-20 [1] RSPM #> tidyr * 1.3.1 2024-01-24 [1] RSPM #> tidyselect 1.2.1 2024-03-11 [1] RSPM #> units 0.8-5 2023-11-28 [1] RSPM #> utf8 1.2.4 2023-10-22 [1] RSPM #> vctrs 0.6.5 2023-12-01 [1] RSPM #> withr 3.0.2 2024-10-28 [1] RSPM #> wk 0.9.4 2024-10-11 [1] RSPM #> xfun 0.49 2024-10-31 [1] RSPM #> xtable 1.8-4 2019-04-21 [1] RSPM #> yaml 2.3.10 2024-07-26 [1] RSPM #> #> [1] D:/a/_temp/Library #> [2] C:/R/site-library #> [3] C:/R/library #> #> ──────────────────────────────────────────────────────────────────────────────"},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"what-is-nominatim","dir":"Articles","previous_headings":"","what":"What is Nominatim?","title":"Get started with nominatimlite","text":"Nominatim tool search OpenStreetMap data name address (geocoding) generate synthetic addresses OSM points (reverse geocoding).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"why-nominatimlite","dir":"Articles","previous_headings":"","what":"Why nominatimlite?","title":"Get started with nominatimlite","text":"main goal nominatimlite access Nominatim API avoiding dependency curl. situations, curl may available accessible, nominatimlite uses base functions overcome limitation.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"recommended-packages","dir":"Articles","previous_headings":"","what":"Recommended packages","title":"Get started with nominatimlite","text":"packages much complete mature nominatimlite, presents similar features: tidygeocoder (Cambon et al. 2021): Allows interface Nominatim, Google, TomTom, Mapbox, etc. geocoding reverse geocoding. osmdata (Padgham et al. 2017): Great downloading spatial data OpenStreetMap, via Overpass API. arcgeocoder (Hernangómez 2024): Lite interface geocoding ArcGIS REST API Service.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"sf-objects","dir":"Articles","previous_headings":"Usage","what":"sf objects","title":"Get started with nominatimlite","text":"nominatimlite can extract spatial objects easily: can also extract polygon line objects (available) using option points_only = FALSE:","code":"library(nominatimlite) # Extract some points - Pizza Hut in California CA <- geo_lite_sf(\"California\", points_only = FALSE) pizzahut <- geo_lite_sf(\"Pizza Hut, California\", limit = 50, custom_query = list(countrycodes = \"us\") ) library(ggplot2) ggplot(CA) + geom_sf() + geom_sf(data = pizzahut, col = \"red\") sol_poly <- geo_lite_sf(\"Statue of Liberty, NY, USA\", points_only = FALSE) ggplot(sol_poly) + geom_sf()"},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"geocoding-and-reverse-geocoding","dir":"Articles","previous_headings":"Usage","what":"Geocoding and reverse geocoding","title":"Get started with nominatimlite","text":"Note: examples adapted tidygeocoder package first example geocode addresses using geo_lite() function: latitude longitude returned geocoder service example, full_results = TRUE can used return data geocoder service. perform reverse geocoding (obtaining addresses geographic coordinates), can use reverse_geo_lite() function. arguments similar geo_lite() function, now specify input data columns lat long arguments. dataset used geocoder query . single line address returned column named address. advance users, see Nominatim docs check parameters available.","code":"library(tibble) # create a dataframe with addresses some_addresses <- tribble( ~name, ~addr, \"White House\", \"1600 Pennsylvania Ave NW, Washington, DC\", \"Transamerica Pyramid\", \"600 Montgomery St, San Francisco, CA 94111\", \"Willis Tower\", \"233 S Wacker Dr, Chicago, IL 60606\" ) # geocode the addresses lat_longs <- geo_lite(some_addresses$addr, lat = \"latitude\", long = \"longitude\") #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100% reverse <- reverse_geo_lite( lat = lat_longs$latitude, long = lat_longs$longitude, address = \"address_found\" ) #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100%"},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Diego Hernangómez. Author, maintainer, copyright holder. Jindra Lacko. Contributor, reviewer. Alex White. Contributor. . Copyright holder. data","code":""},{"path":"https://dieghernan.github.io/nominatimlite/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Hernangómez D (2024). nominatimlite: Interface Nominatim API Service. doi:10.32614/CRAN.package.nominatimlite, https://dieghernan.github.io/nominatimlite/.","code":"@Manual{R-nominatimlite, title = {{nominatimlite}: Interface with {Nominatim} {API} Service}, doi = {10.32614/CRAN.package.nominatimlite}, author = {Diego Hernangómez}, year = {2024}, version = {0.4.1}, url = {https://dieghernan.github.io/nominatimlite/}, abstract = {Lite interface for getting data from OSM service Nominatim . Extract coordinates from addresses, find places near a set of coordinates and return spatial objects on sf format.}, }"},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"CONTRIBUTING","text":"Small typos grammatical errors documentation may edited directly using GitHub web interface, long changes made source file. YES ✔️: edit roxygen comment .R file R/. ❌: edit .Rd file man/.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"prerequisites","dir":"","previous_headings":"","what":"Prerequisites","title":"CONTRIBUTING","text":"make substantial pull request, always file issue make sure someone team agrees ’s problem. ’ve found bug, create associated issue illustrate bug minimal reprex.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"","what":"Pull request process","title":"CONTRIBUTING","text":"recommend create Git branch pull request (PR). Look R-CMD-check build status . making changes, run devtools::check() ensure new Notes, Warnings Errors appearing. recommend tidyverse style guide. also use styler package apply styles, please don’t restyle code nothing PR. use roxygen2. use testthat. Contributions test cases included easier accept. user-facing changes, add bullet top NEWS.md current development version header describing changes made followed GitHub username, links relevant issue(s)/PR(s).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"prefer-to-email","dir":"","previous_headings":"","what":"Prefer to Email?","title":"CONTRIBUTING","text":"Email person listed maintainer DESCRIPTION file repo. Though note private discussions email don’t help others - course email totally warranted ’s sensitive problem kind.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"thanks-for-contributing","dir":"","previous_headings":"","what":"Thanks for contributing!","title":"CONTRIBUTING","text":"contributing guide adapted tidyverse contributing guide available https://raw.githubusercontent.com/r-lib/usethis/master/inst/templates/tidy-contributing.md","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"nominatimlite-","dir":"","previous_headings":"","what":"nominatimlite | Connection with OSM Nominatim API","title":"nominatimlite | Connection with OSM Nominatim API","text":"goal nominatimlite provide light interface geocoding addresses, based Nominatim API. also allows load spatial objects using sf package. Full site examples vignettes https://dieghernan.github.io/nominatimlite/","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"what-is-nominatim","dir":"","previous_headings":"","what":"What is Nominatim?","title":"nominatimlite | Connection with OSM Nominatim API","text":"Nominatim tool search OpenStreetMap data name address (geocoding) generate synthetic addresses OSM points (reverse geocoding).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"why-nominatimlite","dir":"","previous_headings":"","what":"Why nominatimlite?","title":"nominatimlite | Connection with OSM Nominatim API","text":"main goal nominatimlite access Nominatim API avoiding dependency curl. situations, curl may available accessible, nominatimlite uses base functions overcome limitation.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"recommended-packages","dir":"","previous_headings":"","what":"Recommended packages","title":"nominatimlite | Connection with OSM Nominatim API","text":"packages much complete mature nominatimlite, presents similar features: tidygeocoder (Cambon et al. 2021): Allows interface Nominatim, Google, TomTom, Mapbox, etc. geocoding reverse geocoding. osmdata (Padgham et al. 2017): Great downloading spatial data OpenStreetMap, via Overpass API. arcgeocoder (Hernangómez 2024): Lite interface geocoding ArcGIS REST API Service.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"nominatimlite | Connection with OSM Nominatim API","text":"Install nominatimlite CRAN: can install developing version nominatimlite : Alternatively, can install nominatimlite using r-universe:","code":"install.packages(\"nominatimlite\") remotes::install_github(\"dieghernan/nominatimlite\") # Install nominatimlite in R: install.packages(\"nominatimlite\", repos = c( \"https://dieghernan.r-universe.dev\", \"https://cloud.r-project.org\" ) )"},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"sf-objects","dir":"","previous_headings":"Usage","what":"sf objects","title":"nominatimlite | Connection with OSM Nominatim API","text":"nominatimlite can extract spatial objects easily: can also extract polygon line objects (provided Nominatim API) using option points_only = FALSE:","code":"library(nominatimlite) # Extract some points - Pizza Hut in California CA <- geo_lite_sf(\"California\", points_only = FALSE) pizzahut <- geo_lite_sf(\"Pizza Hut, California\", limit = 50, custom_query = list(countrycodes = \"us\") ) library(ggplot2) ggplot(CA) + geom_sf() + geom_sf(data = pizzahut, col = \"red\") sol_poly <- geo_lite_sf(\"Statue of Liberty, NY, USA\", points_only = FALSE) # a building - a polygon ggplot(sol_poly) + geom_sf() dayton <- geo_lite_sf(\"Dayton, OH\") # default - a point ohio_state <- geo_lite_sf(\"Ohio, USA\", points_only = FALSE) # a US state - a polygon ohio_river <- geo_lite_sf(\"Ohio river\", points_only = FALSE) # a river - a line ggplot() + geom_sf(data = ohio_state) + geom_sf(data = dayton, color = \"red\", pch = 4) + geom_sf(data = ohio_river, color = \"blue\")"},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"geocoding-and-reverse-geocoding","dir":"","previous_headings":"Usage","what":"Geocoding and reverse geocoding","title":"nominatimlite | Connection with OSM Nominatim API","text":"Note: examples adapted tidygeocoder package first example geocode addresses using geo_lite() function: latitude longitude returned geocoder service example, full_results = TRUE can used return data geocoder service. perform reverse geocoding (obtaining addresses geographic coordinates), can use reverse_geo_lite() function. arguments similar geo_lite() function, now specify input data columns lat long arguments. dataset used geocoder query . single line address returned column named address. advance users, see Nominatim docs check parameters available.","code":"library(tibble) # create a dataframe with addresses some_addresses <- tribble( ~name, ~addr, \"White House\", \"1600 Pennsylvania Ave NW, Washington, DC\", \"Transamerica Pyramid\", \"600 Montgomery St, San Francisco, CA 94111\", \"Willis Tower\", \"233 S Wacker Dr, Chicago, IL 60606\" ) # geocode the addresses lat_longs <- geo_lite(some_addresses$addr, lat = \"latitude\", long = \"longitude\") #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100% reverse <- reverse_geo_lite( lat = lat_longs$latitude, long = lat_longs$longitude, address = \"address_found\" ) #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100%"},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"nominatimlite | Connection with OSM Nominatim API","text":"Hernangómez D (2024). nominatimlite: Interface Nominatim API Service. doi:10.32614/CRAN.package.nominatimlite, https://dieghernan.github.io/nominatimlite/. BibTeX entry LaTeX users ","code":"@Manual{R-nominatimlite, title = {{nominatimlite}: Interface with {Nominatim} {API} Service}, doi = {10.32614/CRAN.package.nominatimlite}, author = {Diego Hernangómez}, year = {2024}, version = {0.4.1}, url = {https://dieghernan.github.io/nominatimlite/}, abstract = {Lite interface for getting data from OSM service Nominatim . Extract coordinates from addresses, find places near a set of coordinates and return spatial objects on sf format.}, }"},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2021 nominatimlite authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/api_call.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function for centralize API queries — api_call","title":"Helper function for centralize API queries — api_call","text":"wrapper utils::download.file(). warning error retry call. Requests adjusted rate 1 query per second. See Nominatim Usage Policy.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/api_call.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function for centralize API queries — api_call","text":"","code":"api_call(url, destfile = tempfile(fileext = \".json\"), quiet)"},{"path":"https://dieghernan.github.io/nominatimlite/reference/api_call.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function for centralize API queries — api_call","text":"url character string (longer vector \"libcurl\" method) naming URL resource downloaded. destfile character string (vector, see url argument) file path downloaded file saved. Tilde-expansion performed. quiet TRUE, suppress status messages (), progress bar.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/api_call.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function for centralize API queries — api_call","text":"logical TRUE/FALSE.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"Create sfc object coordinates bounding box.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"","code":"bbox_to_poly(bbox = NA, xmin = NA, ymin = NA, xmax = NA, ymax = NA, crs = 4326)"},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"bbox Numeric vector 4 elements representing coordinates bounding box. Values c(xmin, ymin, xmax, ymax). xmin, ymin, xmax, ymax Alternatively, can use named parameters instead bbox. crs coordinate reference system, something suitable input st_crs","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"sfc object class POLYGON.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"Bounding boxes can located using different online tools, Bounding Box Tool.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"","code":"# bounding box of Germany bbox_GER <- c(5.86631529, 47.27011137, 15.04193189, 55.09916098) bbox_GER_sf <- bbox_to_poly(bbox_GER) library(ggplot2) ggplot(bbox_GER_sf) + geom_sf() # \\donttest{ # Extract the bounding box of a sf object sfobj <- geo_lite_sf(\"seychelles\", points_only = FALSE) sfobj #> Simple feature collection with 1 feature and 2 fields #> Geometry type: MULTIPOLYGON #> Dimension: XY #> Bounding box: xmin: 45.99888 ymin: -10.46493 xmax: 56.49794 ymax: -3.512 #> Geodetic CRS: WGS 84 #> # A tibble: 1 × 3 #> query address geometry #> * #> 1 seychelles Sesel (((45.99888 -9.401015, 46.00121 -9.427337, 46.00564 -9.456… # Need at least one non-empty object if (any(!sf::st_is_empty(sfobj))) { bbox <- sf::st_bbox(sfobj) bbox bbox_sfobj <- bbox_to_poly(bbox) ggplot(bbox_sfobj) + geom_sf(fill = \"lightblue\", alpha = 0.5) + geom_sf(data = sfobj, fill = \"wheat\") } # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":null,"dir":"Reference","previous_headings":"","what":"Address lookup API — geo_address_lookup","title":"Address lookup API — geo_address_lookup","text":"lookup API allows query address details one multiple OSM objects like node, way relation. function returns tibble associated query, see geo_address_lookup_sf() retrieving data spatial object (sf format).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address lookup API — geo_address_lookup","text":"","code":"geo_address_lookup( osm_ids, type = c(\"N\", \"W\", \"R\"), lat = \"lat\", long = \"lon\", full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list() )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address lookup API — geo_address_lookup","text":"osm_ids Vector OSM identifiers numeric (c(00000, 11111, 22222)). type Vector character type OSM type associated osm_ids. Possible values node (\"N\"), way (\"W\") relation (\"R\"). single value provided recycled. lat Latitude column name output data (default \"lat\"). long Longitude column name output data (default \"long\"). full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address lookup API — geo_address_lookup","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address lookup API — geo_address_lookup","text":"See https://nominatim.org/release-docs/develop/api/Lookup/ additional parameters passed custom_query.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address lookup API — geo_address_lookup","text":"","code":"# \\donttest{ ids <- geo_address_lookup(osm_ids = c(46240148, 34633854), type = \"W\") ids #> # A tibble: 2 × 4 #> query lat lon address #> #> 1 W46240148 40.8 -73.9 5th Avenue, East Harlem, Manhattan, New York County, Ci… #> 2 W34633854 40.7 -74.0 Empire State Building, 350, 5th Avenue, Manhattan Commu… several <- geo_address_lookup(c(146656, 240109189), type = c(\"R\", \"N\")) several #> # A tibble: 2 × 4 #> query lat lon address #> #> 1 R146656 53.5 -2.25 Manchester, Greater Manchester, England, United Kingdom #> 2 N240109189 52.5 13.4 Berlin, Deutschland # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Address lookup API in sf format — geo_address_lookup_sf","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"lookup API allows query address details one multiple OSM objects like node, way relation. function returns spatial object associated query using sf, see geo_address_lookup() retrieving data tibble format.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"","code":"geo_address_lookup_sf( osm_ids, type = c(\"N\", \"W\", \"R\"), full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list(), points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"osm_ids Vector OSM identifiers numeric (c(00000, 11111, 22222)). type Vector character type OSM type associated osm_ids. Possible values node (\"N\"), way (\"W\") relation (\"R\"). single value provided recycled. full_results Returns available data API service. FALSE (default) address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"See https://nominatim.org/release-docs/latest/api/Lookup/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"","code":"# \\donttest{ # Notre Dame Cathedral, Paris NotreDame <- geo_address_lookup_sf(osm_ids = 201611261, type = \"W\") # Need at least one non-empty object if (any(!sf::st_is_empty(NotreDame))) { library(ggplot2) ggplot(NotreDame) + geom_sf() } NotreDame_poly <- geo_address_lookup_sf(201611261, type = \"W\", points_only = FALSE ) if (any(!sf::st_is_empty(NotreDame_poly))) { ggplot(NotreDame_poly) + geom_sf() } # It is vectorized several <- geo_address_lookup_sf(c(146656, 240109189), type = c(\"R\", \"N\")) several #> Simple feature collection with 2 features and 2 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -2.245115 ymin: 52.51088 xmax: 13.39894 ymax: 53.47949 #> Geodetic CRS: WGS 84 #> # A tibble: 2 × 3 #> query address geometry #> * #> 1 R146656 Manchester, Greater Manchester, England,… (-2.245115 53.47949) #> 2 N240109189 Berlin, Deutschland (13.39894 52.51088) # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":null,"dir":"Reference","previous_headings":"","what":"Geocode amenities — geo_amenity","title":"Geocode amenities — geo_amenity","text":"function search amenities defined OpenStreetMap restricted area defined bounding box form (, , , ). function returns tibble associated query, see geo_amenity_sf() retrieving data spatial object (sf format).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geocode amenities — geo_amenity","text":"","code":"geo_amenity( bbox, amenity, lat = \"lat\", long = \"lon\", limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list(), strict = FALSE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geocode amenities — geo_amenity","text":"bbox bounding box (viewbox) used limit search. : numeric vector longitude (x) latitude (y) (xmin, ymin, xmax, ymax). See Details. sf sfc object. amenity character (vector characters) amenities geolocated (.e. c(\"pub\", \"restaurant\")). See osm_amenities. lat Latitude column name output data (default \"lat\"). long Longitude column name output data (default \"long\"). limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. strict Logical TRUE/FALSE. Force results included inside bbox. Note Nominatim default behavior may return results located outside provided bounding box.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Geocode amenities — geo_amenity","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Geocode amenities — geo_amenity","text":"Bounding boxes can located using different online tools, Bounding Box Tool. full list valid amenities see https://wiki.openstreetmap.org/wiki/Key:amenity osm_amenities. See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Geocode amenities — geo_amenity","text":"","code":"# \\donttest{ # Times Square, NY, USA bbox <- c( -73.9894467311, 40.75573629, -73.9830630737, 40.75789245 ) geo_amenity( bbox = bbox, amenity = \"restaurant\" ) #> # A tibble: 1 × 4 #> query lat lon address #> #> 1 restaurant 40.8 -74.0 Amor Loco, 134, West 46th Street, Manhattan Community … # Several amenities geo_amenity( bbox = bbox, amenity = c(\"restaurant\", \"pub\") ) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 2 × 4 #> query lat lon address #> #> 1 restaurant 40.8 -74.0 Amor Loco, 134, West 46th Street, Manhattan Community … #> 2 pub 40.8 -74.0 Connolly's, 121, West 45th Street, Manhattan Community… # Increase limit and use with strict geo_amenity( bbox = bbox, amenity = c(\"restaurant\", \"pub\"), limit = 10, strict = TRUE ) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 17 × 4 #> query lat lon address #> #> 1 restaurant 40.8 -74.0 Sardi's, 234, West 44th Street, Manhattan Community B… #> 2 restaurant 40.8 -74.0 bella vita tranttoria, 211, West 43rd Street, Manhatt… #> 3 restaurant 40.8 -74.0 Amor Loco, 134, West 46th Street, Manhattan Community… #> 4 restaurant 40.8 -74.0 Dave & Buster's, 234, West 42nd Street, Manhattan Com… #> 5 restaurant 40.8 -74.0 Applebee's, 234, West 42nd Street, Manhattan Communit… #> 6 restaurant 40.8 -74.0 Planet Hollywood, 1540, Broadway, Manhattan Community… #> 7 restaurant 40.8 -74.0 Dallas BBQ, 241, West 42nd Street, Manhattan Communit… #> 8 restaurant 40.8 -74.0 Villa Fresh Italian Kitchen, 263, West 42nd Street, M… #> 9 restaurant 40.8 -74.0 Haru Sushi, 229, West 43rd Street, Manhattan Communit… #> 10 restaurant 40.8 -74.0 Brooklyn Deli, 1501, Broadway, Manhattan Community Bo… #> 11 pub 40.8 -74.0 Connolly's, 121, West 45th Street, Manhattan Communit… #> 12 pub 40.8 -74.0 Perfect Pint, 123, West 45th Street, Manhattan Commun… #> 13 pub 40.8 -74.0 Bar 54, 141, West 44th Street, Manhattan Community Bo… #> 14 pub 40.8 -74.0 O'Lunney's, 145, West 45th Street, Manhattan Communit… #> 15 pub 40.8 -74.0 O'Donoghue's, 156, West 44th Street, Manhattan Commun… #> 16 pub 40.8 -74.0 Jimmy's Corner, 140, West 44th Street, Manhattan Comm… #> 17 pub 40.8 -74.0 BXL Cafe, 125, West 43rd Street, Manhattan Community … # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Geocode amenities in sf format — geo_amenity_sf","title":"Geocode amenities in sf format — geo_amenity_sf","text":"function search amenities defined OpenStreetMap restricted area defined bounding box form (, , , ). function returns spatial object associated query using sf, see geo_amenity() retrieving data tibble format.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geocode amenities in sf format — geo_amenity_sf","text":"","code":"geo_amenity_sf( bbox, amenity, limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list(), strict = FALSE, points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geocode amenities in sf format — geo_amenity_sf","text":"bbox bounding box (viewbox) used limit search. : numeric vector longitude (x) latitude (y) (xmin, ymin, xmax, ymax). See Details. sf sfc object. amenity character (vector characters) amenities geolocated (.e. c(\"pub\", \"restaurant\")). See osm_amenities. limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. strict Logical TRUE/FALSE. Force results included inside bbox. Note Nominatim default behavior may return results located outside provided bounding box. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Geocode amenities in sf format — geo_amenity_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Geocode amenities in sf format — geo_amenity_sf","text":"Bounding boxes can located using different online tools, Bounding Box Tool. full list valid amenities see https://wiki.openstreetmap.org/wiki/Key:amenity osm_amenities. See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Geocode amenities in sf format — geo_amenity_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Geocode amenities in sf format — geo_amenity_sf","text":"","code":"# \\donttest{ # Usera, Madrid library(ggplot2) mad <- geo_lite_sf(\"Usera, Madrid, Spain\", points_only = FALSE) # Restaurants, pubs and schools rest_pub <- geo_amenity_sf(mad, c(\"restaurant\", \"pub\", \"school\"), limit = 50 ) #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100% if (any(!sf::st_is_empty(rest_pub))) { ggplot(mad) + geom_sf() + geom_sf(data = rest_pub, aes(color = query, shape = query)) } # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":null,"dir":"Reference","previous_headings":"","what":"Address search API (free-form query) — geo_lite","title":"Address search API (free-form query) — geo_lite","text":"Geocodes addresses given character values. function returns tibble associated query, see geo_lite_sf() retrieving data spatial object (sf format). function correspond free-form query search described API endpoint.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address search API (free-form query) — geo_lite","text":"","code":"geo_lite( address, lat = \"lat\", long = \"lon\", limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list() )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address search API (free-form query) — geo_lite","text":"address character single line address, e.g. (\"1600 Pennsylvania Ave NW, Washington\") vector addresses (c(\"Madrid\", \"Barcelona\")). lat Latitude column name output data (default \"lat\"). long Longitude column name output data (default \"long\"). limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address search API (free-form query) — geo_lite","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address search API (free-form query) — geo_lite","text":"See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address search API (free-form query) — geo_lite","text":"","code":"# \\donttest{ geo_lite(\"Madrid, Spain\") #> # A tibble: 1 × 4 #> query lat lon address #> #> 1 Madrid, Spain 40.4 -3.70 Madrid, Comunidad de Madrid, España # Several addresses geo_lite(c(\"Madrid\", \"Barcelona\")) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 2 × 4 #> query lat lon address #> #> 1 Madrid 40.4 -3.70 Madrid, Comunidad de Madrid, España #> 2 Barcelona 41.4 2.18 Barcelona, Barcelonès, Barcelona, Catalunya, España # With options: restrict search to USA geo_lite(c(\"Madrid\", \"Barcelona\"), custom_query = list(countrycodes = \"US\"), full_results = TRUE ) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 2 × 25 #> query lat lon address place_id licence osm_type osm_id category type #> #> 1 Madrid 41.9 -93.8 Madrid… 3.44e8 Data ©… relation 1.29e5 boundary admi… #> 2 Barcelona 37.7 -121. Barcel… 2.99e8 Data ©… node 9.63e9 place neig… #> # ℹ 15 more variables: place_rank , importance , addresstype , #> # name , display_name , address.village , #> # address.county , address.state , `address.ISO3166-2-lvl4` , #> # address.country , address.country_code , boundingbox , #> # address.neighbourhood , address.city , address.postcode # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Address search API in sf format (free-form query) — geo_lite_sf","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"function allows geocode addresses returns corresponding spatial object. function returns spatial object associated query using sf, see geo_lite() retrieving data tibble format. function correspond free-form query search described API endpoint.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"","code":"geo_lite_sf( address, limit = 1, return_addresses = TRUE, full_results = FALSE, verbose = FALSE, progressbar = TRUE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list(), points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"address character single line address, e.g. (\"1600 Pennsylvania Ave NW, Washington\") vector addresses (c(\"Madrid\", \"Barcelona\")). limit Maximum number results return per input address. Note query returns maximum 50 results. return_addresses Return input addresses results TRUE. full_results Returns available data API service. FALSE (default) address columns returned. See also return_addresses. verbose TRUE detailed logs output console. progressbar Logical. TRUE displays progress bar indicate progress function. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"","code":"# \\donttest{ # Map - Points library(ggplot2) string <- \"Statue of Liberty, NY, USA\" sol <- geo_lite_sf(string) if (any(!sf::st_is_empty(sol))) { ggplot(sol) + geom_sf() } sol_poly <- geo_lite_sf(string, points_only = FALSE) if (any(!sf::st_is_empty(sol_poly))) { ggplot(sol_poly) + geom_sf() + geom_sf(data = sol, color = \"red\") } # Several results madrid <- geo_lite_sf(\"Comunidad de Madrid, Spain\", limit = 2, points_only = FALSE, full_results = TRUE ) if (any(!sf::st_is_empty(madrid))) { ggplot(madrid) + geom_sf(fill = NA) } # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":null,"dir":"Reference","previous_headings":"","what":"Address search API (structured query) — geo_lite_struct","title":"Address search API (structured query) — geo_lite_struct","text":"Geocodes addresses already split components. function returns tibble associated query, see geo_lite_struct_sf() retrieving data spatial object (sf format). function correspond structured query search described API endpoint. performing free-form search use geo_lite().","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address search API (structured query) — geo_lite_struct","text":"","code":"geo_lite_struct( amenity = NULL, street = NULL, city = NULL, county = NULL, state = NULL, country = NULL, postalcode = NULL, lat = \"lat\", long = \"lon\", limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list() )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address search API (structured query) — geo_lite_struct","text":"amenity Name /type POI, see also geo_amenity. street House number street name. city City. county County. state State. country Country. postalcode Postal Code. lat Latitude column name output data (default \"lat\"). long Longitude column name output data (default \"long\"). limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address search API (structured query) — geo_lite_struct","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address search API (structured query) — geo_lite_struct","text":"structured form search query allows look address already split components. parameter represents field address. parameters optional. use ones relevant address want geocode. See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address search API (structured query) — geo_lite_struct","text":"","code":"# \\donttest{ pl_mayor <- geo_lite_struct( street = \"Plaza Mayor\", country = \"Spain\", limit = 50, full_results = TRUE ) dplyr::glimpse(pl_mayor) #> Rows: 33 #> Columns: 43 #> $ q_amenity NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ q_street \"Plaza Mayor\", \"Plaza Mayor\", \"Plaza Mayor\", … #> $ q_city NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ q_county NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ q_state NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ q_country \"Spain\", \"Spain\", \"Spain\", \"Spain\", \"Spain\", … #> $ q_postalcode NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ lat 40.41539, 40.96503, 41.65206, 36.65621, 36.65… #> $ lon -3.7069974, -5.6640558, -4.7285484, -4.480330… #> $ address \"Plaza Mayor, Barrio de los Austrias, Sol, Ce… #> $ place_id 270938992, 270518370, 270013325, 273036660, 2… #> $ licence \"Data © OpenStreetMap contributors, ODbL 1.0.… #> $ osm_type \"relation\", \"way\", \"way\", \"node\", \"node\", \"wa… #> $ osm_id 16657232, 78180390, 24432960, 11715993300, 75… #> $ category \"highway\", \"highway\", \"highway\", \"railway\", \"… #> $ type \"pedestrian\", \"pedestrian\", \"pedestrian\", \"ha… #> $ place_rank 26, 26, 26, 30, 30, 26, 26, 30, 26, 26, 26, 2… #> $ importance 0.43955427, 0.37221179, 0.32357442, 0.2548236… #> $ addresstype \"road\", \"road\", \"road\", \"railway\", \"railway\",… #> $ name \"Plaza Mayor\", \"Plaza Mayor\", \"Plaza Mayor\", … #> $ display_name \"Plaza Mayor, Barrio de los Austrias, Sol, Ce… #> $ address.road \"Plaza Mayor\", \"Plaza Mayor\", \"Plaza Mayor\", … #> $ address.neighbourhood \"Barrio de los Austrias\", NA, NA, NA, NA, NA,… #> $ address.quarter \"Sol\", NA, NA, NA, NA, \"El Berrocal\", NA, NA,… #> $ address.city_district \"Centro\", \"Centro\", NA, NA, NA, NA, NA, NA, N… #> $ address.city \"Madrid\", \"Salamanca\", \"Valladolid\", \"Málaga\"… #> $ address.state \"Comunidad de Madrid\", \"Castilla y León\", \"Ca… #> $ `address.ISO3166-2-lvl4` \"ES-MD\", \"ES-CL\", \"ES-CL\", \"ES-AN\", \"ES-AN\", … #> $ address.postcode \"28012\", \"37002\", \"47001\", \"29140\", \"29140\", … #> $ address.country \"España\", \"España\", \"España\", \"España\", \"Espa… #> $ address.country_code \"es\", \"es\", \"es\", \"es\", \"es\", \"es\", \"es\", \"es… #> $ address.province NA, \"Salamanca\", \"Valladolid\", \"Málaga\", \"Mál… #> $ `address.ISO3166-2-lvl6` NA, \"ES-SA\", \"ES-VA\", \"ES-MA\", \"ES-MA\", \"ES-C… #> $ address.suburb NA, NA, \"Plaza Mayor\", NA, NA, NA, \"San Loren… #> $ address.railway NA, NA, NA, \"Plaza Mayor\", \"Plaza Mayor\", NA,… #> $ address.retail NA, NA, NA, \"Plaza Mayor\", \"Plaza Mayor\", NA,… #> $ address.borough NA, NA, NA, \"Churriana\", \"Churriana\", NA, NA,… #> $ address.county NA, NA, NA, \"Málaga-Costa del Sol\", \"Málaga-C… #> $ address.town NA, NA, NA, NA, NA, \"Plasencia\", NA, \"Vic\", N… #> $ address.tourism NA, NA, NA, NA, NA, NA, NA, \"Plaça Major\", NA… #> $ address.region NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, \"l'Al… #> $ address.village NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ boundingbox <40.414988, 40.415813, -3.708121, -3.706630>… # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Address search API in sf format (structured query) — geo_lite_struct_sf","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"Geocodes addresses already split components return corresponding spatial object. function returns spatial object associated query using sf, see geo_lite_struct() retrieving data tibble format. function correspond structured query search described API endpoint. performing free-form search use geo_lite_sf().","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"","code":"geo_lite_struct_sf( amenity = NULL, street = NULL, city = NULL, county = NULL, state = NULL, country = NULL, postalcode = NULL, limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list(), points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"amenity Name /type POI, see also geo_amenity. street House number street name. city City. county County. state State. country Country. postalcode Postal Code. limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"structured form search query allows look address already split components. parameter represents field address. parameters optional. use ones relevant address want geocode. See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"","code":"# \\donttest{ # Map pl_mayor <- geo_lite_struct_sf( street = \"Plaza Mayor\", county = \"Comunidad de Madrid\", country = \"Spain\", limit = 50, full_results = TRUE, verbose = TRUE ) # Outline ccaa <- geo_lite_sf(\"Comunidad de Madrid, Spain\", points_only = FALSE) library(ggplot2) if (any(!sf::st_is_empty(pl_mayor), !sf::st_is_empty(ccaa))) { ggplot(ccaa) + geom_sf() + geom_sf(data = pl_mayor, aes(shape = addresstype, color = addresstype)) } # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatimlite-package.html","id":null,"dir":"Reference","previous_headings":"","what":"nominatimlite: Interface with 'Nominatim' API Service — nominatimlite-package","title":"nominatimlite: Interface with 'Nominatim' API Service — nominatimlite-package","text":"Lite interface getting data 'OSM' service 'Nominatim' https://nominatim.org/release-docs/latest/. Extract coordinates addresses, find places near set coordinates return spatial objects 'sf' format.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatimlite-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"nominatimlite: Interface with 'Nominatim' API Service — nominatimlite-package","text":"Maintainer: Diego Hernangómez diego.hernangomezherrero@gmail.com (ORCID) [copyright holder] contributors: Jindra Lacko (ORCID) [contributor, reviewer] Alex White [contributor] OpenStreetMap (data) [copyright holder]","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":null,"dir":"Reference","previous_headings":"","what":"Check access to Nominatim API — nominatim_check_access","title":"Check access to Nominatim API — nominatim_check_access","text":"Check R access resources https://nominatim.openstreetmap.org.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check access to Nominatim API — nominatim_check_access","text":"","code":"nominatim_check_access( nominatim_server = \"https://nominatim.openstreetmap.org/\" )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check access to Nominatim API — nominatim_check_access","text":"nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\".","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check access to Nominatim API — nominatim_check_access","text":"logical TRUE/FALSE.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check access to Nominatim API — nominatim_check_access","text":"","code":"# \\donttest{ nominatim_check_access() #> [1] TRUE # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":null,"dir":"Reference","previous_headings":"","what":"OpenStreetMap amenity database — osm_amenities","title":"OpenStreetMap amenity database — osm_amenities","text":"Database list amenities available OpenStreetMap.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"OpenStreetMap amenity database — osm_amenities","text":"tibble 136 rows fields: category category amenity. amenity value amenity. comment brief description type amenity.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"OpenStreetMap amenity database — osm_amenities","text":"https://wiki.openstreetmap.org/wiki/Key:amenity","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"OpenStreetMap amenity database — osm_amenities","text":"Data extracted 03 April 2024.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"OpenStreetMap amenity database — osm_amenities","text":"","code":"data(\"osm_amenities\") osm_amenities #> # A tibble: 136 × 3 #> category amenity comment #> #> 1 Sustenance bar Bar is a purpose-built commercial establishment th… #> 2 Sustenance biergarten Biergarten or beer garden is an open-air area wher… #> 3 Sustenance cafe Cafe is generally an informal place that offers ca… #> 4 Sustenance fast_food Fast food restaurant (see also amenity=restaurant)… #> 5 Sustenance food_court An area with several different restaurant food cou… #> 6 Sustenance ice_cream Ice cream shop or ice cream parlour. A place that … #> 7 Sustenance pub A place selling beer and other alcoholic drinks; m… #> 8 Sustenance restaurant Restaurant (not fast food, see amenity=fast_food).… #> 9 Education college Campus or buildings of an institute of Further Edu… #> 10 Education dancing_school A dancing school or dance studio #> # ℹ 126 more rows"},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse geocoding API — reverse_geo_lite","title":"Reverse geocoding API — reverse_geo_lite","text":"Generates address latitude longitude. Latitudes must \\(\\left[-90, 90 \\right]\\) longitudes \\(\\left[-180, 180 \\right]\\). function returns tibble associated query, see reverse_geo_lite_sf() retrieving data spatial object (sf format).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse geocoding API — reverse_geo_lite","text":"","code":"reverse_geo_lite( lat, long, address = \"address\", full_results = FALSE, return_coords = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list() )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reverse geocoding API — reverse_geo_lite","text":"lat Latitude values numeric format. Must range \\(\\left[-90, 90 \\right]\\). long Longitude values numeric format. Must range \\(\\left[-180, 180 \\right]\\). address Address column name output data (default \"address\"). full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_coords Return input coordinates results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query API-specific parameters used, passed named list (ie. list(zoom = 3)). See Details.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reverse geocoding API — reverse_geo_lite","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Reverse geocoding API — reverse_geo_lite","text":"See https://nominatim.org/release-docs/develop/api/Reverse/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"about-zooming","dir":"Reference","previous_headings":"","what":"About Zooming","title":"Reverse geocoding API — reverse_geo_lite","text":"Use option custom_query = list(zoom = 3) adjust output. equivalences terms zoom:","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse geocoding API — reverse_geo_lite","text":"","code":"# \\donttest{ reverse_geo_lite(lat = 40.75728, long = -73.98586) #> # A tibble: 1 × 3 #> address lat lon #> #> 1 Times Square, 7th Avenue, Manhattan Community Board 5, Manhattan,… 40.8 -74.0 # Several coordinates reverse_geo_lite(lat = c(40.75728, 55.95335), long = c(-73.98586, -3.188375)) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 2 × 3 #> address lat lon #> #> 1 Times Square, 7th Avenue, Manhattan Community Board 5, Manhattan… 40.8 -74.0 #> 2 Edinburgh Distance Marker, Waterloo Place, Greenside, New Town/B… 56.0 -3.19 # With options: zoom to country level sev <- reverse_geo_lite( lat = c(40.75728, 55.95335), long = c(-73.98586, -3.188375), custom_query = list(zoom = 0, extratags = TRUE), verbose = TRUE, full_results = TRUE ) #> | | | 0% | |========================= | 50% | |==================================================| 100% dplyr::glimpse(sev) #> Rows: 2 #> Columns: 51 #> $ address \"United States\", \"United King… #> $ lat 39.78373, 54.70235 #> $ lon -100.445882, -3.276575 #> $ place_id 46583304, 254352942 #> $ licence \"Data © OpenStreetMap contrib… #> $ osm_type \"relation\", \"relation\" #> $ osm_id 148838, 62149 #> $ category \"boundary\", \"boundary\" #> $ type \"administrative\", \"administra… #> $ place_rank 4, 4 #> $ importance 1.000000, 0.929957 #> $ addresstype \"country\", \"country\" #> $ name \"United States\", \"United King… #> $ display_name \"United States\", \"United King… #> $ address.country \"United States\", \"United King… #> $ address.country_code \"us\", \"gb\" #> $ extratags.flag \"https://upload.wikimedia.org… #> $ extratags.sqkm \"9826675\", \"243610\" #> $ extratags.wikidata \"Q30\", \"Q145\" #> $ extratags.wikipedia \"en:United States\", \"en:Unite… #> $ extratags.check_date \"2024-10-17\", NA #> $ extratags.population \"331449281\", \"61792000\" #> $ extratags.border_type \"national\", NA #> $ `extratags.abbr_name:en` \"U.S.A\", NA #> $ extratags.capital_city \"Washington DC\", NA #> $ extratags.driving_side \"right\", \"left\" #> $ extratags.linked_place \"country\", \"country\" #> $ `extratags.contact:website` \"https://www.usa.gov\", NA #> $ `extratags.population:date` \"2020\", NA #> $ `extratags.ISO3166-1:alpha2` \"US\", \"GB\" #> $ `extratags.ISO3166-1:alpha3` \"USA\", \"GBR\" #> $ extratags.default_language \"en\", \"en\" #> $ `extratags.ISO3166-1:numeric` \"840\", \"826\" #> $ `extratags.alt_short_name:en` \"US\", NA #> $ `extratags.alt_short_name:pl` \"St. Zj.\", NA #> $ extratags.country_code_fips \"US\", NA #> $ `extratags.old_short_name:ru` \"САСШ\", NA #> $ `extratags.source:population` \"census.gov\", \"http://www.sta… #> $ `extratags.alt_official_name:en` \"The United States of America… #> $ `extratags.not:official_name:vi` \"Hợp chủng quốc Hoa Kỳ;Hợp ch… #> $ extratags.country_code_iso3166_1_alpha_2 \"US\", NA #> $ boundingbox <-14.76084, 71.58895, -180.00… #> $ `extratags.ref:gss` NA, \"K02000001\" #> $ extratags.currency NA, \"GBP\" #> $ extratags.timezone NA, \"Europe/London\" #> $ extratags.native_name NA, \"United Kingdom of Great … #> $ `extratags.source:sqkm` NA, \"CIA World Factbook\" #> $ `extratags.native_name:da` NA, \"Det Forenede Kongerige S… #> $ `extratags.native_name:es` NA, \"Reino Unido de Gran Bret… #> $ `extratags.native_name:vi` NA, \"Vương quốc Liên hiệp Anh… #> $ `extratags.source:ref:gss` NA, \"ONS_OpenData\" # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse geocoding API in sf format — reverse_geo_lite_sf","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"Generates address latitude longitude. Latitudes must \\(\\left[-90, 90 \\right]\\) longitudes \\(\\left[-180, 180 \\right]\\). function returns spatial object associated query using sf, see reverse_geo_lite() retrieving data tibble format.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"","code":"reverse_geo_lite_sf( lat, long, address = \"address\", full_results = FALSE, return_coords = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list(), points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"lat Latitude values numeric format. Must range \\(\\left[-90, 90 \\right]\\). long Longitude values numeric format. Must range \\(\\left[-180, 180 \\right]\\). address Address column name output data (default \"address\"). full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_coords Return input coordinates results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query API-specific parameters used, passed named list (ie. list(zoom = 3)). See Details. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"See https://nominatim.org/release-docs/develop/api/Reverse/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"about-zooming","dir":"Reference","previous_headings":"","what":"About Zooming","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"Use option custom_query = list(zoom = 3) adjust output. equivalences terms zoom:","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"","code":"# \\donttest{ library(ggplot2) # Coliseum coords col_lon <- 12.49309 col_lat <- 41.89026 # Coliseum as polygon col_sf <- reverse_geo_lite_sf( lat = col_lat, lon = col_lon, points_only = FALSE ) dplyr::glimpse(col_sf) #> Rows: 1 #> Columns: 4 #> $ address \"Colosseo, Piazza del Colosseo, Celio, Municipio Roma I, Roma… #> $ lat 41.89026 #> $ lon 12.49309 #> $ geometry POLYGON ((12.4913 41.89058,... if (any(!sf::st_is_empty(col_sf))) { ggplot(col_sf) + geom_sf() } # City of Rome - same coords with zoom 10 rome_sf <- reverse_geo_lite_sf( lat = col_lat, lon = col_lon, custom_query = list(zoom = 10), points_only = FALSE ) dplyr::glimpse(rome_sf) #> Rows: 1 #> Columns: 4 #> $ address \"Roma, Roma Capitale, Lazio, Italia\" #> $ lat 41.89026 #> $ lon 12.49309 #> $ geometry MULTIPOLYGON (((12.23447 41... if (any(!sf::st_is_empty(rome_sf))) { ggplot(rome_sf) + geom_sf() } # }"},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-041","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.4.1","title":"nominatimlite 0.4.1","text":"CRAN release: 2024-07-19 Fix input validation geo_address_lookup() geo_address_lookup_sf() crashes function OSM ID long (#47 reported @lshydro).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-040","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.4.0","title":"nominatimlite 0.4.0","text":"CRAN release: 2024-05-27 New functions: geo_lite_struct() geo_lite_struct_sf() performing structured queries. Bring back geo_amenity() geo_amenity_sf() wrapper geo_lite_struct() / geo_lite_struct_sf(), now robust compatible sf objects. Improve unnesting fields requiring extratags, .e. custom_query = list(extratags = TRUE). possible use nominatimlite local server thanks new argument nominatim_server (#42 @alexwhitedatamine). Adapt endpoints Nominatim v4.4.0 [Python-]. nominatimlite::osm_amenities data set re-introduced, updated additional description fields. API call non-spatial function uses now JSONV2 format (&format=jsonv2). implies following changes output: class renamed category. additional field place_rank search rank object. custom_query argument can use vectors logical:","code":"geo_lite(address = \"New York\", custom_query = list(addressdetails = TRUE, viewbox = c(-60, -20, 60, 20)) )"},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-030","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.3.0","title":"nominatimlite 0.3.0","text":"CRAN release: 2024-03-01 Add progressbar parameter geo_lite(), geo_lite_sf(), reverse_geo_lite() reverse_geo_lite_sf() display progress console.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"deprecated-0-3-0","dir":"Changelog","previous_headings":"","what":"Deprecated","title":"nominatimlite 0.3.0","text":"geo_amenity() geo_amenity_sf(), see Nominatim/issues/1311. Use arcgeocoder::arc_geo_categories() alternative. nominatimlite::osm_amenities data set deleted.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-021","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.2.1","title":"nominatimlite 0.2.1","text":"CRAN release: 2023-08-15 Remove osmdata Suggests. Fix examples.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-020","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.2.0","title":"nominatimlite 0.2.0","text":"CRAN release: 2023-05-11 rlang tibble explicitly required. Conversions tibble happens dplyr::tibble(). data attributes sf objects returned now tibble, easy printing console. Improvements code tests. Now sf objects can handle correctly nested fields provided json response (example, nested address field provided API). consistent also results provided non-spatial functions, unnesting already handled correctly. Improvements output reverse_geo_lite() reverse_geo_lite_sf() API returns nested lists.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-016","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.6","title":"nominatimlite 0.1.6","text":"CRAN release: 2022-06-10 Improve results response API.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-015","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.5","title":"nominatimlite 0.1.5","text":"CRAN release: 2021-11-26 Avoid de-duplication results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-014","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.4","title":"nominatimlite 0.1.4","text":"CRAN release: 2021-10-28 Fix issues geo_amenity() geo_amenity_sf().","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-013","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.3","title":"nominatimlite 0.1.3","text":"CRAN release: 2021-10-21 Skip API query tests CRAN avoid false positives. Centralize API queries (internal) function api_call(). Queries fully honors now Nominatim Usage Policy. Queries may slower now.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-012","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.2","title":"nominatimlite 0.1.2","text":"CRAN release: 2021-10-07 New internal: nominatim_check_access(). Adapt tests testthat v3.1.0.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-011","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.1","title":"nominatimlite 0.1.1","text":"CRAN release: 2021-09-30 Adapt tests CRAN checks.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-010","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.0","title":"nominatimlite 0.1.0","text":"CRAN release: 2021-09-16 CRAN release. Adjust query rate limits Nominatim policy. New strict argument geo_amenity() geo_amenity_sf(). Parameter polygon changed points_only (#8) thanks @jlacko. Package now falls gracefully url reachable.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-001","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.0.1","title":"nominatimlite 0.0.1","text":"Initial version package","code":""}] +[{"path":"https://dieghernan.github.io/nominatimlite/articles/ex_leaflet.html","id":"example","dir":"Articles","previous_headings":"","what":"Example","title":"Example: nominatimlite and leaflet maps","text":"following example shows possible create nice leaflet map data retrieved nominatimlite. widget browsable filterable thanks crosstalk reactable:","code":"# Coffee Shops and Restaurants around the Eiffel Tower library(nominatimlite) library(sf) library(leaflet) library(dplyr) library(tidyr) library(reactable) library(crosstalk) # Step 1: Eiffel Tower eiffel_tower <- geo_lite_sf(\"Eiffel Tower, Paris, France\", points_only = FALSE) # Step 2: Coffee Shops and Restaurants nearby # Create a buffer of 1km around the Eiffel Tower buff <- eiffel_tower %>% st_transform(3857) %>% st_centroid() %>% st_buffer(1000) cf_bk <- geo_amenity_sf(buff, amenity = c(\"cafe\", \"restaurant\"), limit = 50, full_results = TRUE, custom_query = list(extratags = TRUE) ) %>% # Build address with street, house number, suburb and postcode unite(\"addr\", address.road, address.house_number, address.postcode, address.suburb, sep = \", \", na.rm = TRUE ) #> | | | 0% | |========================= | 50% | |==================================================| 100% # Labels and icons labs <- paste0(\"\", cf_bk$name, \"<\/strong>
\", cf_bk$addr) # Assign icons # Base url for icons icon_url <- paste0( \"https://raw.githubusercontent.com/dieghernan/arcgeocoder/\", \"main/vignettes/articles/\" ) leaf_icons <- icons( ifelse(cf_bk$type == \"cafe\", paste0(icon_url, \"coffee-cup.png\"), paste0(icon_url, \"restaurant.png\") ), iconWidth = 20, iconHeight = 20, iconAnchorX = 10, iconAnchorY = 10 ) # Step 3: Crosstalk object cf_bk_data <- cf_bk %>% select( Place = name, Type = type, Address = addr, City = address.city, URL = extratags.website, Phone = extratags.phone ) %>% SharedData$new(group = \"Food\") # Step 4: Leaflet map with crosstalk # Init leaflet map lmend <- leaflet( data = cf_bk_data, elementId = \"EiffelTower\", width = \"100%\", height = \"60vh\", options = leafletOptions(minZoom = 12) ) %>% addProviderTiles( provider = \"CartoDB.Positron\", group = \"CartoDB.Positron\" ) %>% addTiles(group = \"OSM\") %>% addPolygons(data = eiffel_tower) %>% addMarkers(popup = labs, icon = leaf_icons) %>% addLayersControl( baseGroups = c(\"CartoDB.Positron\", \"OSM\"), position = \"topleft\", options = layersControlOptions(collapsed = FALSE) ) # Step 5: Reactable for filtering tb <- reactable(cf_bk_data, selection = \"multiple\", onClick = \"select\", rowStyle = list(cursor = \"pointer\"), filterable = TRUE, searchable = TRUE, showPageSizeOptions = TRUE, striped = TRUE, defaultColDef = colDef(vAlign = \"center\", minWidth = 150), paginationType = \"jump\", elementId = \"coffees\", columns = list( Place = colDef( sticky = \"left\", rowHeader = TRUE, name = \"\", cell = function(value) { htmltools::strong(value) } ), URL = colDef(cell = function(value) { # Render as a link if (is.null(value) | is.na(value)) { return(\"\") } htmltools::a(href = value, target = \"_blank\", as.character(value)) }), Phone = colDef(cell = function(value) { # Render as a link if (is.null(value) | is.na(value)) { return(\"\") } clearphone <- gsub(\"-\", \"\", value) clearphone <- gsub(\" \", \"\", clearphone) htmltools::a( href = paste0(\"tel:\", clearphone), target = \"_blank\", as.character(value) ) }) ) )"},{"path":"https://dieghernan.github.io/nominatimlite/articles/ex_leaflet.html","id":"widget","dir":"Articles","previous_headings":"","what":"Widget","title":"Example: nominatimlite and leaflet maps","text":"","code":"# Last step: Display all htmltools::browsable( htmltools::tagList(lmend, tb) )"},{"path":"https://dieghernan.github.io/nominatimlite/articles/ex_leaflet.html","id":"attributions","dir":"Articles","previous_headings":"","what":"Attributions","title":"Example: nominatimlite and leaflet maps","text":"Eiffel tower icons created Freepik - Flaticon Mug icons created Freepik - Flaticon Food icons created Freepik - Flaticon","code":""},{"path":"https://dieghernan.github.io/nominatimlite/articles/ex_leaflet.html","id":"session-info","dir":"Articles","previous_headings":"","what":"Session info","title":"Example: nominatimlite and leaflet maps","text":"","code":"#> ─ Session info ─────────────────────────────────────────────────────────────── #> setting value #> version R version 4.4.2 (2024-10-31 ucrt) #> os Windows Server 2022 x64 (build 20348) #> system x86_64, mingw32 #> ui RTerm #> language en #> collate English_United States.utf8 #> ctype English_United States.utf8 #> tz UTC #> date 2024-11-28 #> pandoc 3.1.11 @ C:/HOSTED~1/windows/pandoc/31F387~1.11/x64/PANDOC~1.11/ (via rmarkdown) #> #> ─ Packages ─────────────────────────────────────────────────────────────────── #> package * version date (UTC) lib source #> bslib 0.8.0 2024-07-29 [1] RSPM #> cachem 1.1.0 2024-05-16 [1] RSPM #> class 7.3-22 2023-05-03 [3] CRAN (R 4.4.2) #> classInt 0.4-10 2023-09-05 [1] RSPM #> cli 3.6.3 2024-06-21 [1] RSPM #> crosstalk * 1.2.1 2023-11-23 [1] RSPM #> DBI 1.2.3 2024-06-02 [1] RSPM #> desc 1.4.3 2023-12-10 [1] RSPM #> digest 0.6.37 2024-08-19 [1] RSPM #> dplyr * 1.1.4 2023-11-17 [1] RSPM #> e1071 1.7-16 2024-09-16 [1] RSPM #> evaluate 1.0.1 2024-10-10 [1] RSPM #> fansi 1.0.6 2023-12-08 [1] RSPM #> fastmap 1.2.0 2024-05-15 [1] RSPM #> fs 1.6.5 2024-10-30 [1] RSPM #> generics 0.1.3 2022-07-05 [1] RSPM #> glue 1.8.0 2024-09-30 [1] RSPM #> htmltools 0.5.8.1 2024-04-04 [1] RSPM #> htmlwidgets 1.6.4 2023-12-06 [1] RSPM #> httpuv 1.6.15 2024-03-26 [1] RSPM #> jquerylib 0.1.4 2021-04-26 [1] RSPM #> jsonlite 1.8.9 2024-09-20 [1] RSPM #> KernSmooth 2.23-24 2024-05-17 [3] CRAN (R 4.4.2) #> knitr 1.49 2024-11-08 [1] RSPM #> later 1.4.1 2024-11-27 [1] RSPM #> leaflet * 2.2.2 2024-03-26 [1] RSPM #> leaflet.providers 2.0.0 2023-10-17 [1] RSPM #> lifecycle 1.0.4 2023-11-07 [1] RSPM #> magrittr 2.0.3 2022-03-30 [1] RSPM #> mime 0.12 2021-09-28 [1] RSPM #> nominatimlite * 0.4.1 2024-11-28 [1] local #> pillar 1.9.0 2023-03-22 [1] RSPM #> pkgconfig 2.0.3 2019-09-22 [1] RSPM #> pkgdown 2.1.1 2024-09-17 [1] any (@2.1.1) #> promises 1.3.2 2024-11-28 [1] RSPM #> proxy 0.4-27 2022-06-09 [1] RSPM #> purrr 1.0.2 2023-08-10 [1] RSPM #> R.cache 0.16.0 2022-07-21 [1] RSPM #> R.methodsS3 1.8.2 2022-06-13 [1] RSPM #> R.oo 1.27.0 2024-11-01 [1] RSPM #> R.utils 2.12.3 2023-11-18 [1] RSPM #> R6 2.5.1 2021-08-19 [1] RSPM #> ragg 1.3.3 2024-09-11 [1] RSPM #> Rcpp 1.0.13-1 2024-11-02 [1] RSPM #> reactable * 0.4.4 2023-03-12 [1] RSPM #> reactR 0.6.1 2024-09-14 [1] RSPM #> rlang 1.1.4 2024-06-04 [1] RSPM #> rmarkdown 2.29 2024-11-04 [1] RSPM #> s2 1.1.7 2024-07-17 [1] RSPM #> sass 0.4.9 2024-03-15 [1] RSPM #> sessioninfo * 1.2.2 2021-12-06 [1] any (@1.2.2) #> sf * 1.0-19 2024-11-05 [1] RSPM #> shiny 1.9.1 2024-08-01 [1] RSPM #> styler 1.10.3 2024-04-07 [1] RSPM #> systemfonts 1.1.0 2024-05-15 [1] RSPM #> textshaping 0.4.0 2024-05-24 [1] RSPM #> tibble 3.2.1 2023-03-20 [1] RSPM #> tidyr * 1.3.1 2024-01-24 [1] RSPM #> tidyselect 1.2.1 2024-03-11 [1] RSPM #> units 0.8-5 2023-11-28 [1] RSPM #> utf8 1.2.4 2023-10-22 [1] RSPM #> vctrs 0.6.5 2023-12-01 [1] RSPM #> withr 3.0.2 2024-10-28 [1] RSPM #> wk 0.9.4 2024-10-11 [1] RSPM #> xfun 0.49 2024-10-31 [1] RSPM #> xtable 1.8-4 2019-04-21 [1] RSPM #> yaml 2.3.10 2024-07-26 [1] RSPM #> #> [1] D:/a/_temp/Library #> [2] C:/R/site-library #> [3] C:/R/library #> #> ──────────────────────────────────────────────────────────────────────────────"},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"what-is-nominatim","dir":"Articles","previous_headings":"","what":"What is Nominatim?","title":"Get started with nominatimlite","text":"Nominatim tool search OpenStreetMap data name address (geocoding) generate synthetic addresses OSM points (reverse geocoding).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"why-nominatimlite","dir":"Articles","previous_headings":"","what":"Why nominatimlite?","title":"Get started with nominatimlite","text":"main goal nominatimlite access Nominatim API avoiding dependency curl. situations, curl may available accessible, nominatimlite uses base functions overcome limitation.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"recommended-packages","dir":"Articles","previous_headings":"","what":"Recommended packages","title":"Get started with nominatimlite","text":"packages much complete mature nominatimlite, presents similar features: tidygeocoder (Cambon et al. 2021): Allows interface Nominatim, Google, TomTom, Mapbox, etc. geocoding reverse geocoding. osmdata (Padgham et al. 2017): Great downloading spatial data OpenStreetMap, via Overpass API. arcgeocoder (Hernangómez 2024): Lite interface geocoding ArcGIS REST API Service.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"sf-objects","dir":"Articles","previous_headings":"Usage","what":"sf objects","title":"Get started with nominatimlite","text":"nominatimlite can extract spatial objects easily: can also extract polygon line objects (available) using option points_only = FALSE:","code":"library(nominatimlite) # Extract some points - Pizza Hut in California CA <- geo_lite_sf(\"California\", points_only = FALSE) pizzahut <- geo_lite_sf(\"Pizza Hut, California\", limit = 50, custom_query = list(countrycodes = \"us\") ) library(ggplot2) ggplot(CA) + geom_sf() + geom_sf(data = pizzahut, col = \"red\") sol_poly <- geo_lite_sf(\"Statue of Liberty, NY, USA\", points_only = FALSE) ggplot(sol_poly) + geom_sf()"},{"path":"https://dieghernan.github.io/nominatimlite/articles/nominatimlite.html","id":"geocoding-and-reverse-geocoding","dir":"Articles","previous_headings":"Usage","what":"Geocoding and reverse geocoding","title":"Get started with nominatimlite","text":"Note: examples adapted tidygeocoder package first example geocode addresses using geo_lite() function: latitude longitude returned geocoder service example, full_results = TRUE can used return data geocoder service. perform reverse geocoding (obtaining addresses geographic coordinates), can use reverse_geo_lite() function. arguments similar geo_lite() function, now specify input data columns lat long arguments. dataset used geocoder query . single line address returned column named address. advance users, see Nominatim docs check parameters available.","code":"library(tibble) # create a dataframe with addresses some_addresses <- tribble( ~name, ~addr, \"White House\", \"1600 Pennsylvania Ave NW, Washington, DC\", \"Transamerica Pyramid\", \"600 Montgomery St, San Francisco, CA 94111\", \"Willis Tower\", \"233 S Wacker Dr, Chicago, IL 60606\" ) # geocode the addresses lat_longs <- geo_lite(some_addresses$addr, lat = \"latitude\", long = \"longitude\") #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100% reverse <- reverse_geo_lite( lat = lat_longs$latitude, long = lat_longs$longitude, address = \"address_found\" ) #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100%"},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Diego Hernangómez. Author, maintainer, copyright holder. Jindra Lacko. Contributor, reviewer. Alex White. Contributor. . Copyright holder. data","code":""},{"path":"https://dieghernan.github.io/nominatimlite/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Hernangómez D (2024). nominatimlite: Interface Nominatim API Service. doi:10.32614/CRAN.package.nominatimlite, https://dieghernan.github.io/nominatimlite/.","code":"@Manual{R-nominatimlite, title = {{nominatimlite}: Interface with {Nominatim} {API} Service}, doi = {10.32614/CRAN.package.nominatimlite}, author = {Diego Hernangómez}, year = {2024}, version = {0.4.1}, url = {https://dieghernan.github.io/nominatimlite/}, abstract = {Lite interface for getting data from OSM service Nominatim . Extract coordinates from addresses, find places near a set of coordinates and return spatial objects on sf format.}, }"},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"CONTRIBUTING","text":"Small typos grammatical errors documentation may edited directly using GitHub web interface, long changes made source file. YES ✔️: edit roxygen comment .R file R/. ❌: edit .Rd file man/.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"prerequisites","dir":"","previous_headings":"","what":"Prerequisites","title":"CONTRIBUTING","text":"make substantial pull request, always file issue make sure someone team agrees ’s problem. ’ve found bug, create associated issue illustrate bug minimal reprex.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"","what":"Pull request process","title":"CONTRIBUTING","text":"recommend create Git branch pull request (PR). Look R-CMD-check build status . making changes, run devtools::check() ensure new Notes, Warnings Errors appearing. recommend tidyverse style guide. also use styler package apply styles, please don’t restyle code nothing PR. use roxygen2. use testthat. Contributions test cases included easier accept. user-facing changes, add bullet top NEWS.md current development version header describing changes made followed GitHub username, links relevant issue(s)/PR(s).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"prefer-to-email","dir":"","previous_headings":"","what":"Prefer to Email?","title":"CONTRIBUTING","text":"Email person listed maintainer DESCRIPTION file repo. Though note private discussions email don’t help others - course email totally warranted ’s sensitive problem kind.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/CONTRIBUTING.html","id":"thanks-for-contributing","dir":"","previous_headings":"","what":"Thanks for contributing!","title":"CONTRIBUTING","text":"contributing guide adapted tidyverse contributing guide available https://raw.githubusercontent.com/r-lib/usethis/master/inst/templates/tidy-contributing.md","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"nominatimlite-","dir":"","previous_headings":"","what":"nominatimlite | Connection with OSM Nominatim API","title":"nominatimlite | Connection with OSM Nominatim API","text":"goal nominatimlite provide light interface geocoding addresses, based Nominatim API. also allows load spatial objects using sf package. Full site examples vignettes https://dieghernan.github.io/nominatimlite/","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"what-is-nominatim","dir":"","previous_headings":"","what":"What is Nominatim?","title":"nominatimlite | Connection with OSM Nominatim API","text":"Nominatim tool search OpenStreetMap data name address (geocoding) generate synthetic addresses OSM points (reverse geocoding).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"why-nominatimlite","dir":"","previous_headings":"","what":"Why nominatimlite?","title":"nominatimlite | Connection with OSM Nominatim API","text":"main goal nominatimlite access Nominatim API avoiding dependency curl. situations, curl may available accessible, nominatimlite uses base functions overcome limitation.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"recommended-packages","dir":"","previous_headings":"","what":"Recommended packages","title":"nominatimlite | Connection with OSM Nominatim API","text":"packages much complete mature nominatimlite, presents similar features: tidygeocoder (Cambon et al. 2021): Allows interface Nominatim, Google, TomTom, Mapbox, etc. geocoding reverse geocoding. osmdata (Padgham et al. 2017): Great downloading spatial data OpenStreetMap, via Overpass API. arcgeocoder (Hernangómez 2024): Lite interface geocoding ArcGIS REST API Service.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"nominatimlite | Connection with OSM Nominatim API","text":"Install nominatimlite CRAN: can install developing version nominatimlite : Alternatively, can install nominatimlite using r-universe:","code":"install.packages(\"nominatimlite\") remotes::install_github(\"dieghernan/nominatimlite\") # Install nominatimlite in R: install.packages(\"nominatimlite\", repos = c( \"https://dieghernan.r-universe.dev\", \"https://cloud.r-project.org\" ) )"},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"sf-objects","dir":"","previous_headings":"Usage","what":"sf objects","title":"nominatimlite | Connection with OSM Nominatim API","text":"nominatimlite can extract spatial objects easily: can also extract polygon line objects (provided Nominatim API) using option points_only = FALSE:","code":"library(nominatimlite) # Extract some points - Pizza Hut in California CA <- geo_lite_sf(\"California\", points_only = FALSE) pizzahut <- geo_lite_sf(\"Pizza Hut, California\", limit = 50, custom_query = list(countrycodes = \"us\") ) library(ggplot2) ggplot(CA) + geom_sf() + geom_sf(data = pizzahut, col = \"red\") sol_poly <- geo_lite_sf(\"Statue of Liberty, NY, USA\", points_only = FALSE) # a building - a polygon ggplot(sol_poly) + geom_sf() dayton <- geo_lite_sf(\"Dayton, OH\") # default - a point ohio_state <- geo_lite_sf(\"Ohio, USA\", points_only = FALSE) # a US state - a polygon ohio_river <- geo_lite_sf(\"Ohio river\", points_only = FALSE) # a river - a line ggplot() + geom_sf(data = ohio_state) + geom_sf(data = dayton, color = \"red\", pch = 4) + geom_sf(data = ohio_river, color = \"blue\")"},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"geocoding-and-reverse-geocoding","dir":"","previous_headings":"Usage","what":"Geocoding and reverse geocoding","title":"nominatimlite | Connection with OSM Nominatim API","text":"Note: examples adapted tidygeocoder package first example geocode addresses using geo_lite() function: latitude longitude returned geocoder service example, full_results = TRUE can used return data geocoder service. perform reverse geocoding (obtaining addresses geographic coordinates), can use reverse_geo_lite() function. arguments similar geo_lite() function, now specify input data columns lat long arguments. dataset used geocoder query . single line address returned column named address. advance users, see Nominatim docs check parameters available.","code":"library(tibble) # create a dataframe with addresses some_addresses <- tribble( ~name, ~addr, \"White House\", \"1600 Pennsylvania Ave NW, Washington, DC\", \"Transamerica Pyramid\", \"600 Montgomery St, San Francisco, CA 94111\", \"Willis Tower\", \"233 S Wacker Dr, Chicago, IL 60606\" ) # geocode the addresses lat_longs <- geo_lite(some_addresses$addr, lat = \"latitude\", long = \"longitude\") #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100% reverse <- reverse_geo_lite( lat = lat_longs$latitude, long = lat_longs$longitude, address = \"address_found\" ) #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100%"},{"path":"https://dieghernan.github.io/nominatimlite/index.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"nominatimlite | Connection with OSM Nominatim API","text":"Hernangómez D (2024). nominatimlite: Interface Nominatim API Service. doi:10.32614/CRAN.package.nominatimlite, https://dieghernan.github.io/nominatimlite/. BibTeX entry LaTeX users ","code":"@Manual{R-nominatimlite, title = {{nominatimlite}: Interface with {Nominatim} {API} Service}, doi = {10.32614/CRAN.package.nominatimlite}, author = {Diego Hernangómez}, year = {2024}, version = {0.4.1}, url = {https://dieghernan.github.io/nominatimlite/}, abstract = {Lite interface for getting data from OSM service Nominatim . Extract coordinates from addresses, find places near a set of coordinates and return spatial objects on sf format.}, }"},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2021 nominatimlite authors Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/api_call.html","id":null,"dir":"Reference","previous_headings":"","what":"Helper function for centralize API queries — api_call","title":"Helper function for centralize API queries — api_call","text":"wrapper utils::download.file(). warning error retry call. Requests adjusted rate 1 query per second. See Nominatim Usage Policy.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/api_call.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Helper function for centralize API queries — api_call","text":"","code":"api_call(url, destfile = tempfile(fileext = \".json\"), quiet)"},{"path":"https://dieghernan.github.io/nominatimlite/reference/api_call.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Helper function for centralize API queries — api_call","text":"url character string (longer vector \"libcurl\" method) naming URL resource downloaded. destfile character string (vector, see url argument) file path downloaded file saved. Tilde-expansion performed. quiet TRUE, suppress status messages (), progress bar.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/api_call.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Helper function for centralize API queries — api_call","text":"logical TRUE/FALSE.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":null,"dir":"Reference","previous_headings":"","what":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"Create sfc object coordinates bounding box.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"","code":"bbox_to_poly(bbox = NA, xmin = NA, ymin = NA, xmax = NA, ymax = NA, crs = 4326)"},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"bbox Numeric vector 4 elements representing coordinates bounding box. Values c(xmin, ymin, xmax, ymax). xmin, ymin, xmax, ymax Alternatively, can use named parameters instead bbox. crs coordinate reference system, something suitable input st_crs","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"sfc object class POLYGON.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"Bounding boxes can located using different online tools, Bounding Box Tool.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/bbox_to_poly.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Coerce a bounding box to a sfc POLYGON object — bbox_to_poly","text":"","code":"# bounding box of Germany bbox_GER <- c(5.86631529, 47.27011137, 15.04193189, 55.09916098) bbox_GER_sf <- bbox_to_poly(bbox_GER) library(ggplot2) ggplot(bbox_GER_sf) + geom_sf() # \\donttest{ # Extract the bounding box of a sf object sfobj <- geo_lite_sf(\"seychelles\", points_only = FALSE) sfobj #> Simple feature collection with 1 feature and 2 fields #> Geometry type: MULTIPOLYGON #> Dimension: XY #> Bounding box: xmin: 45.99888 ymin: -10.46493 xmax: 56.49794 ymax: -3.512 #> Geodetic CRS: WGS 84 #> # A tibble: 1 × 3 #> query address geometry #> * #> 1 seychelles Sesel (((45.99888 -9.401015, 46.00121 -9.427337, 46.00564 -9.456… # Need at least one non-empty object if (any(!sf::st_is_empty(sfobj))) { bbox <- sf::st_bbox(sfobj) bbox bbox_sfobj <- bbox_to_poly(bbox) ggplot(bbox_sfobj) + geom_sf(fill = \"lightblue\", alpha = 0.5) + geom_sf(data = sfobj, fill = \"wheat\") } # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":null,"dir":"Reference","previous_headings":"","what":"Address lookup API — geo_address_lookup","title":"Address lookup API — geo_address_lookup","text":"lookup API allows query address details one multiple OSM objects like node, way relation. function returns tibble associated query, see geo_address_lookup_sf() retrieving data spatial object (sf format).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address lookup API — geo_address_lookup","text":"","code":"geo_address_lookup( osm_ids, type = c(\"N\", \"W\", \"R\"), lat = \"lat\", long = \"lon\", full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list() )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address lookup API — geo_address_lookup","text":"osm_ids Vector OSM identifiers numeric (c(00000, 11111, 22222)). type Vector character type OSM type associated osm_ids. Possible values node (\"N\"), way (\"W\") relation (\"R\"). single value provided recycled. lat Latitude column name output data (default \"lat\"). long Longitude column name output data (default \"long\"). full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address lookup API — geo_address_lookup","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address lookup API — geo_address_lookup","text":"See https://nominatim.org/release-docs/develop/api/Lookup/ additional parameters passed custom_query.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address lookup API — geo_address_lookup","text":"","code":"# \\donttest{ ids <- geo_address_lookup(osm_ids = c(46240148, 34633854), type = \"W\") ids #> # A tibble: 2 × 4 #> query lat lon address #> #> 1 W46240148 40.8 -73.9 5th Avenue, East Harlem, Manhattan, New York County, Ci… #> 2 W34633854 40.7 -74.0 Empire State Building, 350, 5th Avenue, Manhattan Commu… several <- geo_address_lookup(c(146656, 240109189), type = c(\"R\", \"N\")) several #> # A tibble: 2 × 4 #> query lat lon address #> #> 1 R146656 53.5 -2.25 Manchester, Greater Manchester, England, United Kingdom #> 2 N240109189 52.5 13.4 Berlin, Deutschland # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Address lookup API in sf format — geo_address_lookup_sf","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"lookup API allows query address details one multiple OSM objects like node, way relation. function returns spatial object associated query using sf, see geo_address_lookup() retrieving data tibble format.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"","code":"geo_address_lookup_sf( osm_ids, type = c(\"N\", \"W\", \"R\"), full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list(), points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"osm_ids Vector OSM identifiers numeric (c(00000, 11111, 22222)). type Vector character type OSM type associated osm_ids. Possible values node (\"N\"), way (\"W\") relation (\"R\"). single value provided recycled. full_results Returns available data API service. FALSE (default) address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"See https://nominatim.org/release-docs/latest/api/Lookup/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_address_lookup_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address lookup API in sf format — geo_address_lookup_sf","text":"","code":"# \\donttest{ # Notre Dame Cathedral, Paris NotreDame <- geo_address_lookup_sf(osm_ids = 201611261, type = \"W\") # Need at least one non-empty object if (any(!sf::st_is_empty(NotreDame))) { library(ggplot2) ggplot(NotreDame) + geom_sf() } NotreDame_poly <- geo_address_lookup_sf(201611261, type = \"W\", points_only = FALSE ) if (any(!sf::st_is_empty(NotreDame_poly))) { ggplot(NotreDame_poly) + geom_sf() } # It is vectorized several <- geo_address_lookup_sf(c(146656, 240109189), type = c(\"R\", \"N\")) several #> Simple feature collection with 2 features and 2 fields #> Geometry type: POINT #> Dimension: XY #> Bounding box: xmin: -2.245115 ymin: 52.51088 xmax: 13.39894 ymax: 53.47949 #> Geodetic CRS: WGS 84 #> # A tibble: 2 × 3 #> query address geometry #> * #> 1 R146656 Manchester, Greater Manchester, England,… (-2.245115 53.47949) #> 2 N240109189 Berlin, Deutschland (13.39894 52.51088) # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":null,"dir":"Reference","previous_headings":"","what":"Geocode amenities — geo_amenity","title":"Geocode amenities — geo_amenity","text":"function search amenities defined OpenStreetMap restricted area defined bounding box form (, , , ). function returns tibble associated query, see geo_amenity_sf() retrieving data spatial object (sf format).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geocode amenities — geo_amenity","text":"","code":"geo_amenity( bbox, amenity, lat = \"lat\", long = \"lon\", limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list(), strict = FALSE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geocode amenities — geo_amenity","text":"bbox bounding box (viewbox) used limit search. : numeric vector longitude (x) latitude (y) (xmin, ymin, xmax, ymax). See Details. sf sfc object. amenity character (vector characters) amenities geolocated (.e. c(\"pub\", \"restaurant\")). See osm_amenities. lat Latitude column name output data (default \"lat\"). long Longitude column name output data (default \"long\"). limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. strict Logical TRUE/FALSE. Force results included inside bbox. Note Nominatim default behavior may return results located outside provided bounding box.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Geocode amenities — geo_amenity","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Geocode amenities — geo_amenity","text":"Bounding boxes can located using different online tools, Bounding Box Tool. full list valid amenities see https://wiki.openstreetmap.org/wiki/Key:amenity osm_amenities. See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Geocode amenities — geo_amenity","text":"","code":"# \\donttest{ # Times Square, NY, USA bbox <- c( -73.9894467311, 40.75573629, -73.9830630737, 40.75789245 ) geo_amenity( bbox = bbox, amenity = \"restaurant\" ) #> # A tibble: 1 × 4 #> query lat lon address #> #> 1 restaurant 40.8 -74.0 Amor Loco, 134, West 46th Street, Manhattan Community … # Several amenities geo_amenity( bbox = bbox, amenity = c(\"restaurant\", \"pub\") ) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 2 × 4 #> query lat lon address #> #> 1 restaurant 40.8 -74.0 Amor Loco, 134, West 46th Street, Manhattan Community … #> 2 pub 40.8 -74.0 Connolly's, 121, West 45th Street, Manhattan Community… # Increase limit and use with strict geo_amenity( bbox = bbox, amenity = c(\"restaurant\", \"pub\"), limit = 10, strict = TRUE ) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 17 × 4 #> query lat lon address #> #> 1 restaurant 40.8 -74.0 Sardi's, 234, West 44th Street, Manhattan Community B… #> 2 restaurant 40.8 -74.0 bella vita tranttoria, 211, West 43rd Street, Manhatt… #> 3 restaurant 40.8 -74.0 Amor Loco, 134, West 46th Street, Manhattan Community… #> 4 restaurant 40.8 -74.0 Dave & Buster's, 234, West 42nd Street, Manhattan Com… #> 5 restaurant 40.8 -74.0 Applebee's, 234, West 42nd Street, Manhattan Communit… #> 6 restaurant 40.8 -74.0 Planet Hollywood, 1540, Broadway, Manhattan Community… #> 7 restaurant 40.8 -74.0 Dallas BBQ, 241, West 42nd Street, Manhattan Communit… #> 8 restaurant 40.8 -74.0 Villa Fresh Italian Kitchen, 263, West 42nd Street, M… #> 9 restaurant 40.8 -74.0 Haru Sushi, 229, West 43rd Street, Manhattan Communit… #> 10 restaurant 40.8 -74.0 Brooklyn Deli, 1501, Broadway, Manhattan Community Bo… #> 11 pub 40.8 -74.0 Connolly's, 121, West 45th Street, Manhattan Communit… #> 12 pub 40.8 -74.0 Perfect Pint, 123, West 45th Street, Manhattan Commun… #> 13 pub 40.8 -74.0 Bar 54, 141, West 44th Street, Manhattan Community Bo… #> 14 pub 40.8 -74.0 O'Lunney's, 145, West 45th Street, Manhattan Communit… #> 15 pub 40.8 -74.0 O'Donoghue's, 156, West 44th Street, Manhattan Commun… #> 16 pub 40.8 -74.0 Jimmy's Corner, 140, West 44th Street, Manhattan Comm… #> 17 pub 40.8 -74.0 BXL Cafe, 125, West 43rd Street, Manhattan Community … # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Geocode amenities in sf format — geo_amenity_sf","title":"Geocode amenities in sf format — geo_amenity_sf","text":"function search amenities defined OpenStreetMap restricted area defined bounding box form (, , , ). function returns spatial object associated query using sf, see geo_amenity() retrieving data tibble format.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Geocode amenities in sf format — geo_amenity_sf","text":"","code":"geo_amenity_sf( bbox, amenity, limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list(), strict = FALSE, points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Geocode amenities in sf format — geo_amenity_sf","text":"bbox bounding box (viewbox) used limit search. : numeric vector longitude (x) latitude (y) (xmin, ymin, xmax, ymax). See Details. sf sfc object. amenity character (vector characters) amenities geolocated (.e. c(\"pub\", \"restaurant\")). See osm_amenities. limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. strict Logical TRUE/FALSE. Force results included inside bbox. Note Nominatim default behavior may return results located outside provided bounding box. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Geocode amenities in sf format — geo_amenity_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Geocode amenities in sf format — geo_amenity_sf","text":"Bounding boxes can located using different online tools, Bounding Box Tool. full list valid amenities see https://wiki.openstreetmap.org/wiki/Key:amenity osm_amenities. See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Geocode amenities in sf format — geo_amenity_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_amenity_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Geocode amenities in sf format — geo_amenity_sf","text":"","code":"# \\donttest{ # Usera, Madrid library(ggplot2) mad <- geo_lite_sf(\"Usera, Madrid, Spain\", points_only = FALSE) # Restaurants, pubs and schools rest_pub <- geo_amenity_sf(mad, c(\"restaurant\", \"pub\", \"school\"), limit = 50 ) #> | | | 0% | |================= | 33% | |================================= | 67% | |==================================================| 100% if (any(!sf::st_is_empty(rest_pub))) { ggplot(mad) + geom_sf() + geom_sf(data = rest_pub, aes(color = query, shape = query)) } # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":null,"dir":"Reference","previous_headings":"","what":"Address search API (free-form query) — geo_lite","title":"Address search API (free-form query) — geo_lite","text":"Geocodes addresses given character values. function returns tibble associated query, see geo_lite_sf() retrieving data spatial object (sf format). function correspond free-form query search described API endpoint.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address search API (free-form query) — geo_lite","text":"","code":"geo_lite( address, lat = \"lat\", long = \"lon\", limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list() )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address search API (free-form query) — geo_lite","text":"address character single line address, e.g. (\"1600 Pennsylvania Ave NW, Washington\") vector addresses (c(\"Madrid\", \"Barcelona\")). lat Latitude column name output data (default \"lat\"). long Longitude column name output data (default \"long\"). limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address search API (free-form query) — geo_lite","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address search API (free-form query) — geo_lite","text":"See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address search API (free-form query) — geo_lite","text":"","code":"# \\donttest{ geo_lite(\"Madrid, Spain\") #> # A tibble: 1 × 4 #> query lat lon address #> #> 1 Madrid, Spain 40.4 -3.70 Madrid, Comunidad de Madrid, España # Several addresses geo_lite(c(\"Madrid\", \"Barcelona\")) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 2 × 4 #> query lat lon address #> #> 1 Madrid 40.4 -3.70 Madrid, Comunidad de Madrid, España #> 2 Barcelona 41.4 2.18 Barcelona, Barcelonès, Barcelona, Catalunya, España # With options: restrict search to USA geo_lite(c(\"Madrid\", \"Barcelona\"), custom_query = list(countrycodes = \"US\"), full_results = TRUE ) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 2 × 25 #> query lat lon address place_id licence osm_type osm_id category type #> #> 1 Madrid 41.9 -93.8 Madrid… 3.44e8 Data ©… relation 1.29e5 boundary admi… #> 2 Barcelona 37.7 -121. Barcel… 2.99e8 Data ©… node 9.63e9 place neig… #> # ℹ 15 more variables: place_rank , importance , addresstype , #> # name , display_name , address.village , #> # address.county , address.state , `address.ISO3166-2-lvl4` , #> # address.country , address.country_code , boundingbox , #> # address.neighbourhood , address.city , address.postcode # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Address search API in sf format (free-form query) — geo_lite_sf","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"function allows geocode addresses returns corresponding spatial object. function returns spatial object associated query using sf, see geo_lite() retrieving data tibble format. function correspond free-form query search described API endpoint.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"","code":"geo_lite_sf( address, limit = 1, return_addresses = TRUE, full_results = FALSE, verbose = FALSE, progressbar = TRUE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list(), points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"address character single line address, e.g. (\"1600 Pennsylvania Ave NW, Washington\") vector addresses (c(\"Madrid\", \"Barcelona\")). limit Maximum number results return per input address. Note query returns maximum 50 results. return_addresses Return input addresses results TRUE. full_results Returns available data API service. FALSE (default) address columns returned. See also return_addresses. verbose TRUE detailed logs output console. progressbar Logical. TRUE displays progress bar indicate progress function. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address search API in sf format (free-form query) — geo_lite_sf","text":"","code":"# \\donttest{ # Map - Points library(ggplot2) string <- \"Statue of Liberty, NY, USA\" sol <- geo_lite_sf(string) if (any(!sf::st_is_empty(sol))) { ggplot(sol) + geom_sf() } sol_poly <- geo_lite_sf(string, points_only = FALSE) if (any(!sf::st_is_empty(sol_poly))) { ggplot(sol_poly) + geom_sf() + geom_sf(data = sol, color = \"red\") } # Several results madrid <- geo_lite_sf(\"Comunidad de Madrid, Spain\", limit = 2, points_only = FALSE, full_results = TRUE ) if (any(!sf::st_is_empty(madrid))) { ggplot(madrid) + geom_sf(fill = NA) } # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":null,"dir":"Reference","previous_headings":"","what":"Address search API (structured query) — geo_lite_struct","title":"Address search API (structured query) — geo_lite_struct","text":"Geocodes addresses already split components. function returns tibble associated query, see geo_lite_struct_sf() retrieving data spatial object (sf format). function correspond structured query search described API endpoint. performing free-form search use geo_lite().","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address search API (structured query) — geo_lite_struct","text":"","code":"geo_lite_struct( amenity = NULL, street = NULL, city = NULL, county = NULL, state = NULL, country = NULL, postalcode = NULL, lat = \"lat\", long = \"lon\", limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list() )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address search API (structured query) — geo_lite_struct","text":"amenity Name /type POI, see also geo_amenity. street House number street name. city City. county County. state State. country Country. postalcode Postal Code. lat Latitude column name output data (default \"lat\"). long Longitude column name output data (default \"long\"). limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address search API (structured query) — geo_lite_struct","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address search API (structured query) — geo_lite_struct","text":"structured form search query allows look address already split components. parameter represents field address. parameters optional. use ones relevant address want geocode. See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address search API (structured query) — geo_lite_struct","text":"","code":"# \\donttest{ pl_mayor <- geo_lite_struct( street = \"Plaza Mayor\", country = \"Spain\", limit = 50, full_results = TRUE ) dplyr::glimpse(pl_mayor) #> Rows: 32 #> Columns: 43 #> $ q_amenity NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ q_street \"Plaza Mayor\", \"Plaza Mayor\", \"Plaza Mayor\", … #> $ q_city NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ q_county NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ q_state NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ q_country \"Spain\", \"Spain\", \"Spain\", \"Spain\", \"Spain\", … #> $ q_postalcode NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ lat 40.41539, 40.96503, 41.65206, 36.65621, 36.65… #> $ lon -3.7069974, -5.6640558, -4.7285484, -4.480330… #> $ address \"Plaza Mayor, Túnel de la Plaza Mayor, Barrio… #> $ place_id 270939058, 270518370, 270013255, 273036660, 2… #> $ licence \"Data © OpenStreetMap contributors, ODbL 1.0.… #> $ osm_type \"relation\", \"way\", \"way\", \"node\", \"node\", \"wa… #> $ osm_id 16657232, 78180390, 24432960, 11715993300, 75… #> $ category \"tourism\", \"highway\", \"tourism\", \"railway\", \"… #> $ type \"attraction\", \"pedestrian\", \"attraction\", \"ha… #> $ place_rank 30, 26, 30, 30, 30, 26, 26, 30, 26, 26, 26, 3… #> $ importance 0.43955427, 0.37221179, 0.32357442, 0.2548236… #> $ addresstype \"tourism\", \"road\", \"tourism\", \"railway\", \"rai… #> $ name \"Plaza Mayor\", \"Plaza Mayor\", \"Plaza Mayor\", … #> $ display_name \"Plaza Mayor, Túnel de la Plaza Mayor, Barrio… #> $ address.tourism \"Plaza Mayor\", NA, \"Plaza Mayor\", NA, NA, NA,… #> $ address.road \"Túnel de la Plaza Mayor\", \"Plaza Mayor\", \"Ca… #> $ address.neighbourhood \"Barrio de los Austrias\", NA, NA, NA, NA, NA,… #> $ address.quarter \"Sol\", NA, NA, NA, NA, \"El Berrocal\", NA, NA,… #> $ address.city_district \"Centro\", \"Centro\", NA, NA, NA, NA, NA, NA, N… #> $ address.city \"Madrid\", \"Salamanca\", \"Valladolid\", \"Málaga\"… #> $ address.state \"Comunidad de Madrid\", \"Castilla y León\", \"Ca… #> $ `address.ISO3166-2-lvl4` \"ES-MD\", \"ES-CL\", \"ES-CL\", \"ES-AN\", \"ES-AN\", … #> $ address.postcode \"28012\", \"37002\", \"47001\", \"29140\", \"29140\", … #> $ address.country \"España\", \"España\", \"España\", \"España\", \"Espa… #> $ address.country_code \"es\", \"es\", \"es\", \"es\", \"es\", \"es\", \"es\", \"es… #> $ address.province NA, \"Salamanca\", \"Valladolid\", \"Málaga\", \"Mál… #> $ `address.ISO3166-2-lvl6` NA, \"ES-SA\", \"ES-VA\", \"ES-MA\", \"ES-MA\", \"ES-C… #> $ address.suburb NA, NA, \"Plaza Mayor\", NA, NA, NA, \"San Loren… #> $ address.railway NA, NA, NA, \"Plaza Mayor\", \"Plaza Mayor\", NA,… #> $ address.retail NA, NA, NA, \"Plaza Mayor\", \"Plaza Mayor\", NA,… #> $ address.borough NA, NA, NA, \"Churriana\", \"Churriana\", NA, NA,… #> $ address.county NA, NA, NA, \"Málaga-Costa del Sol\", \"Málaga-C… #> $ address.town NA, NA, NA, NA, NA, \"Plasencia\", NA, \"Vic\", N… #> $ address.region NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, \"l'Al… #> $ address.village NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, N… #> $ boundingbox <40.414988, 40.415813, -3.708121, -3.706630>… # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Address search API in sf format (structured query) — geo_lite_struct_sf","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"Geocodes addresses already split components return corresponding spatial object. function returns spatial object associated query using sf, see geo_lite_struct() retrieving data tibble format. function correspond structured query search described API endpoint. performing free-form search use geo_lite_sf().","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"","code":"geo_lite_struct_sf( amenity = NULL, street = NULL, city = NULL, county = NULL, state = NULL, country = NULL, postalcode = NULL, limit = 1, full_results = FALSE, return_addresses = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", custom_query = list(), points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"amenity Name /type POI, see also geo_amenity. street House number street name. city City. county County. state State. country Country. postalcode Postal Code. limit Maximum number results return per input address. Note query returns maximum 50 results. full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_addresses Return input addresses results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". custom_query named list API-specific parameters used (.e. list(countrycodes = \"US\")). See Details. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"structured form search query allows look address already split components. parameter represents field address. parameters optional. use ones relevant address want geocode. See https://nominatim.org/release-docs/latest/api/Search/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/geo_lite_struct_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Address search API in sf format (structured query) — geo_lite_struct_sf","text":"","code":"# \\donttest{ # Map pl_mayor <- geo_lite_struct_sf( street = \"Plaza Mayor\", county = \"Comunidad de Madrid\", country = \"Spain\", limit = 50, full_results = TRUE, verbose = TRUE ) # Outline ccaa <- geo_lite_sf(\"Comunidad de Madrid, Spain\", points_only = FALSE) library(ggplot2) if (any(!sf::st_is_empty(pl_mayor), !sf::st_is_empty(ccaa))) { ggplot(ccaa) + geom_sf() + geom_sf(data = pl_mayor, aes(shape = addresstype, color = addresstype)) } # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatimlite-package.html","id":null,"dir":"Reference","previous_headings":"","what":"nominatimlite: Interface with 'Nominatim' API Service — nominatimlite-package","title":"nominatimlite: Interface with 'Nominatim' API Service — nominatimlite-package","text":"Lite interface getting data 'OSM' service 'Nominatim' https://nominatim.org/release-docs/latest/. Extract coordinates addresses, find places near set coordinates return spatial objects 'sf' format.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatimlite-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"nominatimlite: Interface with 'Nominatim' API Service — nominatimlite-package","text":"Maintainer: Diego Hernangómez diego.hernangomezherrero@gmail.com (ORCID) [copyright holder] contributors: Jindra Lacko (ORCID) [contributor, reviewer] Alex White [contributor] OpenStreetMap (data) [copyright holder]","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":null,"dir":"Reference","previous_headings":"","what":"Check access to Nominatim API — nominatim_check_access","title":"Check access to Nominatim API — nominatim_check_access","text":"Check R access resources https://nominatim.openstreetmap.org.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check access to Nominatim API — nominatim_check_access","text":"","code":"nominatim_check_access( nominatim_server = \"https://nominatim.openstreetmap.org/\" )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check access to Nominatim API — nominatim_check_access","text":"nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\".","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check access to Nominatim API — nominatim_check_access","text":"logical TRUE/FALSE.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/nominatim_check_access.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check access to Nominatim API — nominatim_check_access","text":"","code":"# \\donttest{ nominatim_check_access() #> [1] TRUE # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":null,"dir":"Reference","previous_headings":"","what":"OpenStreetMap amenity database — osm_amenities","title":"OpenStreetMap amenity database — osm_amenities","text":"Database list amenities available OpenStreetMap.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"OpenStreetMap amenity database — osm_amenities","text":"tibble 136 rows fields: category category amenity. amenity value amenity. comment brief description type amenity.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"OpenStreetMap amenity database — osm_amenities","text":"https://wiki.openstreetmap.org/wiki/Key:amenity","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"OpenStreetMap amenity database — osm_amenities","text":"Data extracted 03 April 2024.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/osm_amenities.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"OpenStreetMap amenity database — osm_amenities","text":"","code":"data(\"osm_amenities\") osm_amenities #> # A tibble: 136 × 3 #> category amenity comment #> #> 1 Sustenance bar Bar is a purpose-built commercial establishment th… #> 2 Sustenance biergarten Biergarten or beer garden is an open-air area wher… #> 3 Sustenance cafe Cafe is generally an informal place that offers ca… #> 4 Sustenance fast_food Fast food restaurant (see also amenity=restaurant)… #> 5 Sustenance food_court An area with several different restaurant food cou… #> 6 Sustenance ice_cream Ice cream shop or ice cream parlour. A place that … #> 7 Sustenance pub A place selling beer and other alcoholic drinks; m… #> 8 Sustenance restaurant Restaurant (not fast food, see amenity=fast_food).… #> 9 Education college Campus or buildings of an institute of Further Edu… #> 10 Education dancing_school A dancing school or dance studio #> # ℹ 126 more rows"},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse geocoding API — reverse_geo_lite","title":"Reverse geocoding API — reverse_geo_lite","text":"Generates address latitude longitude. Latitudes must \\(\\left[-90, 90 \\right]\\) longitudes \\(\\left[-180, 180 \\right]\\). function returns tibble associated query, see reverse_geo_lite_sf() retrieving data spatial object (sf format).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse geocoding API — reverse_geo_lite","text":"","code":"reverse_geo_lite( lat, long, address = \"address\", full_results = FALSE, return_coords = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list() )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reverse geocoding API — reverse_geo_lite","text":"lat Latitude values numeric format. Must range \\(\\left[-90, 90 \\right]\\). long Longitude values numeric format. Must range \\(\\left[-180, 180 \\right]\\). address Address column name output data (default \"address\"). full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_coords Return input coordinates results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query API-specific parameters used, passed named list (ie. list(zoom = 3)). See Details.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reverse geocoding API — reverse_geo_lite","text":"tibble results found query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Reverse geocoding API — reverse_geo_lite","text":"See https://nominatim.org/release-docs/develop/api/Reverse/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"about-zooming","dir":"Reference","previous_headings":"","what":"About Zooming","title":"Reverse geocoding API — reverse_geo_lite","text":"Use option custom_query = list(zoom = 3) adjust output. equivalences terms zoom:","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse geocoding API — reverse_geo_lite","text":"","code":"# \\donttest{ reverse_geo_lite(lat = 40.75728, long = -73.98586) #> # A tibble: 1 × 3 #> address lat lon #> #> 1 Times Square, 7th Avenue, Manhattan Community Board 5, Manhattan,… 40.8 -74.0 # Several coordinates reverse_geo_lite(lat = c(40.75728, 55.95335), long = c(-73.98586, -3.188375)) #> | | | 0% | |========================= | 50% | |==================================================| 100% #> # A tibble: 2 × 3 #> address lat lon #> #> 1 Times Square, 7th Avenue, Manhattan Community Board 5, Manhattan… 40.8 -74.0 #> 2 Edinburgh Distance Marker, Waterloo Place, Greenside, New Town/B… 56.0 -3.19 # With options: zoom to country level sev <- reverse_geo_lite( lat = c(40.75728, 55.95335), long = c(-73.98586, -3.188375), custom_query = list(zoom = 0, extratags = TRUE), verbose = TRUE, full_results = TRUE ) #> | | | 0% | |========================= | 50% | |==================================================| 100% dplyr::glimpse(sev) #> Rows: 2 #> Columns: 51 #> $ address \"United States\", \"United King… #> $ lat 39.78373, 54.70235 #> $ lon -100.445882, -3.276575 #> $ place_id 46583304, 254352942 #> $ licence \"Data © OpenStreetMap contrib… #> $ osm_type \"relation\", \"relation\" #> $ osm_id 148838, 62149 #> $ category \"boundary\", \"boundary\" #> $ type \"administrative\", \"administra… #> $ place_rank 4, 4 #> $ importance 1.000000, 0.929957 #> $ addresstype \"country\", \"country\" #> $ name \"United States\", \"United King… #> $ display_name \"United States\", \"United King… #> $ address.country \"United States\", \"United King… #> $ address.country_code \"us\", \"gb\" #> $ extratags.flag \"https://upload.wikimedia.org… #> $ extratags.sqkm \"9826675\", \"243610\" #> $ extratags.wikidata \"Q30\", \"Q145\" #> $ extratags.wikipedia \"en:United States\", \"en:Unite… #> $ extratags.check_date \"2024-10-17\", NA #> $ extratags.population \"331449281\", \"61792000\" #> $ extratags.border_type \"national\", NA #> $ `extratags.abbr_name:en` \"U.S.A\", NA #> $ extratags.capital_city \"Washington DC\", NA #> $ extratags.driving_side \"right\", \"left\" #> $ extratags.linked_place \"country\", \"country\" #> $ `extratags.contact:website` \"https://www.usa.gov\", NA #> $ `extratags.population:date` \"2020\", NA #> $ `extratags.ISO3166-1:alpha2` \"US\", \"GB\" #> $ `extratags.ISO3166-1:alpha3` \"USA\", \"GBR\" #> $ extratags.default_language \"en\", \"en\" #> $ `extratags.ISO3166-1:numeric` \"840\", \"826\" #> $ `extratags.alt_short_name:en` \"US\", NA #> $ `extratags.alt_short_name:pl` \"St. Zj.\", NA #> $ extratags.country_code_fips \"US\", NA #> $ `extratags.old_short_name:ru` \"САСШ\", NA #> $ `extratags.source:population` \"census.gov\", \"http://www.sta… #> $ `extratags.alt_official_name:en` \"The United States of America… #> $ `extratags.not:official_name:vi` \"Hợp chủng quốc Hoa Kỳ;Hợp ch… #> $ extratags.country_code_iso3166_1_alpha_2 \"US\", NA #> $ boundingbox <-14.76084, 71.58895, -180.00… #> $ `extratags.ref:gss` NA, \"K02000001\" #> $ extratags.currency NA, \"GBP\" #> $ extratags.timezone NA, \"Europe/London\" #> $ extratags.native_name NA, \"United Kingdom of Great … #> $ `extratags.source:sqkm` NA, \"CIA World Factbook\" #> $ `extratags.native_name:da` NA, \"Det Forenede Kongerige S… #> $ `extratags.native_name:es` NA, \"Reino Unido de Gran Bret… #> $ `extratags.native_name:vi` NA, \"Vương quốc Liên hiệp Anh… #> $ `extratags.source:ref:gss` NA, \"ONS_OpenData\" # }"},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":null,"dir":"Reference","previous_headings":"","what":"Reverse geocoding API in sf format — reverse_geo_lite_sf","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"Generates address latitude longitude. Latitudes must \\(\\left[-90, 90 \\right]\\) longitudes \\(\\left[-180, 180 \\right]\\). function returns spatial object associated query using sf, see reverse_geo_lite() retrieving data tibble format.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"","code":"reverse_geo_lite_sf( lat, long, address = \"address\", full_results = FALSE, return_coords = TRUE, verbose = FALSE, nominatim_server = \"https://nominatim.openstreetmap.org/\", progressbar = TRUE, custom_query = list(), points_only = TRUE )"},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"lat Latitude values numeric format. Must range \\(\\left[-90, 90 \\right]\\). long Longitude values numeric format. Must range \\(\\left[-180, 180 \\right]\\). address Address column name output data (default \"address\"). full_results Returns available data API service. FALSE (default) latitude, longitude address columns returned. See also return_addresses. return_coords Return input coordinates results TRUE. verbose TRUE detailed logs output console. nominatim_server URL Nominatim server use. Defaults \"https://nominatim.openstreetmap.org/\". progressbar Logical. TRUE displays progress bar indicate progress function. custom_query API-specific parameters used, passed named list (ie. list(zoom = 3)). See Details. points_only Logical TRUE/FALSE. Whether return spatial points (TRUE, default) potentially shapes provided Nominatim API (FALSE). See Geometry Types.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"sf object results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"See https://nominatim.org/release-docs/develop/api/Reverse/ additional parameters passed custom_query.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"about-zooming","dir":"Reference","previous_headings":"","what":"About Zooming","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"Use option custom_query = list(zoom = 3) adjust output. equivalences terms zoom:","code":""},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"about-geometry-types","dir":"Reference","previous_headings":"","what":"About Geometry Types","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"parameter points_only specifies whether function results points (Nominatim results guaranteed least point geometry) possibly spatial objects. Note type geometry returned case points_only = FALSE depend object geocoded: Administrative areas, major buildings like returned polygons. Rivers, roads like lines. Amenities may points even case points_only = FALSE call. function vectorized, allowing multiple addresses geocoded; case points_only = FALSE multiple geometry types may returned.","code":""},{"path":[]},{"path":"https://dieghernan.github.io/nominatimlite/reference/reverse_geo_lite_sf.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Reverse geocoding API in sf format — reverse_geo_lite_sf","text":"","code":"# \\donttest{ library(ggplot2) # Coliseum coords col_lon <- 12.49309 col_lat <- 41.89026 # Coliseum as polygon col_sf <- reverse_geo_lite_sf( lat = col_lat, lon = col_lon, points_only = FALSE ) dplyr::glimpse(col_sf) #> Rows: 1 #> Columns: 4 #> $ address \"Colosseo, Piazza del Colosseo, Celio, Municipio Roma I, Roma… #> $ lat 41.89026 #> $ lon 12.49309 #> $ geometry POLYGON ((12.4913 41.89058,... if (any(!sf::st_is_empty(col_sf))) { ggplot(col_sf) + geom_sf() } # City of Rome - same coords with zoom 10 rome_sf <- reverse_geo_lite_sf( lat = col_lat, lon = col_lon, custom_query = list(zoom = 10), points_only = FALSE ) dplyr::glimpse(rome_sf) #> Rows: 1 #> Columns: 4 #> $ address \"Roma, Roma Capitale, Lazio, Italia\" #> $ lat 41.89026 #> $ lon 12.49309 #> $ geometry MULTIPOLYGON (((12.23447 41... if (any(!sf::st_is_empty(rome_sf))) { ggplot(rome_sf) + geom_sf() } # }"},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-041","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.4.1","title":"nominatimlite 0.4.1","text":"CRAN release: 2024-07-19 Fix input validation geo_address_lookup() geo_address_lookup_sf() crashes function OSM ID long (#47 reported @lshydro).","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-040","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.4.0","title":"nominatimlite 0.4.0","text":"CRAN release: 2024-05-27 New functions: geo_lite_struct() geo_lite_struct_sf() performing structured queries. Bring back geo_amenity() geo_amenity_sf() wrapper geo_lite_struct() / geo_lite_struct_sf(), now robust compatible sf objects. Improve unnesting fields requiring extratags, .e. custom_query = list(extratags = TRUE). possible use nominatimlite local server thanks new argument nominatim_server (#42 @alexwhitedatamine). Adapt endpoints Nominatim v4.4.0 [Python-]. nominatimlite::osm_amenities data set re-introduced, updated additional description fields. API call non-spatial function uses now JSONV2 format (&format=jsonv2). implies following changes output: class renamed category. additional field place_rank search rank object. custom_query argument can use vectors logical:","code":"geo_lite(address = \"New York\", custom_query = list(addressdetails = TRUE, viewbox = c(-60, -20, 60, 20)) )"},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-030","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.3.0","title":"nominatimlite 0.3.0","text":"CRAN release: 2024-03-01 Add progressbar parameter geo_lite(), geo_lite_sf(), reverse_geo_lite() reverse_geo_lite_sf() display progress console.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"deprecated-0-3-0","dir":"Changelog","previous_headings":"","what":"Deprecated","title":"nominatimlite 0.3.0","text":"geo_amenity() geo_amenity_sf(), see Nominatim/issues/1311. Use arcgeocoder::arc_geo_categories() alternative. nominatimlite::osm_amenities data set deleted.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-021","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.2.1","title":"nominatimlite 0.2.1","text":"CRAN release: 2023-08-15 Remove osmdata Suggests. Fix examples.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-020","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.2.0","title":"nominatimlite 0.2.0","text":"CRAN release: 2023-05-11 rlang tibble explicitly required. Conversions tibble happens dplyr::tibble(). data attributes sf objects returned now tibble, easy printing console. Improvements code tests. Now sf objects can handle correctly nested fields provided json response (example, nested address field provided API). consistent also results provided non-spatial functions, unnesting already handled correctly. Improvements output reverse_geo_lite() reverse_geo_lite_sf() API returns nested lists.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-016","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.6","title":"nominatimlite 0.1.6","text":"CRAN release: 2022-06-10 Improve results response API.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-015","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.5","title":"nominatimlite 0.1.5","text":"CRAN release: 2021-11-26 Avoid de-duplication results.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-014","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.4","title":"nominatimlite 0.1.4","text":"CRAN release: 2021-10-28 Fix issues geo_amenity() geo_amenity_sf().","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-013","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.3","title":"nominatimlite 0.1.3","text":"CRAN release: 2021-10-21 Skip API query tests CRAN avoid false positives. Centralize API queries (internal) function api_call(). Queries fully honors now Nominatim Usage Policy. Queries may slower now.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-012","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.2","title":"nominatimlite 0.1.2","text":"CRAN release: 2021-10-07 New internal: nominatim_check_access(). Adapt tests testthat v3.1.0.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-011","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.1","title":"nominatimlite 0.1.1","text":"CRAN release: 2021-09-30 Adapt tests CRAN checks.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-010","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.1.0","title":"nominatimlite 0.1.0","text":"CRAN release: 2021-09-16 CRAN release. Adjust query rate limits Nominatim policy. New strict argument geo_amenity() geo_amenity_sf(). Parameter polygon changed points_only (#8) thanks @jlacko. Package now falls gracefully url reachable.","code":""},{"path":"https://dieghernan.github.io/nominatimlite/news/index.html","id":"nominatimlite-001","dir":"Changelog","previous_headings":"","what":"nominatimlite 0.0.1","title":"nominatimlite 0.0.1","text":"Initial version package","code":""}]

address_found