views:

26

answers:

1

I'm trying to make something that parses text for possible addresses and turns them into Google Maps links. Is there any reference for the most general address format that Google Maps will accept as a query? Seems like something they'd want to make public, but I can't find anything in the docs.

A: 

You should give a look at Google Static Maps API.

Addresses

Most people don't speak in latitudes and longitudes; they denote locations using addresses. The process of turning an address into a geographic point is known as geocoding and the Static Maps service can perform geocoding for you if you provide valid addresses.

In any parameter where you may provide a latitude/longitude, you may instead specify a string indicating an address. Google will geocode the address and provide the Static Map service with a latitude/longitude value to use in placing markers or specifying locations. The string should be URL-escaped, so addresses such as "City Hall, New York, NY" should be converted to "City+Hall,New+York,NY", for example.

Note that addresses may reflect either precise locations, such as street addresses, polylines such as named routes, or polygonal areas such as cities, countries, or national parks. For polylinear and polygonal results, the Static Map server will use the center point of the line/area as the address center. If you have doubt about how an address may geocode, you can test out the address using this Geocoding Utility.

The following example generates a static map for Berkeley, CA:

http://maps.google.com/maps/api/staticmap?center=Berkeley,CA&zoom=14&size=400x400&sensor=false

Resources :

Colin Hebert
Thank you. I have had a look at that, and it doesn't answer the specific question of which strings will and won't count as an address. Trying out different formats should be good enough, but I'd rather have something exhaustive.
Erik K.
You don't really have to change your strings into "google compatible strings", google does this for you.
Colin Hebert
I understand that Google tries to accept as many strings as possible that correspond to real street addresses. I am looking for a public reference that provides a broad description of which strings Google Maps will even try to parse. If I can find this reference, I will make that my criterion for what counts as an address. If this is not available I will work without it.
Erik K.