Duration and path matrix using Google maps API

25 views
Skip to first unread message

dassouki

unread,
Aug 2, 2009, 11:34:51 AM8/2/09
to Google Maps JavaScript API v3
Hey all,

This is my first post, so please bare with me :)

I have a 50 node matrix to which I'd like to build a travel_time and
duration matrices. I know that i have to use getDuration() and
getDistance() , and have also looked at
http://code.google.com/apis/ajax/playground/?exp=maps#map_directions_advanced
. The problem is that a 50 node matrix will return 2,500 results; is
there a way to do it "quietly" and output the results straight to a
csv file or JS array, in the form of:

node_1, node_2, travel_time, travel_distance ?

cheers,
dassouki

Bryan Field-Elliot

unread,
Aug 2, 2009, 11:52:38 AM8/2/09
to google-map...@googlegroups.com
I understand that, during initialization, we should pass "sensor=true"
or "false" depending upon whether we are using a mobile device that
does location tracking. But I can't find any explanation in the docs,
about what the Google Maps API actually does with this parameter. Can
someone explain exactly what the difference in behavior is, in Google
Maps, between "sensor=true" and "sensor=false"?

Thank you,

Bryan


dassouki

unread,
Aug 2, 2009, 2:25:43 PM8/2/09
to Google Maps JavaScript API v3
Note for some reason, my initial post got its title changed
http://groups.google.com/group/google-maps-js-api-v3/browse_frm/thread/4b97fc01ddbe27d8#

Hey all,

This is my first post, so please bare with me :)

I have a 50 node matrix to which I'd like to build a travel_time and
duration matrices. I know that i have to use getDuration() and
getDistance() , and have also looked at
http://code.google.com/apis/ajax/playground/?exp=maps#map_directions_...

Mike Williams

unread,
Aug 2, 2009, 4:49:09 PM8/2/09
to google-map...@googlegroups.com
The page behaves the same. Google just have an obligation to report
statistics to one or more of their data providers.

--
Mike Williams
Gentleman of Leisure

Mike Williams

unread,
Aug 2, 2009, 4:59:13 PM8/2/09
to google-map...@googlegroups.com
API v3 doesn't (yet) support getDuration() and getDistance().

API v2 does support those calls, but obtaining that information with the
intention of not using it for display on a Google Map is probably a
violation of the Terms. Also, 2500 calls will take quite a long time
because speed quotas are applied to maintain a reasonable service to
regular map users while limiting abusive behaviour.

dassouki

unread,
Aug 2, 2009, 5:15:52 PM8/2/09
to Google Maps JavaScript API v3
ah no big deal then, i usually do it with TransCAD or Tranus, but the
road layer for the network i'm doing now is very bad, so i thought i
might be able to use it with google maps. I don't mind publishing the
results and/or outputting the kml file

Bryan Field-Elliot

unread,
Aug 4, 2009, 1:55:28 PM8/4/09
to google-map...@googlegroups.com
Is this really true? I haven't seen any further comment from Google on
the question.

Ben Appleton

unread,
Aug 4, 2009, 3:36:40 PM8/4/09
to google-map...@googlegroups.com
There's an entry in the FAQ that covers this:
http://code.google.com/apis/maps/faq.html#tos_reporting
Reply all
Reply to author
Forward
0 new messages