photon

R package for online and offline geocoding powered by photon

https://github.com/jslth/photon

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.9%) to scientific vocabulary

Keywords

r r-package rstats
Last synced: 10 months ago · JSON representation

Repository

R package for online and offline geocoding powered by photon

Basic Info
Statistics
  • Stars: 5
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 2
Topics
r r-package rstats
Created over 1 year ago · Last pushed 11 months ago
Metadata Files
Readme Changelog Contributing License Codemeta

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# photon


[![R-CMD-check](https://github.com/JsLth/photon/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/JsLth/photon/actions/workflows/R-CMD-check.yaml)
[![R-hub](https://github.com/jslth/photon/actions/workflows/rhub.yaml/badge.svg)](https://github.com/jslth/photon/actions/workflows/rhub.yaml)
[![CRAN
status](https://www.r-pkg.org/badges/version/photon)](https://CRAN.R-project.org/package=photon)
[![Project Status: Active – The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)
[![Codecov test
coverage](https://codecov.io/gh/JsLth/photon/branch/main/graph/badge.svg)](https://app.codecov.io/gh/JsLth/photon?branch=main)
[![CodeFactor](https://www.codefactor.io/repository/github/jslth/photon/badge/main)](https://www.codefactor.io/repository/github/jslth/photon/overview/main)


`{photon}` is a simple interface and setup manager of the [photon](https://photon.komoot.io) OpenStreetMap geocoder. It features unstructured, structured, and reverse geocoding. The package allows requests to the public API but shines at setting up local instances to enable high-performance offline geocoding.

## Installation

To install the package from CRAN:

``` r
install.packages("photon")
```

You can install the development version of photon from [GitHub](https://github.com/) with:

``` r
# install.packages("remotes")
remotes::install_github("jslth/photon")
```

## Usage

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 geocode}
library(photon)
places <- c("Paris", "Beijing", "Sao Paolo", "Kinshasa")

cities1 <- geocode(places, layer = "city")
cities1
```

Reverse geocoding means taking point geometries and returning their addresses or place names.

```{r reverse}
cities2 <- reverse(cities1$geometry, layer = "city")
cities2
```

```{r compare}
all.equal(cities1, cities2)
```


## Offline geocoding

`{photon}` is designed to facilitate offline geocoding. `new_photon()` can install photon locally. The following code would install and start photon covering the country of Germany in the current working directory.

```{r offline, eval=FALSE}
photon <- new_photon(path = "./photon", country = "Germany")
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 instances and was abandoned a while ago.
- 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.

Owner

  • Name: Jonas Lieth
  • Login: JsLth
  • Kind: user
  • Location: Cologne, Germany
  • Company: GESIS - Leibniz Institute for the Social Sciences

CodeMeta (codemeta.json)

{
  "@context": "https://doi.org/10.5063/schema/codemeta-2.0",
  "@type": "SoftwareSourceCode",
  "identifier": "photon",
  "description": "Features unstructured, structured and reverse geocoding using the 'photon' geocoding API <https://photon.komoot.io/>. Facilitates the setup of local 'photon' instances to enable offline geocoding.",
  "name": "photon: High-Performance Geocoding using 'photon'",
  "relatedLink": "https://jslth.github.io/photon/",
  "codeRepository": "https://github.com/jslth/photon/",
  "issueTracker": "https://github.com/jslth/photon/issues",
  "license": "Apache License 2",
  "version": "0.7.4",
  "programmingLanguage": {
    "@type": "ComputerLanguage",
    "name": "R",
    "url": "https://r-project.org"
  },
  "runtimePlatform": "R version 4.4.3 (2025-02-28 ucrt)",
  "provider": {
    "@id": "https://cran.r-project.org",
    "@type": "Organization",
    "name": "Comprehensive R Archive Network (CRAN)",
    "url": "https://cran.r-project.org"
  },
  "author": [
    {
      "@type": "Person",
      "givenName": "Jonas",
      "familyName": "Lieth",
      "email": "jonas.lieth@gesis.org",
      "@id": "https://orcid.org/0000-0002-3451-3176"
    }
  ],
  "copyrightHolder": [
    {
      "@type": "Person",
      "givenName": "Jonas",
      "familyName": "Lieth",
      "email": "jonas.lieth@gesis.org",
      "@id": "https://orcid.org/0000-0002-3451-3176"
    }
  ],
  "maintainer": [
    {
      "@type": "Person",
      "givenName": "Jonas",
      "familyName": "Lieth",
      "email": "jonas.lieth@gesis.org",
      "@id": "https://orcid.org/0000-0002-3451-3176"
    }
  ],
  "softwareSuggestions": [
    {
      "@type": "SoftwareApplication",
      "identifier": "testthat",
      "name": "testthat",
      "version": ">= 3.0.0",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=testthat"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "tibble",
      "name": "tibble",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=tibble"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "knitr",
      "name": "knitr",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=knitr"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "rmarkdown",
      "name": "rmarkdown",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=rmarkdown"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "webfakes",
      "name": "webfakes",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=webfakes"
    },
    {
      "@type": "SoftwareApplication",
      "identifier": "ps",
      "name": "ps",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=ps"
    }
  ],
  "softwareRequirements": {
    "1": {
      "@type": "SoftwareApplication",
      "identifier": "utils",
      "name": "utils"
    },
    "2": {
      "@type": "SoftwareApplication",
      "identifier": "cli",
      "name": "cli",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=cli"
    },
    "3": {
      "@type": "SoftwareApplication",
      "identifier": "countrycode",
      "name": "countrycode",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=countrycode"
    },
    "4": {
      "@type": "SoftwareApplication",
      "identifier": "httr2",
      "name": "httr2",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=httr2"
    },
    "5": {
      "@type": "SoftwareApplication",
      "identifier": "R6",
      "name": "R6",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=R6"
    },
    "6": {
      "@type": "SoftwareApplication",
      "identifier": "sf",
      "name": "sf",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=sf"
    },
    "7": {
      "@type": "SoftwareApplication",
      "identifier": "processx",
      "name": "processx",
      "provider": {
        "@id": "https://cran.r-project.org",
        "@type": "Organization",
        "name": "Comprehensive R Archive Network (CRAN)",
        "url": "https://cran.r-project.org"
      },
      "sameAs": "https://CRAN.R-project.org/package=processx"
    },
    "SystemRequirements": null
  },
  "fileSize": "205.04KB"
}

GitHub Events

Total
  • Create event: 2
  • Release event: 2
  • Issues event: 23
  • Watch event: 3
  • Issue comment event: 3
  • Public event: 1
  • Push event: 152
Last Year
  • Create event: 2
  • Release event: 2
  • Issues event: 23
  • Watch event: 3
  • Issue comment event: 3
  • Public event: 1
  • Push event: 152

Committers

Last synced: 12 months ago

All Time
  • Total Commits: 244
  • Total Committers: 1
  • Avg Commits per committer: 244.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 244
  • Committers: 1
  • Avg Commits per committer: 244.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
JsLth j****h@o****m 244

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 14
  • Total pull requests: 0
  • Average time to close issues: 1 day
  • Average time to close pull requests: N/A
  • Total issue authors: 2
  • Total pull request authors: 0
  • Average comments per issue: 0.36
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 14
  • Pull requests: 0
  • Average time to close issues: 1 day
  • Average time to close pull requests: N/A
  • Issue authors: 2
  • Pull request authors: 0
  • Average comments per issue: 0.36
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • JsLth (13)
  • diegoteca (1)
Pull Request Authors
Top Labels
Issue Labels
enhancement (5) documentation (3) bug (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 189 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 2
  • Total maintainers: 1
cran.r-project.org: photon

High-Performance Geocoding using 'photon'

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 189 Last month
Rankings
Dependent packages count: 27.8%
Dependent repos count: 34.3%
Average: 49.7%
Downloads: 87.1%
Maintainers (1)
Last synced: 10 months ago

Dependencies

.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • actions/setup-java v3 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
  • strumwolf/delete-deployment-environment v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/setup-java v3 composite
  • actions/upload-artifact v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
DESCRIPTION cran
  • R6 * imports
  • cli * imports
  • countrycode * imports
  • httr2 * imports
  • processx * imports
  • sf * imports
  • bench * suggests
  • httpuv * suggests
  • knitr * suggests
  • rmarkdown * suggests
  • testthat >= 3.0.0 suggests
  • tibble * suggests
.github/workflows/rhub.yaml actions
  • r-hub/actions/checkout v1 composite
  • r-hub/actions/platform-info v1 composite
  • r-hub/actions/run-check v1 composite
  • r-hub/actions/setup v1 composite
  • r-hub/actions/setup-deps v1 composite
  • r-hub/actions/setup-r v1 composite