oe_match_pattern {osmextract} | R Documentation |
Check patterns in the provider's databases
Description
This function is used to explore all provider's databases and look for
matches. This function can be useful in combination with oe_match()
and
oe_get()
for an exploratory analysis and an easy match. See Examples.
Usage
oe_match_pattern(pattern, ...)
## S3 method for class 'numeric'
oe_match_pattern(pattern, full_row = FALSE, ...)
## S3 method for class 'sf'
oe_match_pattern(pattern, full_row = FALSE, ...)
## S3 method for class 'bbox'
oe_match_pattern(pattern, full_row = FALSE, ...)
## S3 method for class 'sfc'
oe_match_pattern(pattern, full_row = FALSE, ...)
## S3 method for class 'character'
oe_match_pattern(pattern, match_by = "name", full_row = FALSE, ...)
Arguments
pattern |
Description of the pattern. Can be either a length-1 character
vector, an |
... |
arguments passed to other methods |
full_row |
Boolean. Return all columns for the matching rows? |
match_by |
Name of the column in the provider's database that will be
used to find the match in case of character input. In all the other cases,
the match is performed using a spatial overlay operation and the output
returns the values stored in the |
Value
A list of character vectors or sf
objects (according to the value
of the parameter full_row
). If no OSM zone can be matched with the input
string, then the function returns an empty list.
Examples
oe_match_pattern("Yorkshire")
res = oe_match_pattern("Yorkshire", full_row = TRUE)
lapply(res, function(x) sf::st_drop_geometry(x)[, 1:3])
oe_match_pattern(c(9, 45)) # long/lat for Milan, Italy