10.2. Geocoding

Geocoding is the process by which information is associated with particular geographic points in the world. These points are identified by degrees in latitude and longitude, which you may remember from grade school as the north-south and east-west measurements, respectively. It may surprise you to know that most mapping APIs don't actually know the location of addresses; they know the location of points given in latitude and longitude. All addresses must be converted to a set of points before being located on a map.

All of the mapping APIs require the use of degree decimals for both latitude and longitude. This is different from what you probably learned about in school, where latitude and longitude are identified by degrees, minutes, and seconds. If you have a location in this format, you'll need to use a converter to get the degree decimal values. And of course, if you have an address, you'll need to convert that to latitude and longitude into degree decimals as well.

10.2.1. Geocoding Web Sites

Most countries provided geocoded information about the terrain through census records. In the United States, for instance, the U.S. Census Bureau geocodes nearly every highway and surface street in the country. Further, this data is in the public domain and can be accessed via the Topologically Integrated Geographic Encoding and Referencing system (Tiger, www.census.gov/geo/www/tiger). Plowing through all of this information is an arduous process since there's more than 20 GB of data for the United States alone. With the new interest in mapping and mashups, a number of services have arisen to allow easier access to geocoded information.

  • geocoder.us (www.geocoder.us): This web site can return the latitude and longitude of any address in the United States. Simply go to the web site and enter in an address. The information returned includes both the degrees/minutes/seconds and degree decimal formats of the location, as well as an up-close map.

  • Travel GIS (www.travelgis.com/geocode): This site offers geocoded information for 24 countries in a very simple interface. Addresses are returned in decimal format only.

  • worldKit GeoCoder (http://brainoff.com/geocoder): This is a simple web site where you can enter in an address and it returns the latitude/longitude coordinates in decimal format along with some additional information. It gives you a map of the world and pinpoints each location you enter on that map with a red dot. You can zoom in and out on the map as well as click on it to get the latitude and longitude of any point in the world.

10.2.2. Geocoding Services

Even though web sites providing geocode information are useful, they are only minimally so when creating a mashup. Most mashups require a dynamic lookup of geocoded information as the user interacts with the application. To aid in this case, there are several geocoding web services offering address lookup in real time:

  • Yahoo! Maps Geocoding Service (http://developer.yahoo.com/maps/rest/V1/geocode.html): This RESTful service returns XML containing the latitude, longitude, street address, city, state, and zip code of the entered address. As this is purely for noncommercial purposes, you are limited to 5,000 lookups per day, and you must sign up for a Yahoo! Application ID at http://api.search.yahoo.com/webservices/register_application.

  • Google Maps Geocoding Service (www.google.com/apis/maps/documentation/#Geocoding_Examples): This lightweight API can be formatted to return data in XML, KML (Google's Keyhole Markup Language), CSV, or JSON and returns all of the information about a given address, including its coordinates and full address information (country, zip code, etc.). As with the Yahoo! version, this is for noncommercial use only; there is also a limit of 50,000 lookups per day. Before using the Google Maps Geocoding Service, you must sign up for an API key at www.google.com/apis/maps/signup.html. The Google Maps API also has JavaScript access to geocoding information.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset