Mileage By State

959 views
Skip to first unread message

Peter demaria

unread,
Nov 17, 2011, 11:52:58 AM11/17/11
to google-map...@googlegroups.com
Dear Google Maps Javascript API v3 Group,
I'm searching for a way to break the output of Googles Directions API for directions based on an Origin, Waypoints, and Destination into Mileage by US State.

I've done a lot of googling and looked through the documentation but I'm not seeing anything that looks like some kind of explicit object that I could use to calculate the mileage in a per-State way. Any thoughts?

You would think that a Stateline would constitute some type of object, at least as a Point of Interest or a flag that would be available as a breakpoint.

I've seen the manual approach, whereby you would manually place markers and then look at the segments, but I don't see this being a workable solution for a larger scale implementation, and I'd love to think there were a more dynamic approach.

Any thoughts?

Rossko

unread,
Nov 17, 2011, 2:47:55 PM11/17/11
to Google Maps JavaScript API v3
> You would think that a Stateline would constitute some type of object, at
> least as a Point of Interest or a flag that would be available as a
> breakpoint.

Directions service provides directions, its not purposed to provide
points of interest. You could make an enhancement request, and see if
anyone else supports it. The last such request I could find was in
the v2 group in 2007

> I've seen the manual approach, whereby you would manually place markers and
> then look at the segments, but I don't see this being a workable solution
> for a larger scale implementation

You've probably already seen
http://econym.org.uk/gmap/state_mileage.htm
and no, it wouldn't work well on a large scale. Directions itself
doesn't work well in volume, nor is it intended to. Why do you need it
in volume, how many sets of Directions do you need at once?

Marcelo

unread,
Nov 17, 2011, 3:14:10 PM11/17/11
to Google Maps JavaScript API v3
On Nov 17, 9:52 am, Peter demaria <peter.dema...@bluetonemedia.com>
wrote:
> *Dear Google Maps Javascript API v3 Group,*
> I'm searching for a way to break the output of Googles Directions API for
> directions based on an Origin, Waypoints, and Destination into Mileage by
> US State.

Here's an example that shows you the mileage by county:
http://maps.forum.nu/v3/gm_directions.html

but the "magic" on the server side requires a database with spatial
capabilities.
Note that, as this is hosted on a shared server, the counties might
take a couple of seconds to appear on the right hand panel.

--
Marcelo - http://maps.forum.nu
--

Peter demaria

unread,
Nov 18, 2011, 9:58:16 AM11/18/11
to Google Maps JavaScript API v3
Marcelo,
Not sure if you received my previous response (I'm new to google
groups).. the implementation you created was just about perfect.. The
only difference being that I would query for States instead of
counties, and I really don't even need to render a map (though it is a
nice touch). The elevation tracking for the trip is awesome by the
way.

Is it absolutely necessary to have a Spatial Database to produce this
kind of calculation? Is this something that is relative easy to
integrate with a php based site on a linux server running a mySQL
database?

I've since discovered PostGIS but am not familiar with it and am not
sure how I would shape my ajax request to produce the desired results
(the breakdown of mileage by state).

Appreciate the help!

PS. I will post code once I get something working.. but I have to say
I'm looking into the MapQuest API as a possible alternative

On Nov 17, 3:14 pm, Marcelo <marcelo...@hotmail.com> wrote:
> On Nov 17, 9:52 am, Peter demaria <peter.dema...@bluetonemedia.com>
> wrote:
>
> > *Dear Google Maps Javascript API v3 Group,*
> > I'm searching for a way to break the output of Googles Directions API for
> > directions based on an Origin, Waypoints, and Destination into Mileage by
> > US State.
>
> Here's an example that shows you the mileage by county:http://maps.forum.nu/v3/gm_directions.html
>
> but the "magic" on the server side requires a database with spatial
> capabilities.
> Note that, as this is hosted on a shared server, the counties might
> take a couple of seconds to appear on the right hand panel.
>
> --
> Marcelo -http://maps.forum.nu

Andrew Leach

unread,
Nov 18, 2011, 2:39:15 PM11/18/11
to google-map...@googlegroups.com
On 18 November 2011 14:58, Peter demaria

<peter....@bluetonemedia.com> wrote:
> I really don't even need to render a map (though it is a
> nice touch).

Um... See 10.1.1(g) http://code.google.com/apis/maps/terms.html

Peter demaria

unread,
Nov 18, 2011, 10:49:26 PM11/18/11
to Google Maps JavaScript API v3
Ok, fair enough.. thanks for the warning...

But not very helpful. Does it really matter? Sure I can display a
map.. But it doesn't do me much good if I can't break the length of a
trip down to miles per state.


On Nov 18, 2:39 pm, Andrew Leach <andrew.leac...@gmail.com> wrote:
> On 18 November 2011 14:58, Peter demaria
>

Reply all
Reply to author
Forward
0 new messages