Description Usage Arguments Details Value Author(s) See Also Examples
Geocodes a location (find latitude and longitude) using either (1) the Data Science Toolkit (http://www.datasciencetoolkit.org/about) or (2) Google Maps. Note that when using Google you are agreeing to the Google Maps API Terms of Service at https://developers.google.com/maps/terms.
1 2 3 4 5 6 | geocode(location, output = c("latlon", "latlona", "more", "all"),
source = c("google", "dsk"), messaging = FALSE, force = ifelse(source ==
"dsk", FALSE, TRUE), sensor = FALSE, override_limit = FALSE,
client = "", signature = "", nameType = c("long", "short"), data)
geocodeQueryCheck(userType = "free")
|
location |
a character vector of street addresses or place names (e.g. "1600 pennsylvania avenue, washington dc" or "Baylor University") |
output |
amount of output, "latlon", "latlona", "more", or "all" |
source |
"dsk" for Data Science Toolkit or "google" for Google |
messaging |
turn messaging on/off |
force |
force online query, even if previously downloaded |
sensor |
whether or not the geocoding request comes from a device with a location sensor |
override_limit |
override the current query count (.GoogleGeocodeQueryCount) |
client |
client ID for business users, see https://developers.google.com/maps/documentation/business/webservices/auth |
signature |
signature for business users, see https://developers.google.com/maps/documentation/business/webservices/auth |
nameType |
in some cases, Google returns both a long name and a short name. this parameter allows the user to specify which to grab. |
data |
deprecated in 2.5, use |
userType |
User type, "free" or "business" |
Note that the Google Maps api limits to 2500 queries a day. Use
geocodeQueryCheck
to determine how many queries remain.
If output
is "latlon", "latlona", or "more", a
data frame. If all, a list.
David Kahle david.kahle@gmail.com
mutate_geocode
,
http://code.google.com/apis/maps/documentation/geocoding/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | ## Not run: # Server response can be slow; this cuts down check time.
# types of input
geocode("houston texas")
geocode("baylor university") # see known issues below
geocode("1600 pennsylvania avenue, washington dc")
geocode("the white house")
geocode(c("baylor university", "salvation army waco"))
# types of output
geocode("houston texas", output = "latlona")
geocode("houston texas", output = "more")
geocode("Baylor University", output = "more")
str(geocode("Baylor University", output = "all"))
# see how many requests we have left with google
geocodeQueryCheck()
geocode("one bear place, waco, texas")
geocode("houston texas", force = TRUE)
# known issues :
# (1) source = "dsk" can't reliably geocode colloquial place names
geocode("city hall houston")
geocode("rice university")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.