geocode: Geocode an Address

View source: R/geocode.R

geocodeR Documentation

Geocode an Address

Description

Get Lat/Lon Cooridinates for an Address.

Usage

geocode(address.string)

Arguments

address.string

character vector of addresses to geocode.

Details

This function uses the findAddressCandidates utility at Arcgis.com to get coordinates for a single address.

Value

A data frame with probable address locations.

See Also

ol_geom_point, ol_geom_icon,

Examples

address <- "1600 Pennsylvania Ave NW, Washington, DC 20500"
## Not run: 
g <- geocode(address)
point.matrix <- matrix(
  c(
    as.numeric(g$location[1,1]),
    as.numeric(g$location[1,2])
  ),
  nrow=1
)
point.df <- data.frame(
    pt.type="White House"
)
mymap <- ol_map(
   center=c(-77.03196,38.89037),
   zoom=12
) +
    streetmap() +
ol_geom_point(
    point.matrix,
    name="Points of Interest",
    marker="pin",
    toggle.control=TRUE,
    tooltip=point.df$pt.type
)

# Output to file and view
ol_map2HTML(mymap,'map.html')
browseURL('map.html')

## End(Not run)

cemarks/ROpenLayers documentation built on March 31, 2022, 12:05 p.m.