Description Details Author(s) References Examples
There are 4 primary functions:
1) Resolve street address to point and box coordinates.
2) Resolve ip address to point coordinates.
3) Plot resolved points on specified Google map.
4) Determine distance between 2 points in km or mi using haversine formula.
Package: | geoPlot |
Type: | Package |
Version: | 2.3 |
Date: | 2012-08-07 |
License: | GPL-2 |
INSTRUCTIONS:
To resolve (geocode) a single address to coordinates:
x <- geoAddress(c("001","202 South Central Avenue","Flagler Beach","FL","32136","US"))
Plot the address on a map:
geoPlot(x)
To geocode and plot a data frame of addresses: (see geoAddr for format)
addr <- load('ListOfAddresses.rda')
geoAddr <- addrListLookup(addr)
geoPlot(geoAddr)
To geocode a single ip address:
x <- geoIP("38.122.8.198")
Plot on the map:
geoPlot(x)
To geocode and plot a data frame of ips: (see geoIP for format)
ips <- load('ListOfIPs.rda')
geoIPs <- ipListLookup(ips)
geoPlot(geoIPs)
To determine the distance between 2 points:
haversine("28.54703","-81.30292","26.93422","-80.09421")
To determine the distance between 2 points resolved above:
haversine(geoAddr[1,3],geoAddr[1,4],geoAddr[2,3],geoAddr[2,4])
haversine(geoIPs[1,3],geoIPs[1,4],geoIPs[2,3],geoIPs[2,4])
Randall Shane, PhD
<rshane@basexvi.com>
http://ipinfodb.com/ip_location_api.php
http://en.wikipedia.org/wiki/Haversine_formula
http://www.movable-type.co.uk/scripts/latlong.html
http://www.platoscave.net/blog/2009/oct/5/calculate-distance-latitude-longitude-python/
http://www.google.com/maps
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.