Convert Street Addresses to Latitude and Longitude
The Geocode Service uses Geocoder.US to replace a selected street address with its approximate latitude and longitude.
Geocoding works by interpolating the position of an address between the endpoints of a street segment of known location and address range. The Census Bureau maintains a public dataset commonly used for this purpose. Geocoding accuracy is limited by the accuracy of the reference dataset as well by assumptions about the regular distribution of addresses along a street. For this reason it works most reliably in urban environments where successive addresses are physically adjacent and uniformly distributed along the length of the street.
From Geocoder.US:
For urban addresses, the coordinates given by Geo::Coder::US can be within 10 or 15 meters of the actual location — which is well within the range of typical GPS accuracy! Other times the coordinates can be off, so use your own judgement when using the data!
The difference between reference datasets and geocoding algorithms can be examined by plotting the result coordinates from one source against the results of another, as shown here:
Screencast
Learn what this is and how to use it by example.
- Animated Demonstration (226k Flash animation)
Download
The Geocode Service was written as an experiment with AppleScript and ThisService. The actual utility of a text replacement geocoding interface remains doubtful. You have been warned!
- Geocode Service 1.0.1 (14k) Mac OS X Service
- AppleScript Source (3k) includes notes
If you’re into Services, Service Scrubber may also come in handy.
Installation
Unzip the Geocode Service. Suggested installation location: ~/Library/Services/
Log out and log in and you’ll see a new “Geocode” item in the system-wide Services menu (which appears in the bold application menu next to the Apple menu). The service will only be available when some text is selected. Since the Geocode Service must communicate with Geocoder.US it requires an active internet connection.
Usage
If the selected text can be geocoded, it will be replaced by a latitude, longitude
coordinate pair. If more than one point is found that matches the selected address,
each coordinate pair will be separated by semicolons: lat1, lon1; lat2, lon2.
If the selection cannot be geocoded it will not be changed.
Addresses may be specified as a number and street name or as the intersection of two streets. Addresses must be followed by a city and state or a ZIP code. Examples of valid addresses include:
- 4400 Vestal Parkway East, 13850 → 42.095949, -75.96385
- Front and Main, Binghamton, NY → 42.099275, -75.91734
