Package 'walkscoreAPI'

Title: Walk Score and Transit Score API
Description: A collection of functions to perform the Application Programming Interface (API) calls associated with the Walk Score website (www.walkscore.com) within the R environment. These functions can be used to query the Walk Score and Transit Score database for a wide variety of information using R scripts. This package includes the simple Walk Score and Transit Score API calls, which return the scores associated with an input location, as well as calls which return some data used to calculate the scores. These functions are especially useful for mass data collection and gathering Walk Score and Transit Score values for large lists of locations.
Authors: John Whalen
Maintainer: John Whalen <[email protected]>
License: GPL-2
Version: 1.2
Built: 2024-11-15 03:50:29 UTC
Source: https://github.com/cran/walkscoreAPI

Help Index


Walk Score and Transit Score API

Description

A collection of functions to perform the Application Programming Interface (API) calls associated with the Walk Score website (www.walkscore.com) within the R environment. These functions can be used to query the Walk Score and Transit Score database for a wide variety of information using R scripts. This package includes the simple Walk Score and Transit Score API calls, which return the scores associated with an input location, as well as calls which return some data used to calculate the scores. These functions are especially useful for mass data collection and gathering Walk Score and Transit Score values for large lists of locations.

Details

Package: walkscoreAPI
Type: Package
Version: 1.2
Date: 2012-01-04
License: GPL-2
LazyLoad: yes

Every function in this package requires the use of a Walk Score API key number, enetered as a parameter. The key is free to obtain with limited use, and can be requested here: http://www.walkscore.com/professional/api.php. The easiest way to enter the key is to store the string as a variable and entering that variable as a parameter for the function calls.

Author(s)

John Whalen

Maintainer: <[email protected]>

References

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Examples

## Not run: 
test <- geoloc("350 5th Avenue New York NY", "Google API key")
getWS(test$coordinates[1],test$coordinates[2], "Walk Score API key")
getTS(test$coordinates[1],test$coordinates[2],"New York","NY","Walk Score API key")

## End(Not run)

Check Transit Score Support

Description

A function to check if a city of interest is among the cities supported by the Transit Score.

Usage

checkTSsupport(city, state, key)

Arguments

city

name of city of interest (string)

state

postal abbreviation of city's state (string)

key

your Walk Score API key (string)

Details

Transit Score only works in select cities.

Value

TRUE if city is supported, FALSE otherwise

Note

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Author(s)

John Whalen

References

http://www.walkscore.com/professional/public-transit-api.php

See Also

getTScities

Examples

## Not run: 
checkTSsupport("Buffalo","NY","your key")

## End(Not run)

Google Geolocation API Call

Description

A function to perform the Google Geolocation API call, and return the longitude and latitude coordinates of the query location.

Usage

geoloc(address, apikey)

Arguments

address

query address (string). Do not use commas, and zip codes are not required, e.g. "1600 Pennsylvania Ave Washington DC".

apikey

your Google API key (string)

Details

Use of this function requires a Google API key, which is different from the Walk Score API key. Get one here: http://code.google.com/apis/maps/signup.html

Value

Returns an object of class GoogleGeoloc, basically a list of the following elements:

coordinates

A vector of two numbers, the first representing the longitude and the second representing the latitude.

accuracy

Accuracy rating of geolocation.

city

City containing the requested address

state

State containing the requested address

country

Country containing the requested address

Note

For description of Google Geolocation see here: http://code.google.com/apis/gears/api_geolocation.html

Author(s)

John Whalen

References

http://code.google.com/apis/gears/api_geolocation.html

Examples

## Not run: 
geoloc("350 5th Avenue New York NY","your Google API key")

## End(Not run)

Transit Score API Call

Description

A function to perform the basic Transit Score API call.

Usage

getTS(x, y, city, state, key)

Arguments

x

longitude of query location (numeric)

y

latitude of query location (numeric)

city

name of core city where the query location is located (string)

state

postal abriviation of query location's state (string)

key

your Walk Score API key (string)

Details

The Transit Score API call only works in supported cities. Use the functions "checkTSsupport" or "getTScities" to check for support in the city of interest. Also note that calls should use the core city name, even when the query location is technically in a suburb of the core city.

Value

Returns an object of class TransitScore, basically a list of the following elements:

transitscore

Transit Score of query location.

url

Link to Walk Score page associated with your query.

description

Qualitative description of query location regarding transit.

summary

Summary of nearby routes and stops.

Note

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Author(s)

John Whalen

References

http://www.walkscore.com/professional/public-transit-api.php

See Also

getWS

Examples

## Not run: 
getTS(-73.98496,40.74807,"New York","NY","your key")

## End(Not run)

List Cities With Transit Score Support

Description

A function to list cities supported by Transit Score.

Usage

getTScities(key)

Arguments

key

Your Walk Score API key (string)

Value

Prints a list of all cities currently supported by Transit Score.

Note

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Author(s)

John Whalen

References

http://www.walkscore.com/professional/public-transit-api.php

See Also

checkTSsupport

Examples

## Not run: 
getTScities("your key")

## End(Not run)

Walk Score API Call

Description

A function to perform the basic Walk Score API call.

Usage

getWS(x, y, key)

Arguments

x

longitude of query location (numeric)

y

latitude of query location (numeric)

key

your Walk Score API key (string), see Details below

Details

Note that the call uses longitude and latitude coordintes and not addresses like the website interface. It is strongly recomended that Google Geolocation is used to convert addresses to coordinates because this is the method used by the Walk Score website, and will result in the same Walk Score as entering the address into the website interface. The function "geoloc" in this package is a tool for using the Google Geolocation API.

Value

Otherwise Returns an object of class WalkScore, basically a list of the following elements:

status

Status code of the request. Status of 1 indicates a successful call. See the Walk Score API page for interpretation of other codes.

walkscore

Walk Score of query location.

description

Qualitative description of location.

updated

Date and time of most recent update to this location's Walk Score.

snappedLong

grid point longitude to which the input was snapped to.

snappedLat

grid point latitude to which the input was snapped to.

Note

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Author(s)

John Whalen

References

http://www.walkscore.com/professional/api.php

See Also

geoloc

Examples

## Not run: 
getWS(-73.98496,40.74807,"your key")

## End(Not run)

Network Search

Description

A function to perform the Network Search API call.

Usage

networkSearch(x, y, key)

Arguments

x

longitude of query location (numeric)

y

latitude of query location (numeric)

key

your Walk Score API key (string)

Details

gives information about all routes and all stops within a mile radius of a query location. This function returns a very data-rich object with details on every stop and every route included in this radius.

Value

Returns an object of class NetworkSearch, which has two elements: first is $routelist, which is a list of objects of class Route, and second is $stoplist, which is a list of objects of class Stop.

routelist

List of routeID, route name, route catagory, maintaining agency, agency website, and stops served by the route.

stoplist

List of stopID, stop name, stop latitude, stop longitude, and a list of routes which use the stop.

Note

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Author(s)

John Whalen

References

http://www.walkscore.com/professional/public-transit-api.php

See Also

stopDetails,routeDetails

Examples

## Not run: 
networkSearch(-73.98496,40.74807,"your key")

## End(Not run)

Route Details

Description

A function to perform the Route Details API call, which provides additional information about a particular route.

Usage

routeDetails(routeid, key)

Arguments

routeid

Route ID number for the route of interest (string)

key

your Walk Score API key (string)

Details

Route ID is a unique string of characters used to identfy routes. They can be obtained through the search functions provided in this library.

Value

Returns an object of class RouteDetails, basically a list of the following elements:

routeID

The route ID of the route of intrest (same as input ID)

routeName

Name of the route of interest

routeCatagory

Mode of transportation associated with this route

agency

Transit agency associated with this route

agencyURL

Agency website

routeGeometry

Coordinates of route linestring, used for mapping the route.

stopList

List of stop ID's served by this route.

Note

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Author(s)

John Whalen

References

http://www.walkscore.com/professional/public-transit-api.php

See Also

networkSearch,stopDetails

Examples

## Not run: 
routeDetails("r415","your key")

## End(Not run)

Stop Details

Description

A function to perform the Stop Details API call, which provides additional information about a transit stop of interest.

Usage

stopDetails(stopid, key)

Arguments

stopid

The stop ID of the stop of interest. (string)

key

your Walk Score API key. (string)

Details

Stop ID is a unique string of characters used to identfy stops. They can be obtained through the search functions provided in this library.

Value

Returns an object of class StopDetails, basically a list of the following elements:

stopID

ID of the stop of interest (same as input ID)

stopName

Name of stop of interest.

stopLong

Longitude of stop of interest.

stopLat

Latitude of stop of interest.

routeList

List of route ID's which serve the stop of interest.

Note

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Author(s)

John Whalen

References

http://www.walkscore.com/professional/public-transit-api.php

See Also

stopSearch, networkSearch

Examples

## Not run: 
stopDetails("s13993", "your key")

## End(Not run)

Stop Search

Description

A function to preform the Stop Search API Call.

Usage

stopSearch(x, y, key)

Arguments

x

longitude of query location (numeric)

y

latitude of query location (numeric)

key

your Walk Score API key (string)

Details

The Stop Search API Call returns the sixteen closest stops to a query location which service unique routes.

Value

Returns a list of objects of class "Stop2", which are basically lists with the following elements:

stopID

A unique ID for the particular stop, which can be used to get additional info about that stop.

stopName

Name of the particular stop.

stopDistance

Distance to the query location, in miles.

stopLong

Longitude of the particular stop.

stopLat

Latitude of the particular stop.

routeDetails

Object of class "RouteDetails", which lists the route id, name, catagory, and agency of the orute served at the stop.

Note

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Author(s)

John Whalen

References

http://www.walkscore.com/professional/public-transit-api.php

See Also

stopDetails, networkSearch

Examples

## Not run: 
stopSearch(-73.98496,40.74807,"your key")

## End(Not run)

Return Walk Shed

Description

A function to preform the "Walking Distance" API Call.

Usage

walkshed(x, y, key)

Arguments

x

longitude of query location (numeric)

y

latitude of query location (numeric)

key

your Walk Score API key (string)

Details

The "Walking Distance" API call returns the geometry of a polygon which bounds network walking distance from the given origin point.

Value

Returns an object of class "Walkshed", which is basically a list with the following elements:

status

A code which tells the status of the request. The table of status codes can be found on the Walk Score API site. A status of 1 means a successful request.

origin

Latitude and longitude of the walkshed center.

geometry

Geometry type of walkshed.

coordinates

List of walkshed polygon vertexes, returned as a data frame with two columns.

radius

Network distance in miles.

snappedLong

longitude to which the input was snapped to.

snappedLat

latitude to which the input was snapped to.

Note

Visit www.walkscore.com for information on Walk Score and to obtain an API key

Author(s)

John Whalen

References

http://www.walkscore.com/professional/public-transit-api.php

Examples

## Not run: 
walkshed(-122.335,47.5815,"your key")

## End(Not run)