geo_address_lookup_sf: Get spatial objects from OSM ids

Description Usage Arguments Details Value See Also Examples

View source: R/geo_address_lookup_sf.R

Description

This function allows you to extract the spatial objects for specific OSM objects.

Usage

1
2
3
4
5
6
7
8
9
geo_address_lookup_sf(
  osm_ids,
  type = c("N", "W", "R"),
  full_results = FALSE,
  return_addresses = TRUE,
  verbose = FALSE,
  custom_query = list(),
  points_only = TRUE
)

Arguments

osm_ids

vector of OSM identifiers (c(00000, 11111, 22222)).

type

vector of the type of the OSM type associated to each osm_ids. Possible values are node ("N"), way ("W") or relation ("R"). If a single value is provided it would be recycled.

full_results

returns all available data from the geocoding service if TRUE. If FALSE (default) then only latitude and longitude columns are returned from the geocoding service.

return_addresses

return input addresses with results if TRUE. Note that most services return the input addresses with full_results = TRUE and setting return_addresses to FALSE does not prevent this.

verbose

if TRUE then detailed logs are output to the console. FALSE is default. Can be set permanently with options(tidygeocoder.verbose = TRUE)

custom_query

API-specific parameters to be used, passed as a named list (i.e. list(countrycodes = "US")). See Details.

points_only

Logical TRUE/FALSE. Whether to return only spatial points (TRUE, which is the default) or potentially other shapes as provided by the Nominatim API (FALSE).

Details

See https://nominatim.org/release-docs/latest/api/Search/ for additional parameters to be passed to custom_query.

Value

A sf object with the results.

See Also

Other spatial: bbox_to_poly(), geo_amenity_sf(), geo_lite_sf(), reverse_geo_lite_sf()

Other lookup: geo_address_lookup()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
# Notre Dame Cathedral, Paris

NotreDame <- geo_address_lookup_sf(
  osm_ids = c(201611261),
  type = c("W")
)

library(ggplot2)

ggplot(NotreDame) +
  geom_sf()

NotreDame_poly <- geo_address_lookup_sf(
  osm_ids = c(201611261),
  type = c("W"),
  points_only = FALSE
)

ggplot(NotreDame_poly) +
  geom_sf()

nominatimlite documentation built on Nov. 27, 2021, 1:07 a.m.