Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
JsLth committed Oct 31, 2024
1 parent 0ce9456 commit 95d60c3
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 36 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
^CODE_OF_CONDUCT\.md$
^CONTRIBUTING\.md$
^codemeta\.json$
^cran-comments\.md$
20 changes: 6 additions & 14 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down Expand Up @@ -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.
34 changes: 12 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
#> <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
Expand Down Expand Up @@ -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.

0 comments on commit 95d60c3

Please sign in to comment.