otp_geocode: Use OTP Geo-coder to find a location

View source: R/otp-geocode.R

otp_geocodeR Documentation

Use OTP Geo-coder to find a location

Description

Geo-coding converts a named place, such as a street name into a lng/lat pair.

Usage

otp_geocode(
  otpcon = NULL,
  query = NULL,
  autocomplete = FALSE,
  stops = TRUE,
  clusters = FALSE,
  corners = TRUE,
  type = "SF"
)

Arguments

otpcon

OTP connection object produced by otp_connect()

query

Character, The query string we want to geocode

autocomplete

logical Whether we should use the query string to do a prefix match, default FALSE

stops

Logical, Search for stops, either by name or stop code, default TRUE

clusters

Logical, Search for clusters by their name, default FALSE

corners

Logical, Search for street corners using at least one of the street names, default TRUE

type

Character, How should results be returned can be "SF" or "Coordinates" or "Both", Default "SF"

Details

OTP will return a maximum of 10 results

Value

Returns a data.frame of SF POINTS or Coordinates of all the locations that match 'query'

See Also

Other routing: otp_isochrone(), otp_plan(), otp_pointset(), otp_routing_options(), otp_validate_routing_options()

Examples

## Not run: 
locations <- otp_geocode(otpcon, "High Street")

## End(Not run)

ropensci/opentripplanner documentation built on Aug. 5, 2024, 9:58 p.m.