diff --git a/CITATION.cff b/CITATION.cff index 887791c3..603a3080 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -8,7 +8,7 @@ message: 'To cite package "nominatimlite" in publications use:' type: software license: MIT title: 'nominatimlite: Interface with ''Nominatim'' API Service' -version: 0.1.6.9000 +version: 0.2.0 doi: 10.5281/zenodo.5113195 abstract: Lite interface for getting data from 'OSM' service 'Nominatim' . Extract coordinates from addresses, find places near a set of coordinates, search @@ -27,7 +27,7 @@ preferred-citation: email: diego.hernangomezherrero@gmail.com orcid: https://orcid.org/0000-0001-8457-4658 year: '2023' - version: 0.1.6.9000 + version: 0.2.0 doi: 10.5281/zenodo.5113195 url: https://dieghernan.github.io/nominatimlite/ abstract: Lite interface for getting data from OSM service Nominatim . diff --git a/DESCRIPTION b/DESCRIPTION index 11a14f1c..d07324d4 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: nominatimlite Title: Interface with 'Nominatim' API Service -Version: 0.1.6.9000 +Version: 0.2.0 Authors@R: c( person("Diego", "Hernangómez", , "diego.hernangomezherrero@gmail.com", role = c("aut", "cre", "cph"), comment = c(ORCID = "0000-0001-8457-4658")), diff --git a/NEWS.md b/NEWS.md index 22ecb532..4a25ff26 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# nominatimlite (development version) +# nominatimlite 0.2.0 - **rlang** and **tibble** are not explicitly required. Conversions to tibble happens with `dplyr::tibble()`. diff --git a/R/bbox_to_poly.R b/R/bbox_to_poly.R index a81e0e96..e5862726 100644 --- a/R/bbox_to_poly.R +++ b/R/bbox_to_poly.R @@ -37,16 +37,19 @@ #' geom_sf() #' \donttest{ #' # Extract the bounding box of a sf object -#' Texas <- geo_lite_sf("Texas", points_only = FALSE) -#' bbox <- sf::st_bbox(Texas) +#' sfobj <- geo_lite_sf("seychelles", points_only = FALSE) +#' +#' sfobj +#' +#' bbox <- sf::st_bbox(sfobj) #' #' bbox #' -#' bbox_Texas <- bbox_to_poly(bbox) +#' bbox_sfobj <- bbox_to_poly(bbox) #' -#' ggplot(bbox_Texas) + -#' geom_sf(col = "red") + -#' geom_sf(data = Texas) +#' ggplot(bbox_sfobj) + +#' geom_sf(fill = "lightblue", alpha = 0.5) + +#' geom_sf(data = sfobj, fill = "wheat") #' } #' @export diff --git a/README.md b/README.md index 41d5b2c2..005e9699 100644 --- a/README.md +++ b/README.md @@ -160,11 +160,11 @@ Only 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. -| query | latitude | longitude | address | -|:-------------------------------------------|---------:|-----------:|:--------------------------------------------------------------------------------------------------------------------------------------------| -| 1600 Pennsylvania Ave NW, Washington, DC | 38.89770 | -77.03655 | White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | -| 600 Montgomery St, San Francisco, CA 94111 | 37.79520 | -122.40279 | Transamerica Pyramid, 600, Montgomery Street, Financial District, San Francisco, CAL Fire Northern Region, California, 94111, United States | -| 233 S Wacker Dr, Chicago, IL 60606 | 41.87887 | -87.63591 | Willis Tower, 233, South Wacker Drive, Printer’s Row, Loop, Chicago, Cook County, Illinois, 60606, United States | +| query | latitude | longitude | address | +|:-------------------------------------------|---------:|-----------:|:------------------------------------------------------------------------------------------------------------------| +| 1600 Pennsylvania Ave NW, Washington, DC | 38.89770 | -77.03655 | White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | +| 600 Montgomery St, San Francisco, CA 94111 | 37.79520 | -122.40279 | Transamerica Pyramid, 600, Montgomery Street, Financial District, San Francisco, California, 94111, United States | +| 233 S Wacker Dr, Chicago, IL 60606 | 41.87887 | -87.63591 | Willis Tower, 233, South Wacker Drive, Printer’s Row, Loop, Chicago, Cook County, Illinois, 60606, United States | To perform reverse geocoding (obtaining addresses from geographic coordinates), we can use the `reverse_geo_lite()` function. The @@ -180,11 +180,11 @@ reverse <- reverse_geo_lite( ) ``` -| address_found | lat | lon | -|:--------------------------------------------------------------------------------------------------------------------------------------------|---------:|-----------:| -| White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | 38.89770 | -77.03655 | -| Transamerica Pyramid, 600, Montgomery Street, Financial District, San Francisco, CAL Fire Northern Region, California, 94111, United States | 37.79520 | -122.40279 | -| Willis Tower, 233, South Wacker Drive, Printer’s Row, Loop, Chicago, Cook County, Illinois, 60606, United States | 41.87887 | -87.63591 | +| address_found | lat | lon | +|:------------------------------------------------------------------------------------------------------------------|---------:|-----------:| +| White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | 38.89770 | -77.03655 | +| Transamerica Pyramid, 600, Montgomery Street, Financial District, San Francisco, California, 94111, United States | 37.79520 | -122.40279 | +| Willis Tower, West Adams Street, Printer’s Row, Loop, Chicago, Cook County, Illinois, 60606, United States | 41.87874 | -87.63602 | For more advance users, see [Nominatim docs](https://nominatim.org/release-docs/latest/api/Search/) to check @@ -204,7 +204,7 @@ A BibTeX entry for LaTeX users is title = {nominatimlite: Interface with 'Nominatim' API Service}, author = {Diego Hernangómez}, year = {2023}, - version = {0.1.6.9000}, + version = {0.2.0}, doi = {10.5281/zenodo.5113195}, 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, search for amenities and return spatial objects on sf format.}, diff --git a/codemeta.json b/codemeta.json index 704def21..36c3f606 100644 --- a/codemeta.json +++ b/codemeta.json @@ -8,13 +8,13 @@ "codeRepository": "https://github.com/dieghernan/nominatimlite", "issueTracker": "https://github.com/dieghernan/nominatimlite/issues", "license": "https://spdx.org/licenses/MIT", - "version": "0.1.6.9000", + "version": "0.2.0", "programmingLanguage": { "@type": "ComputerLanguage", "name": "R", "url": "https://r-project.org" }, - "runtimePlatform": "R version 4.3.0 (2023-04-21)", + "runtimePlatform": "R version 4.3.0 (2023-04-21 ucrt)", "provider": { "@id": "https://cran.r-project.org", "@type": "Organization", @@ -186,7 +186,7 @@ }, "applicationCategory": "cartography", "keywords": ["r", "geocoding", "openstreetmap", "address", "nominatim", "reverse-geocoding", "rstats", "shapefile", "r-package", "spatial", "cran", "api-wrapper", "api", "gis"], - "fileSize": "308.268KB", + "fileSize": "311.194KB", "citation": [ { "@type": "SoftwareSourceCode", diff --git a/data/osm_amenities.rda b/data/osm_amenities.rda index f631423e..5e0ba60e 100644 Binary files a/data/osm_amenities.rda and b/data/osm_amenities.rda differ diff --git a/man/bbox_to_poly.Rd b/man/bbox_to_poly.Rd index ef3f2574..d44fc270 100644 --- a/man/bbox_to_poly.Rd +++ b/man/bbox_to_poly.Rd @@ -40,16 +40,19 @@ ggplot(bbox_GER_sf) + geom_sf() \donttest{ # Extract the bounding box of a sf object -Texas <- geo_lite_sf("Texas", points_only = FALSE) -bbox <- sf::st_bbox(Texas) +sfobj <- geo_lite_sf("seychelles", points_only = FALSE) + +sfobj + +bbox <- sf::st_bbox(sfobj) bbox -bbox_Texas <- bbox_to_poly(bbox) +bbox_sfobj <- bbox_to_poly(bbox) -ggplot(bbox_Texas) + - geom_sf(col = "red") + - geom_sf(data = Texas) +ggplot(bbox_sfobj) + + geom_sf(fill = "lightblue", alpha = 0.5) + + geom_sf(data = sfobj, fill = "wheat") } \dontshow{\}) # examplesIf} } diff --git a/man/figures/README-line-object-1.png b/man/figures/README-line-object-1.png index 9ab12900..da25bfa8 100644 Binary files a/man/figures/README-line-object-1.png and b/man/figures/README-line-object-1.png differ diff --git a/man/figures/README-pizzahut-1.png b/man/figures/README-pizzahut-1.png index abc4e245..92eab3b1 100644 Binary files a/man/figures/README-pizzahut-1.png and b/man/figures/README-pizzahut-1.png differ diff --git a/man/figures/README-statue_liberty-1.png b/man/figures/README-statue_liberty-1.png index 6030f55b..57b48770 100644 Binary files a/man/figures/README-statue_liberty-1.png and b/man/figures/README-statue_liberty-1.png differ diff --git a/vignettes/nominatimlite.Rmd b/vignettes/nominatimlite.Rmd index 98047837..ab0c1f2f 100644 --- a/vignettes/nominatimlite.Rmd +++ b/vignettes/nominatimlite.Rmd @@ -111,11 +111,11 @@ example, but `full_results = TRUE` can be used to return all of the data from the geocoder service. -|query | latitude| longitude|address | -|:------------------------------------------|--------:|----------:|:-------------------------------------------------------------------------------------------------------------------------------------------| -|1600 Pennsylvania Ave NW, Washington, DC | 38.89770| -77.03655|White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | -|600 Montgomery St, San Francisco, CA 94111 | 37.79520| -122.40279|Transamerica Pyramid, 600, Montgomery Street, Financial District, San Francisco, CAL Fire Northern Region, California, 94111, United States | -|233 S Wacker Dr, Chicago, IL 60606 | 41.87887| -87.63591|Willis Tower, 233, South Wacker Drive, Printer's Row, Loop, Chicago, Cook County, Illinois, 60606, United States | +|query | latitude| longitude|address | +|:------------------------------------------|--------:|----------:|:-----------------------------------------------------------------------------------------------------------------| +|1600 Pennsylvania Ave NW, Washington, DC | 38.89770| -77.03655|White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | +|600 Montgomery St, San Francisco, CA 94111 | 37.79520| -122.40279|Transamerica Pyramid, 600, Montgomery Street, Financial District, San Francisco, California, 94111, United States | +|233 S Wacker Dr, Chicago, IL 60606 | 41.87887| -87.63591|Willis Tower, 233, South Wacker Drive, Printer's Row, Loop, Chicago, Cook County, Illinois, 60606, United States | To perform reverse geocoding (obtaining addresses from geographic coordinates), we can use the `reverse_geo_lite()` function. The arguments are similar to the @@ -132,11 +132,11 @@ reverse <- reverse_geo_lite( ``` -|address_found | lat| lon| -|:-------------------------------------------------------------------------------------------------------------------------------------------|--------:|----------:| -|White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | 38.89770| -77.03655| -|Transamerica Pyramid, 600, Montgomery Street, Financial District, San Francisco, CAL Fire Northern Region, California, 94111, United States | 37.79520| -122.40279| -|Willis Tower, 233, South Wacker Drive, Printer's Row, Loop, Chicago, Cook County, Illinois, 60606, United States | 41.87887| -87.63591| +|address_found | lat| lon| +|:-----------------------------------------------------------------------------------------------------------------|--------:|----------:| +|White House, 1600, Pennsylvania Avenue Northwest, Washington, District of Columbia, 20500, United States | 38.89770| -77.03655| +|Transamerica Pyramid, 600, Montgomery Street, Financial District, San Francisco, California, 94111, United States | 37.79520| -122.40279| +|Willis Tower, West Adams Street, Printer's Row, Loop, Chicago, Cook County, Illinois, 60606, United States | 41.87874| -87.63602| For more advance users, see [Nominatim docs](https://nominatim.org/release-docs/latest/api/Search/) to check the diff --git a/vignettes/pizzahut-1.png b/vignettes/pizzahut-1.png index dc17566a..2a6e6635 100644 Binary files a/vignettes/pizzahut-1.png and b/vignettes/pizzahut-1.png differ diff --git a/vignettes/sol-1.png b/vignettes/sol-1.png index c9a841ae..6d8262fa 100644 Binary files a/vignettes/sol-1.png and b/vignettes/sol-1.png differ