-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME.Rmd
More file actions
70 lines (49 loc) · 2.61 KB
/
Copy pathREADME.Rmd
File metadata and controls
70 lines (49 loc) · 2.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# nutscoder
<!-- badges: start -->
[](https://zenodo.org/badge/latestdoi/476698751)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[](https://github.com/RegioHub/nutscoder/actions)
<!-- badges: end -->
{nutscoder} provides the function `nuts_geocode`, which attempts to find [NUTS region codes](https://ec.europa.eu/eurostat/web/nuts/background) for location names by using [Nominatim](https://nominatim.org) to search [OpenStreetMap (OSM)](https://www.openstreetmap.org) data.
## Installation
You can install the development version of {nutscoder} like so:
``` r
remotes::install_github("RegioHub/nutscoder")
```
## Usage
```{r}
library(nutscoder)
nuts_geocode(c("Hamburgo", "هامبورغ", "HH", "Berlin", "🐻Bärlin", "ベルリン",
"North Rhine-Westphalia", "nrw"))
```
The [sf](https://r-spatial.github.io/sf/) geometry of the geocoded NUTS regions can be returned:
```{r}
nuts_geocode(c("berlin", "brandenburg"), return_geometry = TRUE) |>
sf::st_geometry() |>
plot()
```
The argument `nominatim_api` can be used to specify the API URL of the Nominatim instance used to search for OSM data. By default, `nuts_geocode()` uses the public Nominatim instance (`nominatim_api = "https://nominatim.openstreetmap.org"`), which has an absolute maximum of 1 request per second and is not suitable for intensive use. You can [install your own instance of Nominatim](https://nominatim.org/release-docs/latest/admin/Installation/) to avoid the limitations of the public instance.
## Citation
```{r echo=FALSE, results='asis'}
print(citation("nutscoder"), bibtex = FALSE)
```
A BibTeX entry for LaTeX users is
```{r echo=FALSE, comment=""}
toBibtex(citation("nutscoder"))
```
## Disclaimers
The use of the server running at <https://nominatim.openstreetmap.org> is governed by the [Nominatim Usage Policy](https://operations.osmfoundation.org/policies/nominatim/).
Geodata from OpenStreetMap are licensed under the terms of the [Open Database License (ODbL) 1.0](http://www.opendatacommons.org/licenses/odbl/).
Use of any OSMF provided service is further governed by the [OSMF Terms of Use](https://wiki.osmfoundation.org/wiki/Terms_of_Use).