Aller au contenu

Durée De Trajet Entre Chez Vous Et Votre Travail Ou Autre


Steven

Messages recommandés

Hello - petit retour

 

j'ai toujours le VD Waze de Krikroff qui tourne et les chemins ne sont pas les memes.

Waze me dit 27mn via A86 Ext

Gmaps me dit 31mn via D159

 

pourtant dans l'option soit j'ai rien mis soit je mets avoids=tolls

 

mais c'est tjs la meme route;

Lien vers le commentaire
Partager sur d’autres sites

Difficile de répondre sans avoir les mêmes coordonnées que toi.

 

On est bien d'accord que &avoid=tolls ne concerne que les autoroutes à  péages et pas les autres ? (Ne pas oublier le &)

Lien vers le commentaire
Partager sur d’autres sites

  • 1 mois après...

@Sakkhho,

J'ai fait une 2ème version plus proche de celle de Krikroff mais toujours via les API Google .. cela afin de voir le résumé du trajet selon ta demande

 

mini_532260TrajetV2.png

 

Ci-joint le nouveau module virtuel ainsi que la nouvelle scène qui se configure ainsi : 

 

local trajets = {
    {
    	depart = "37+rue+du+bois+Annecy+France",
    	arrivee = "7+rue+des+Fontaines+Geneva+Switzerland",
    	options = "&avoid=highways",
    	module_virtuel = 475
    }
} 

La clé n'est plus la même car avant on utilisait l'API "Distance" et maintenant il nous faut celui-ci : https://developers.google.com/maps/documentation/directions/

 

Cette scène ne se lance pas automatiquement, j'utilise GEA pour la lancer toutes les 5mn .. à  toi de voir comment tu veux faire.

 

@jojo

Voir le lien ci-dessus : https://developers.google.com/maps/documentation/directions/

mini_241510ApiGoogle.png

 

J'ai importé le VD mais aucun code est inscrit dedans.

Est-il possible d'avoir le code au complet à  copier?

 

 

Merci d'avance

Lien vers le commentaire
Partager sur d’autres sites

  • 3 mois après...

Gros bug stupide corrigé : http://www.domotique-fibaro.fr/index.php/topic/8368-durée-de-trajet-entre-chez-vous-et-votre-travail-ou-autre/?p=128349

 

Le script ne prenait en compte que la durée moyenne et non pas la durée dans le trafic. La scène a été modifée.

 

Merci à  @julianfpaternina

Lien vers le commentaire
Partager sur d’autres sites

  • 4 mois après...

Via une api...

 

Voici ce que je peux récupérer dans mon navigateur:  Attention ça pique ...:(

 

{"tickets":[],"links":[{"href":"https:\/\/api.sncf.com\/v1\/coverage\/sncf\/journeys?to=admin%3Afr%3A21231&from=admin%3Afr%3A71076&datetime_represents=departure&datetime=20170323T055201","type":"next","rel":"next","templated":false},{"href":"https:\/\/api.sncf.com\/v1\/coverage\/sncf\/journeys?to=admin%3Afr%3A21231&from=admin%3Afr%3A71076&datetime_represents=arrival&datetime=20170323T063859","type":"prev","rel":"prev","templated":false},{"href":"https:\/\/api.sncf.com\/v1\/coverage\/sncf\/journeys?to=admin%3Afr%3A21231&from=admin%3Afr%3A71076&datetime_represents=departure&datetime=20170323T000000","type":"first","rel":"first","templated":false},{"href":"https:\/\/api.sncf.com\/v1\/coverage\/sncf\/journeys?to=admin%3Afr%3A21231&from=admin%3Afr%3A71076&datetime_represents=arrival&datetime=20170323T235959","type":"last","rel":"last","templated":false},{"href":"https:\/\/api.sncf.com\/v1\/coverage\/sncf\/stop_points\/{stop_point.id}","type":"stop_point","rel":"stop_points","templated":true},{"href":"https:\/\/api.sncf.com\/v1\/coverage\/sncf\/stop_areas\/{stop_area.id}","type":"stop_area","rel":"stop_areas","templated":true}],"journeys":[{"fare":{"found":false,"total":{"currency":"","value":"0.0"},"links":[]},"status":"","tags":["walking","ecologic"],"nb_transfers":0,"durations":{"walking":0,"total":2820},"arrival_date_time":"20170323T063900","calendars":[{"active_periods":[{"begin":"20170301","end":"20170326"}],"week_pattern":{"monday":true,"tuesday":true,"friday":true,"wednesday":true,"thursday":true,"sunday":false,"saturday":true}}],"departure_date_time":"20170323T055200","requested_date_time":"20170322T215126","sections":[{"from":{"embedded_type":"administrative_region","quality":0,"administrative_region":{"insee":"71076","name":"Chalon-sur-Sa\u00f4ne","level":8,"coord":{"lat":"46.788898","lon":"4.85296"},"label":"Chalon-sur-Sa\u00f4ne (71100)","id":"admin:fr:71076","zip_code":"71100"},"id":"admin:fr:71076","name":"Chalon-sur-Sa\u00f4ne (71100)"},"links":[],"arrival_date_time":"20170323T055200","co2_emission":{"value":0.0,"unit":""},"to":{"embedded_type":"stop_point","stop_point":{"name":"Chalon-sur-Sa\u00f4ne","links":[],"coord":{"lat":"46.781561","lon":"4.843487"},"label":"Chalon-sur-Sa\u00f4ne (Chalon-sur-Sa\u00f4ne)","equipments":[],"administrative_regions":[{"insee":"71076","name":"Chalon-sur-Sa\u00f4ne","level":8,"coord":{"lat":"46.788898","lon":"4.85296"},"label":"Chalon-sur-Sa\u00f4ne (71100)","id":"admin:fr:71076","zip_code":"71100"}],"id":"stop_point:OCE:SP:TrainTER-87725002","stop_area":{"codes":[{"type":"CR-CI-CH","value":"0087-725002-BV"}],"name":"Chalon-sur-Sa\u00f4ne","links":[],"coord":{"lat":"46.781561","lon":"4.843487"},"label":"Chalon-sur-Sa\u00f4ne (Chalon-sur-Sa\u00f4ne)","timezone":"Europe\/Paris","id":"stop_area:OCE:SA:87725002"}},"quality":0,"id":"stop_point:OCE:SP:TrainTER-87725002","name":"Chalon-sur-Sa\u00f4ne (Chalon-sur-Sa\u00f4ne)"},"departure_date_time":"20170323T055200","duration":0,"type":"crow_fly","id":"section_0_0","mode":"walking"},{"from":{"embedded_type":"stop_point","stop_point":{"name":"Chalon-sur-Sa\u00f4ne","links":[],"coord":{"lat":"46.781561","lon":"4.843487"},"label":"Chalon-sur-Sa\u00f4ne (Chalon-sur-Sa\u00f4ne)","equipments":[],"administrative_regions":[{"insee":"71076","name":"Chalon-sur-Sa\u00f4ne","level":8,"coord":{"lat":"46.788898","lon":"4.85296"},"label":"Chalon-sur-Sa\u00f4ne (71100)","id":"admin:fr:71076","zip_code":"71100"}],"id":"stop_point:OCE:SP:TrainTER-87725002","stop_area":{"codes":[{"type":"CR-CI-CH","value":"0087-725002-BV"}],"name":"Chalon-sur-Sa\u00f4ne","links":[],"coord":{"lat":"46.781561","lon":"4.843487"},"label":"Chalon-sur-Sa\u00f4ne (Chalon-sur-Sa\u00f4ne)","timezone":"Europe\/Paris","id":"stop_area:OCE:SA:87725002"}},"quality":0,"id":"stop_point:OCE:SP:TrainTER-87725002","name":"Chalon-sur-Sa\u00f4ne (Chalon-sur-Sa\u00f4ne)"},"links":[{"type":"vehicle_journey","id":"vehicle_journey:OCE:SN891400F01004_dst_1"},{"type":"line","id":"line:OCE:725921"},{"type":"route","id":"route:OCE:725921-TrainTER-87725002-87713040"},{"type":"commercial_mode","id":"commercial_mode:ter"},{"type":"physical_mode","id":"physical_mode:LocalTrain"},{"type":"network","id":"network:sncf"}],"arrival_date_time":"20170323T063900","additional_informations":["regular"],"co2_emission":{"value":2063.347,"unit":"gEC"},"display_informations":{"direction":"Dijon-Ville (Dijon)","code":"","description":"","links":[],"color":"000000","physical_mode":"TER","headsign":"891400","commercial_mode":"TER","equipments":[],"label":"Dijon - Chalon - M\u00e2con","text_color":"","network":"SNCF"},"to":{"embedded_type":"stop_point","stop_point":{"name":"Dijon-Ville","links":[],"coord":{"lat":"47.323392","lon":"5.027278"},"label":"Dijon-Ville (Dijon)","equipments":[],"administrative_regions":[{"insee":"21231","name":"Dijon","level":8,"coord":{"lat":"47.321579","lon":"5.04147"},"label":"Dijon (21000)","id":"admin:fr:21231","zip_code":"21000"}],"id":"stop_point:OCE:SP:TrainTER-87713040","stop_area":{"codes":[{"type":"CR-CI-CH","value":"0087-713040-BV"}],"name":"Dijon-Ville","links":[],"coord":{"lat":"47.323392","lon":"5.027278"},"label":"Dijon-Ville (Dijon)","timezone":"Europe\/Paris","id":"stop_area:OCE:SA:87713040"}},"quality":0,"id":"stop_point:OCE:SP:TrainTER-87713040","name":"Dijon-Ville (Dijon)"},"base_arrival_date_time":"20170323T063900","base_departure_date_time":"20170323T055200","departure_date_time":"20170323T055200","geojson":{"type":"LineString","properties":[{"length":67210}],"coordinates":[[4.843487,46.781561],[4.749648,46.907419],[4.848722,47.02303],[4.956226,47.130657],[4.998787,47.227377],[5.027278,47.323392]]},"duration":2820,"type":"public_transport","id":"section_1_0","stop_date_times":[{"stop_point":{"name":"Chalon-sur-Sa\u00f4ne","links":[],"coord":{"lat":"46.781561","lon":"4.843487"},"label":"Chalon-sur-Sa\u00f4ne (Chalon-sur-Sa\u00f4ne)","equipments":[],"id":"stop_point:OCE:SP:TrainTER-87725002"},"links":[],"arrival_date_time":"20170323T055200","additional_informations":[],"departure_date_time":"20170323T055200","base_arrival_date_time":"20170323T055200","base_departure_date_time":"20170323T055200"},{"stop_point":{"name":"Chagny","links":[],"coord":{"lat":"46.907419","lon":"4.749648"},"label":"Chagny (Chagny)","equipments":[],"id":"stop_point:OCE:SP:TrainTER-87713578"},"links":[],"arrival_date_time":"20170323T060100","additional_informations":[],"departure_date_time":"20170323T060200","base_arrival_date_time":"20170323T060100","base_departure_date_time":"20170323T060200"},{"stop_point":{"name":"Beaune","links":[],"coord":{"lat":"47.02303","lon":"4.848722"},"label":"Beaune (Beaune)","equipments":[],"id":"stop_point:OCE:SP:TrainTER-87713545"},"links":[],"arrival_date_time":"20170323T061000","additional_informations":[],"departure_date_time":"20170323T061100","base_arrival_date_time":"20170323T061000","base_departure_date_time":"20170323T061100"},{"stop_point":{"name":"Nuits-St-Georges","links":[],"coord":{"lat":"47.130657","lon":"4.956226"},"label":"Nuits-St-Georges (Nuits-Saint-Georges)","equipments":[],"id":"stop_point:OCE:SP:TrainTER-87713529"},"links":[],"arrival_date_time":"20170323T061900","additional_informations":[],"departure_date_time":"20170323T062000","base_arrival_date_time":"20170323T061900","base_departure_date_time":"20170323T062000"},{"stop_point":{"name":"Gevrey-Chambertin","links":[],"coord":{"lat":"47.227377","lon":"4.998787"},"label":"Gevrey-Chambertin (Gevrey-Chambertin)","equipments":[],"id":"stop_point:OCE:SP:TrainTER-87713503"},"links":[],"arrival_date_time":"20170323T062900","additional_informations":[],"departure_date_time":"20170323T063000","base_arrival_date_time":"20170323T062900","base_departure_date_time":"20170323T063000"},{"stop_point":{"name":"Dijon-Ville","links":[],"coord":{"lat":"47.323392","lon":"5.027278"},"label":"Dijon-Ville (Dijon)","equipments":[],"id":"stop_point:OCE:SP:TrainTER-87713040"},"links":[],"arrival_date_time":"20170323T063900","additional_informations":[],"departure_date_time":"20170323T063900","base_arrival_date_time":"20170323T063900","base_departure_date_time":"20170323T063900"}]},{"from":{"embedded_type":"stop_point","stop_point":{"name":"Dijon-Ville","links":[],"coord":{"lat":"47.323392","lon":"5.027278"},"label":"Dijon-Ville (Dijon)","equipments":[],"administrative_regions":[{"insee":"21231","name":"Dijon","level":8,"coord":{"lat":"47.321579","lon":"5.04147"},"label":"Dijon (21000)","id":"admin:fr:21231","zip_code":"21000"}],"id":"stop_point:OCE:SP:TrainTER-87713040","stop_area":{"codes":[{"type":"CR-CI-CH","value":"0087-713040-BV"}],"name":"Dijon-Ville","links":[],"coord":{"lat":"47.323392","lon":"5.027278"},"label":"Dijon-Ville (Dijon)","timezone":"Europe\/Paris","id":"stop_area:OCE:SA:87713040"}},"quality":0,"id":"stop_point:OCE:SP:TrainTER-87713040","name":"Dijon-Ville (Dijon)"},"links":[],"arrival_date_time":"20170323T063900","co2_emission":{"value":0.0,"unit":""},"to":{"embedded_type":"administrative_region","quality":0,"administrative_region":{"insee":"21231","name":"Dijon","level":8,"coord":{"lat":"47.321579","lon":"5.04147"},"label":"Dijon (21000)","id":"admin:fr:21231","zip_code":"21000"},"id":"admin:fr:21231","name":"Dijon (21000)"},"departure_date_time":"20170323T063900","duration":0,"type":"crow_fly","id":"section_2_0","mode":"walking"}],"co2_emission":{"value":2063.347,"unit":"gEC"},"duration":2820,"type":"best"}],"disruptions":[],"notes":[],"feed_publishers":[],"context":{"car_direct_path":{"co2_emission":{"value":15138.9397330868,"unit":"gEC"}}},"exceptions":[]}

 

 

ben voilà... c'est pas grand chose pour commencer ....:huh:

Lien vers le commentaire
Partager sur d’autres sites

×
×
  • Créer...