Interface to the 'open311' Standard

Access and handle APIs that use the international 'open311' 'GeoReport v2' standard for civic issue tracking < https://wiki.open311.org/GeoReport_v2/>. Retrieve civic service types and request data. Select and add available 'open311' endpoints and jurisdictions. Implicitly supports custom queries and 'open311' extensions. Requires a minimal number of hard dependencies while still allowing the integration in common R formats ('xml2', 'tibble', 'sf').


r311

rOG-badge R-CMD-check CRAN Codecov testcoverage CodeFactor Project Status: Active – The project has reached a stable, usablestate and is being activelydeveloped.

{r311} is an R interface to the international standard open311. Open311 APIs are used for civic issue management and public service communication. The standard allows administrations to better manage citizen requests, citizens to more easily submit requests, and (hence this package) researchers and data scientists to access data regarding public service communication. {r311} supports the seamless management and supplementation of available endpoints, the selection of appropriate APIs to access, and the retrieval of civic service and request data. Custom queries and extensions (e.g. from CitySDK) are implicitly supported. {r311} is designed to require a minimal amount of dependencies, but allow for easy integration into common R frameworks such as the tidyverse, sf or xml2.

Installation

You can install {r311} from CRAN with:

install.packages("r311")

Or you can install the development version from GitHub with:

# install.packages("remotes")
remotes::install_github("rOpenGov/r311")

Example

The following example loads {r311}, sets up a jurisdiction and retrieves a small amount of data on service tickets in Cologne, Germany.

library(r311)

o311_api("Cologne")
o311_requests()
#> Simple feature collection with 100 features and 11 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: 6.821324 ymin: 50.86269 xmax: 7.091088 ymax: 51.05102
#> Geodetic CRS:  WGS 84
#> # A tibble: 100 × 12
#>    service_request_id title              description address_string service_name
#>    <chr>              <chr>              <chr>       <chr>          <chr>       
#>  1 30964-2024         #30964-2024 Leuch… "Die Stras… 51061 Köln - … Leuchtmitte…
#>  2 30965-2024         #30965-2024 Straß… "Das Schil… 51103 Köln - … Straßenbaus…
#>  3 30966-2024         #30966-2024 Defek… "Auf dem R… 51103 Köln - … Defekte Obe…
#>  4 30967-2024         #30967-2024 Wilde… "Der Müll … 50859 Köln - … Wilder Müll 
#>  5 30968-2024         #30968-2024 Schro… "Ein fahru… 51069 Köln - … Schrottfahr…
#>  6 30969-2024         #30969-2024 Schro… "Sehr geeh… 50733 Köln - … Schrott-Kfz 
#>  7 30970-2024         #30970-2024 Wilde…  <NA>       51105 Köln - … Wilder Müll 
#>  8 30971-2024         #30971-2024 Schro… "Schrottra… 50935 Köln - … Schrottfahr…
#>  9 30972-2024         #30972-2024 Graff… "grafitti … 50733 Köln - … Graffiti    
#> 10 30973-2024         #30973-2024 Wilde… "Kühlschra… 50672 Köln - … Wilder Müll 
#> # ℹ 90 more rows
#> # ℹ 7 more variables: requested_datetime <chr>, updated_datetime <chr>,
#> #   status <chr>, media_url <chr>, status_note <chr>, service_code <chr>,
#> #   geometry <POINT [°]>

API upkeep

{r311} is powered by a JSON of available APIs (see here). This list does not claim to be comprehensive nor up-to-date at all times but is updated from time to time. If an API is found to be unavailable for an extended period of time, it will be marked as “questioning”. Questionable APIs will be removed on the next release.

If you know about a stable open311 API that should be added to the list, please consider opening an issue. Otherwise, you can also just use the o311_add_endpoint() function to add the API locally.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("r311")

0.4.4 by Jonas Lieth, 9 months ago


https://ropengov.github.io/r311/, https://github.com/rOpenGov/r311


Report a bug at https://github.com/rOpenGov/r311/issues


Browse source code at https://github.com/cran/r311


Authors: Jonas Lieth [aut, cre, cph] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports curl, jsonlite, tools, utils

Suggests httptest2, knitr, rmarkdown, sf, testthat, tibble, xml2, xmlconvert


See at CRAN