atom feed4 messages in Lat/Lon Google Maps Query URL for...
FromSent OnAttachments
trevogreJul 11, 2005 11:08 am 
jlou...@pacbell.netJul 11, 2005 12:05 pm 
Trevor GreenJul 11, 2005 12:52 pm 
MattJul 11, 2005 12:57 pm 
Subject:RE: Lat/Lon Google Maps Query URL format?
From:Trevor Green (
Date:Jul 11, 2005 12:52:34 pm

spn=15.854680,10.604004& saddr=98390& daddr=El+Camino+Real+and+Embarcadero+Rd,+Palo+Alto+CA++94301&hl=en

So the answer is. Spn (Start Point) Saddr (Start Address) Daddr (Destination Address)

Thank you for the code as well but I'm using ASP and/or so I would have to rewrite it anyway to strip the lat/lon. What I'm probably going to do is only use lat/lon when google maps can't find the address, constructing and interface with the API that lets me pick the location and then submit the resulting lat/lon into the database. That process won't require striping because I will only be doing it where there is no viable result anyway.

Does someone have a complete querystring reference for the google map? Page?

-----Original Message----- From: [] On Behalf Of Sent: Monday, July 11, 2005 12:06 PM To: Subject: Re: Lat/Lon Google Maps Query URL format?

Hello, I wrote the following function, using to get lat/lon. Note that the response is an html page - you need to strip it. Then store the lat/lon in your database to improve the speed of rendering.

This all comes up nicely - check for instance: (click the "Map" link).

You'll get an idea also for the driving directions....

// ============================= function get_lat_long($address) // ============================= { // get latitude,longitude from an address (using!) $gm = fopen('' . str_replace(' ','+',$address) . '&output=js','r'); $tmp = @fread($gm,30000); fclose($gm); $lat=ereg_replace(".*center lat=\"","",$tmp); $lat=ereg_replace("\".*","",$lat); $lon=ereg_replace(".*lng=\"","",$tmp); $lon=ereg_replace("\".*","",$lon); return(array($lat,$lon)); }

Note that you'll need to test the parsing in your database. You'll likely have some addresses pointing somewhere in Iran! Center of the world map I guess....

I hope this helps! Jean-Louis Brunet

trevogre wrote:

Is there a way to query Google Maps from a pre-existing Lat / Lon.

What I want to do is resolve my address database in lat/lon values for each address, any address that I cannot geocode I would like to manually locate their lat / lon. And then I would like to send those to google for a map and get driving directions from an address to the lat/lon.

I guess what I would like to see is.

Or some equivilent.

I was also wondering what the query format would be for getting driving directions from a url like: