From 95d60c3d6a11b370b99a12c09c3354230b42233c Mon Sep 17 00:00:00 2001 From: JsLth Date: Thu, 31 Oct 2024 17:35:00 +0100 Subject: [PATCH] update readme --- .Rbuildignore | 1 + README.Rmd | 20 ++++++-------------- README.md | 34 ++++++++++++---------------------- 3 files changed, 19 insertions(+), 36 deletions(-) diff --git a/.Rbuildignore b/.Rbuildignore index 892a16e..1a207b7 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -11,3 +11,4 @@ ^CODE_OF_CONDUCT\.md$ ^CONTRIBUTING\.md$ ^codemeta\.json$ +^cran-comments\.md$ diff --git a/README.Rmd b/README.Rmd index 7f49ffc..a247705 100644 --- a/README.Rmd +++ b/README.Rmd @@ -46,21 +46,13 @@ remotes::install_github("jslth/photon") ## Usage -Before geocoding, `{photon}` needs to know where to send requests. This can be done using the workhorse function `new_photon()`. +When loading `{photon}`, the package assumes that you want send geocoding requests to the public photon API. If you want to change this, you can use the workhorse function `new_photon()`. Otherwise, you can directly start geocoding. -```{r new_photon} +```{r geocode} library(photon) -new_photon() -``` - -With a photon instance registered, you can start geocoding. +places <- c("Paris", "Beijing", "Sao Paolo", "Kinshasa") -```{r geocode} -cities1 <- geocode( - c("Paris", "Beijing", "Sao Paolo", "Kinshasa"), - limit = 1, - layer = "city" -) +cities1 <- geocode(places, limit = 1, layer = "city") cities1 ``` @@ -89,5 +81,5 @@ photon$start() ## Related packages - The [`{photon}`](https://github.com/rCarto/photon) package by Timothée Giraud interfaces photon but does not allow the setup of local setups and was abandoned a while ago. -- The [`{revgeo}`](https://cran.r-project.org/web/packages/revgeo/index.html) package by Michael Hudecheck implements reverse geocoding using (among others) photon. -- The [`{MazamaLocationUtils}`](https://cran.r-project.org/web/packages/MazamaLocationUtils/) package by Mazama Science features reverse geocoding using photon. +- The [`{revgeo}`](https://CRAN.R-project.org/package=revgeo) package by Michael Hudecheck implements reverse geocoding using (among others) photon. +- The [`{tidygeocoder}`](https://jessecambon.github.io/tidygeocoder/) and [nominatimlite](https://dieghernan.github.io/nominatimlite/) packages implement general (OSM) geocoding using web APIs. diff --git a/README.md b/README.md index d873b66..532be06 100644 --- a/README.md +++ b/README.md @@ -43,25 +43,16 @@ remotes::install_github("jslth/photon") ## Usage -Before geocoding, `{photon}` needs to know where to send requests. This -can be done using the workhorse function `new_photon()`. +When loading `{photon}`, the package assumes that you want send +geocoding requests to the public photon API. If you want to change this, +you can use the workhorse function `new_photon()`. Otherwise, you can +directly start geocoding. ``` r library(photon) -new_photon() -#> -#> Type : remote -#> Server : https://photon.komoot.io/ -``` - -With a photon instance registered, you can start geocoding. +places <- c("Paris", "Beijing", "Sao Paolo", "Kinshasa") -``` r -cities1 <- geocode( - c("Paris", "Beijing", "Sao Paolo", "Kinshasa"), - limit = 1, - layer = "city" -) +cities1 <- geocode(places, limit = 1, layer = "city") cities1 #> Simple feature collection with 4 features and 12 fields #> Geometry type: POINT @@ -120,10 +111,9 @@ photon$start() - The [`{photon}`](https://github.com/rCarto/photon) package by Timothée Giraud interfaces photon but does not allow the setup of local setups and was abandoned a while ago. -- The - [`{revgeo}`](https://cran.r-project.org/web/packages/revgeo/index.html) - package by Michael Hudecheck implements reverse geocoding using (among - others) photon. -- The - [`{MazamaLocationUtils}`](https://cran.r-project.org/web/packages/MazamaLocationUtils/) - package by Mazama Science features reverse geocoding using photon. +- The [`{revgeo}`](https://CRAN.R-project.org/package=revgeo) package by + Michael Hudecheck implements reverse geocoding using (among others) + photon. +- The [`{tidygeocoder}`](https://jessecambon.github.io/tidygeocoder/) + and [nominatimlite](https://dieghernan.github.io/nominatimlite/) + packages implement general (OSM) geocoding using web APIs.