google_geocode: Function to find latitude and longitude pairs from an...

View source: R/google_geocode.R

google_geocodeR Documentation

Function to find latitude and longitude pairs from an address-string using Google Maps API.

Description

The Google Maps API is not open-source, therefore check the licensing conditions for usage conditions (https://developers.google.com/maps/terms). Users of this function must use the geocoded data to display on a Google Map.

Usage

google_geocode(input, source = "google", wkt = FALSE, verbose = TRUE)

Arguments

input

The input to transform to latitude and longitude pairs.

source

What API should google_geocode access? Options are "google" or "dsk" and the default is "google".

wkt

Should the return be a vector of WKT (well known text)? This is useful for when transforming a data frame.

verbose

Should the functions give messages?

Details

google_geocode is a wrapper for ggmap::geocode with some simple enhancements to clean the output and avoid messages to the console. Other address elements such as postcodes can also be transformed successfully.

Value

Data frame or character vector.

Author(s)

Stuart K. Grange

Examples

## Not run: 

# Return data frame
google_geocode("bath abbey")

# Only a vector without messages
google_geocode("york minster", verbose = FALSE, wkt = TRUE))


## End(Not run)


skgrange/gissr documentation built on June 20, 2024, 12:02 a.m.