get_geocode: Get geocode for given query

Description Usage Arguments Value Author(s) References Examples

View source: R/geocode.R

Description

Get gecode for given query from one of the geocoding services: OKF.fi Geocoding API Test Console: http://data.okf.fi/console/ OpenStreetMap Nominatim (usage policy: http://wiki.openstreetmap.org/wiki/Nominatim_usage_policy) Google Maps API See Terms and Conditions from http://code.google.com/apis/maps/documentation/geocoding/

Usage

1
get_geocode(query, service = "okf", raw_query = F)

Arguments

query

Either a street address, e.g. 'Mannerheimintie 100, Helsinki' or place, e.g. 'Eduskuntatalo'

service

Geocoding service to use, one of 'okf', 'openstreetmap' or 'google'

raw_query

If true, don't prepend / append some default parameters to query. Except for the ones specifying json format, send the query to API as-it-is

Value

A list with coordinates (lat, long) of the first output, and the raw output list

Author(s)

Juuso Parkkinen louhos@googlegroups.com, minor updates by Aaro Salosensaari aaro.salosensaari@helsinki.fi and Leo Lahti.

References

See citation("gisfin")

Examples

1
2
3
4
5
6
7
8
 ## Not run: 
   # Geocode for a street address:
   gc1 <- get_geocode("Mannerheimintie 100, Helsinki");

   # Geocode for a place name
   gc2 <- get_geocode("&city=Helsinki", service="openstreetmap", raw_query=T)

## End(Not run)

rOpenGov/gisfin documentation built on May 26, 2019, 8:48 p.m.