*! version 1.0.0 12jun2013

help geocodeopen

Title

geocodeopen -- Geocode addresses using MapQuest Open Geocoding Services and Open Street Maps

Syntax

geocodeopen
[if] [in]
[,
options]

Main
keyname(AppKey) specify MapQuest AppKey

address(varname) specify varname of address variable

city(varname) specify varname of city variable

state(varname) specify varname of state variable

zip(varname) specify varname of ZIP code variable

fulladdr(varname) specify varname of full address variable

replace replace latitude and longitude variables if they exist

Description

geocodeopen uses MapQuest Open Geocoding APIs to geocode addresses and calculate latitude and longitude. This allows it to overcome the restrictive limits on number of queries imposed by geocode commands that use the Google Maps API.

Options

Main

key(keyname) specifies your MapQuest Application Key, keyname (necessary to use the MapQuest APIs). The argument keyname should be enclosed in quotation marks. Request an Application Key from http://developer.mapquest.com

address(varname) specifies that varname contains the street number and street name.

city(varname) specifies that varname contains the city.

state(varname) specifies that varname contains the state (two letter postal abbreviation).

zip(varname) specifies that varname contains the ZIP code.

fulladdr(varname) may be used to specify that varname contains the full address in the form: 1234 Main St, Sunnydale, CA 95037

replace instructs geocodeopen to overwrite variables named latitude and longitude if they already exist.

Remarks

geocodeopen generates variables latitude and longitude that contain the geocoded latitudes and longitudes for a list of specified addresses.

It also generates the following variables: geo_type, geo_quality, geo_address, geo_city, geo_state, geo_zip. The variable geo_type specifies the granularity of the geocoding, and the variable geo_quality specifies the quality of the geocoding. The variables geo_address, geo_city, geo_state, and geo_zip report how MapQuest interpreted the address, city, state, and ZIP code respectively. The geo_type and geo_quality variables may be interpreted using the code book available at http://open.mapquestapi.com/geocoding/geocodequality.html

As of June 2013, MapQuest requires an AppKey in order to make API calls. An AppKey may be requested at no charge by signing up at http://developer.mapquest.com. Alternatively, you may specify the following AppKey, but no guarantees are made that it will work: youFmjtd%7Cluub2gualu%2Ca2%3Do5-9uaaqr

Geocoding Courtesy of MapQuest. Data generated from this program are made available under the Open Database License: http://opendatacommons.org/licenses/odbl/1.0/. Any rights in individual contents of the database are licensed under the Database Contents License: http://opendatacommons.org/licenses/dbcl/1.0/.

Examples

. geocodeopen in 1/1000, key("youFmjtd%7Cluub2gualu%2Ca2%3Do5-9uaaqr") address(home_address) city(city_name) state(name_of_state) zip(numerical_zipcode)

. geocodeopen, key("youFmjtd%7Cluub2gualu%2Ca2%3Do5-9uaaqr") fulladdr(full_address) replace

Author

Michael L. Anderson, UC Berkeley, mlanderson@berkeley.edu, http://are.berkeley.edu/~mlanderson/