Skip to content

Instantly share code, notes, and snippets.

@diyfr
Last active March 9, 2018 11:01
Show Gist options
  • Save diyfr/b2b8797012a5724f4e779016cd13abb9 to your computer and use it in GitHub Desktop.
Save diyfr/b2b8797012a5724f4e779016cd13abb9 to your computer and use it in GitHub Desktop.
Recherche d'un itinéraire à partir des codes UIC de la gare de départ et la gare d'arrivée en utilisant les Apis SNCF https://www.digital.sncf.com/startup/api
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<title>Itinéraire Api fo Angular</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
</head>
<body>
<div ng-app="app" ng-controller="DeparturesCtrl">
<h5>Affiche les départs d'une Gare des 4 dernières heures en limitant le résultat à 200 lignes</h5>
Saisissez votre code UIC de la gare puis votre clé API et appuyez sur entrée<br/>
Code UIC de la gare DEPART:
<input type="text" name="fromUIC" ng-model="fromUIC" required placeholder="Saisissez le code UIC de Départ la gare"><br/>
Code UIC de la gare ARRIVEE:
<input type="text" name="toUIC" ng-model="toUIC" required placeholder="Saisissez le code UIC d'Arrivée la gare"><br/>
Clé API (<a href="https://data.sncf.com/api">https://data.sncf.com/api</a>)
<input type="text" name="apiKey" ng-model="apiKey" required ng-keypress="($event.charCode==13)? search() : return" placeholder="<Entrée> pour valider">
<br/> <span style="color:red">{{error}}</span>
<ul>
<li ng-repeat="section in journey.sections">
{{section.departure_date_time | formatTime}} {{section.arrival_date_time | formatTime}} {{section.from.name}} {{section.to.name}} {{section.mode}} {{section.type}} {{section.display_informations && section.display_informations.physical_mode}} {{section.display_informations && section.display_informations.code}}
</li>
</ul>
</div>
<script>
var urlBase ="https://api.sncf.com/v1/coverage/sncf/journeys?from=stop_area:OCE:SA:{fromUIC}&to=stop_area:OCE:SA:{toUIC}";
// ANGULAR....
var app = angular.module('app', []);
app.filter('formatTime', function ($filter) {
return function (data) {
return data.substr(9).match(/.{2}/g).join(':');
};
});
app.controller("DeparturesCtrl", function($scope, $http) {
$scope.search= function(){
$scope.departures =undefined;
var url=urlBase.replace("{fromUIC}",$scope.fromUIC);
url=url.replace("{toUIC}",$scope.toUIC);
authorizationHeader = "Basic "+btoa($scope.apiKey);
$http({method:"GET", url, headers:{"Authorization":authorizationHeader, "Accept":"application/json"}}
).then(function(res){
if (res.data.journeys){
$scope.journey = res.data.journeys[0];
$scope.error=undefined;
}else{
$scope.error="Erreur dans la réponse";
}
},
function(error){
$scope.error="Introuvable";
}
);
};
});
</script>
</body>
</html>
{
"tickets" : [],
"links" : [{
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/journeys?to=stop_area%3AOCE%3ASA%3A87491803&from=stop_area%3AOCE%3ASA%3A87481002&datetime_represents=departure&datetime=20170626T170501",
"type" : "next",
"rel" : "next",
"templated" : false
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/journeys?to=stop_area%3AOCE%3ASA%3A87491803&from=stop_area%3AOCE%3ASA%3A87481002&datetime_represents=arrival&datetime=20170626T223059",
"type" : "prev",
"rel" : "prev",
"templated" : false
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/journeys?to=stop_area%3AOCE%3ASA%3A87491803&from=stop_area%3AOCE%3ASA%3A87481002&datetime_represents=departure&datetime=20170626T000000",
"type" : "first",
"rel" : "first",
"templated" : false
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/journeys?to=stop_area%3AOCE%3ASA%3A87491803&from=stop_area%3AOCE%3ASA%3A87481002&datetime_represents=arrival&datetime=20170626T235959",
"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
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/vehicle_journeys\/{vehicle_journey.id}",
"type" : "vehicle_journey",
"rel" : "vehicle_journeys",
"templated" : true
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/disruptions\/{disruption.id}",
"type" : "disruption",
"rel" : "disruptions",
"templated" : true
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/trips\/{trip.id}",
"type" : "trip",
"rel" : "trips",
"templated" : true
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/routes\/{route.id}",
"type" : "route",
"rel" : "routes",
"templated" : true
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/commercial_modes\/{commercial_mode.id}",
"type" : "commercial_mode",
"rel" : "commercial_modes",
"templated" : true
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/disruptions\/{disruptions.id}",
"type" : "disruptions",
"rel" : "disruptions",
"templated" : true
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/lines\/{line.id}",
"type" : "line",
"rel" : "lines",
"templated" : true
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/physical_modes\/{physical_mode.id}",
"type" : "physical_mode",
"rel" : "physical_modes",
"templated" : true
}, {
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/networks\/{network.id}",
"type" : "network",
"rel" : "networks",
"templated" : true
}
],
"journeys" : [{
"fare" : {
"found" : false,
"total" : {
"currency" : "",
"value" : "0.0"
},
"links" : []
},
"status" : "SIGNIFICANT_DELAYS",
"links" : [{
"href" : "https:\/\/api.sncf.com\/v1\/coverage\/sncf\/journeys?from=stop_area%3AOCE%3ASA%3A87481002&last_section_mode%5B%5D=walking&is_journey_schedules=True&direct_path=none&to=stop_area%3AOCE%3ASA%3A87491803&min_nb_journeys=5&min_nb_transfers=1&allowed_id%5B%5D=stop_point%3AOCE%3ASP%3ACorailIntercit%C3%A9-87491001&allowed_id%5B%5D=stop_point%3AOCE%3ASP%3ATrainTER-87491001&allowed_id%5B%5D=stop_point%3AOCE%3ASP%3ATrainTER-87491803&allowed_id%5B%5D=stop_point%3AOCE%3ASP%3ACorailIntercit%C3%A9-87481002&first_section_mode%5B%5D=walking",
"type" : "journeys",
"rel" : "same_journey_schedules",
"templated" : false
}
],
"tags" : ["walking", "ecologic"],
"nb_transfers" : 1,
"durations" : {
"walking" : 0,
"total" : 19560
},
"arrival_date_time" : "20170626T223100",
"calendars" : [{
"active_periods" : [{
"begin" : "20170604",
"end" : "20170701"
}
],
"week_pattern" : {
"monday" : true,
"tuesday" : true,
"friday" : true,
"wednesday" : true,
"thursday" : true,
"sunday" : true,
"saturday" : false
}
}
],
"departure_date_time" : "20170626T170500",
"requested_date_time" : "20170626T133345",
"sections" : [{
"from" : {
"embedded_type" : "stop_area",
"quality" : 0,
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-481002-BV"
}
],
"name" : "Nantes",
"links" : [],
"coord" : {
"lat" : "47.217516",
"lon" : "-1.541943"
},
"label" : "Nantes (Nantes)",
"administrative_regions" : [{
"insee" : "44109",
"name" : "Nantes",
"level" : 8,
"coord" : {
"lat" : "47.218636",
"lon" : "-1.554136"
},
"label" : "Nantes (44000-44300)",
"id" : "admin:fr:44109",
"zip_code" : "44000;44300"
}
],
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87481002"
},
"name" : "Nantes (Nantes)",
"id" : "stop_area:OCE:SA:87481002"
},
"links" : [],
"arrival_date_time" : "20170626T170500",
"co2_emission" : {
"value" : 0.0,
"unit" : ""
},
"to" : {
"embedded_type" : "stop_point",
"stop_point" : {
"name" : "Nantes",
"links" : [],
"coord" : {
"lat" : "47.217516",
"lon" : "-1.541943"
},
"label" : "Nantes (Nantes)",
"equipments" : [],
"administrative_regions" : [{
"insee" : "44109",
"name" : "Nantes",
"level" : 8,
"coord" : {
"lat" : "47.218636",
"lon" : "-1.554136"
},
"label" : "Nantes (44000-44300)",
"id" : "admin:fr:44109",
"zip_code" : "44000;44300"
}
],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87481002",
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-481002-BV"
}
],
"name" : "Nantes",
"links" : [],
"coord" : {
"lat" : "47.217516",
"lon" : "-1.541943"
},
"label" : "Nantes (Nantes)",
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87481002"
}
},
"quality" : 0,
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87481002",
"name" : "Nantes (Nantes)"
},
"departure_date_time" : "20170626T170500",
"duration" : 0,
"type" : "crow_fly",
"id" : "section_0_0",
"mode" : "walking"
}, {
"from" : {
"embedded_type" : "stop_point",
"stop_point" : {
"name" : "Nantes",
"links" : [],
"coord" : {
"lat" : "47.217516",
"lon" : "-1.541943"
},
"label" : "Nantes (Nantes)",
"equipments" : [],
"administrative_regions" : [{
"insee" : "44109",
"name" : "Nantes",
"level" : 8,
"coord" : {
"lat" : "47.218636",
"lon" : "-1.554136"
},
"label" : "Nantes (44000-44300)",
"id" : "admin:fr:44109",
"zip_code" : "44000;44300"
}
],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87481002",
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-481002-BV"
}
],
"name" : "Nantes",
"links" : [],
"coord" : {
"lat" : "47.217516",
"lon" : "-1.541943"
},
"label" : "Nantes (Nantes)",
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87481002"
}
},
"quality" : 0,
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87481002",
"name" : "Nantes (Nantes)"
},
"links" : [{
"type" : "vehicle_journey",
"id" : "vehicle_journey:OCE:SN003837F01001"
}, {
"type" : "line",
"id" : "line:OCE:24619"
}, {
"type" : "route",
"id" : "route:OCE:24619-CorailIntercit\u00e9-87481002-87581009"
}, {
"type" : "commercial_mode",
"id" : "commercial_mode:intercites"
}, {
"type" : "physical_mode",
"id" : "physical_mode:Train"
}, {
"type" : "network",
"id" : "network:sncf"
}
],
"arrival_date_time" : "20170626T204100",
"additional_informations" : ["regular"],
"co2_emission" : {
"value" : 2241.8767,
"unit" : "gEC"
},
"display_informations" : {
"direction" : "Bordeaux-St-Jean (Bordeaux)",
"code" : "",
"description" : "",
"links" : [{
"internal" : true,
"type" : "disruption",
"id" : "f74aa9ef-1c02-493e-91e6-927ae93db16c",
"rel" : "disruptions",
"templated" : false
}
],
"color" : "000000",
"physical_mode" : "Train",
"headsign" : "3837",
"commercial_mode" : "Intercit\u00e9s",
"equipments" : [],
"label" : "Nantes-Bordeaux",
"text_color" : "",
"network" : "SNCF"
},
"to" : {
"embedded_type" : "stop_point",
"stop_point" : {
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"equipments" : [],
"administrative_regions" : [{
"insee" : "17415",
"name" : "Saintes",
"level" : 8,
"coord" : {
"lat" : "45.742081",
"lon" : "-0.629932"
},
"label" : "Saintes (17100)",
"id" : "admin:fr:17415",
"zip_code" : "17100"
}
],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87491001",
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-491001-BV"
}
],
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87491001"
}
},
"quality" : 0,
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87491001",
"name" : "Saintes (Saintes)"
},
"base_arrival_date_time" : "20170626T204100",
"base_departure_date_time" : "20170626T170500",
"departure_date_time" : "20170626T170500",
"geojson" : {
"type" : "LineString",
"properties" : [{
"length" : 188393
}
],
"coordinates" : [[-1.541943, 47.217516], [-1.4357, 46.672027], [-1.167462, 46.463716], [-1.145317, 46.152696], [-0.963804, 45.94741], [-0.617591, 45.747836]]
},
"duration" : 12960,
"type" : "public_transport",
"id" : "section_1_0",
"stop_date_times" : [{
"stop_point" : {
"name" : "Nantes",
"links" : [],
"coord" : {
"lat" : "47.217516",
"lon" : "-1.541943"
},
"label" : "Nantes (Nantes)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87481002"
},
"links" : [],
"arrival_date_time" : "20170626T170500",
"additional_informations" : [],
"departure_date_time" : "20170626T170500",
"base_arrival_date_time" : "20170626T170500",
"base_departure_date_time" : "20170626T170500"
}, {
"stop_point" : {
"name" : "La Roche-sur-Yon",
"links" : [],
"coord" : {
"lat" : "46.672027",
"lon" : "-1.4357"
},
"label" : "La Roche-sur-Yon (La Roche-sur-Yon)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87486019"
},
"links" : [],
"arrival_date_time" : "20170626T174700",
"additional_informations" : [],
"departure_date_time" : "20170626T174900",
"base_arrival_date_time" : "20170626T174700",
"base_departure_date_time" : "20170626T174900"
}, {
"stop_point" : {
"name" : "Lu\u00e7on",
"links" : [],
"coord" : {
"lat" : "46.463716",
"lon" : "-1.167462"
},
"label" : "Lu\u00e7on (Lu\u00e7on)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87486258"
},
"links" : [],
"arrival_date_time" : "20170626T183200",
"additional_informations" : [],
"departure_date_time" : "20170626T183300",
"base_arrival_date_time" : "20170626T183200",
"base_departure_date_time" : "20170626T183300"
}, {
"stop_point" : {
"name" : "La Rochelle-Ville",
"links" : [],
"coord" : {
"lat" : "46.152696",
"lon" : "-1.145317"
},
"label" : "La Rochelle-Ville (La Rochelle)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87485003"
},
"links" : [],
"arrival_date_time" : "20170626T194600",
"additional_informations" : [],
"departure_date_time" : "20170626T195000",
"base_arrival_date_time" : "20170626T194600",
"base_departure_date_time" : "20170626T195000"
}, {
"stop_point" : {
"name" : "Rochefort",
"links" : [],
"coord" : {
"lat" : "45.94741",
"lon" : "-0.963804"
},
"label" : "Rochefort (Rochefort)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87485144"
},
"links" : [],
"arrival_date_time" : "20170626T200900",
"additional_informations" : [],
"departure_date_time" : "20170626T201100",
"base_arrival_date_time" : "20170626T200900",
"base_departure_date_time" : "20170626T201100"
}, {
"stop_point" : {
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87491001"
},
"links" : [],
"arrival_date_time" : "20170626T204100",
"additional_informations" : [],
"departure_date_time" : "20170626T204300",
"base_arrival_date_time" : "20170626T204100",
"base_departure_date_time" : "20170626T204300"
}
]
}, {
"from" : {
"embedded_type" : "stop_point",
"stop_point" : {
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"equipments" : [],
"administrative_regions" : [{
"insee" : "17415",
"name" : "Saintes",
"level" : 8,
"coord" : {
"lat" : "45.742081",
"lon" : "-0.629932"
},
"label" : "Saintes (17100)",
"id" : "admin:fr:17415",
"zip_code" : "17100"
}
],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87491001",
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-491001-BV"
}
],
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87491001"
}
},
"quality" : 0,
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87491001",
"name" : "Saintes (Saintes)"
},
"links" : [],
"arrival_date_time" : "20170626T204100",
"co2_emission" : {
"value" : 0.0,
"unit" : ""
},
"to" : {
"embedded_type" : "stop_point",
"stop_point" : {
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"equipments" : [],
"administrative_regions" : [{
"insee" : "17415",
"name" : "Saintes",
"level" : 8,
"coord" : {
"lat" : "45.742081",
"lon" : "-0.629932"
},
"label" : "Saintes (17100)",
"id" : "admin:fr:17415",
"zip_code" : "17100"
}
],
"id" : "stop_point:OCE:SP:TrainTER-87491001",
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-491001-BV"
}
],
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87491001"
}
},
"quality" : 0,
"id" : "stop_point:OCE:SP:TrainTER-87491001",
"name" : "Saintes (Saintes)"
},
"departure_date_time" : "20170626T204100",
"geojson" : {
"type" : "LineString",
"properties" : [{
"length" : 0
}
],
"coordinates" : [[-0.617591, 45.747836], [-0.617591, 45.747836]]
},
"duration" : 0,
"transfer_type" : "walking",
"type" : "transfer",
"id" : "section_2_0"
}, {
"links" : [],
"arrival_date_time" : "20170626T215800",
"co2_emission" : {
"value" : 0.0,
"unit" : ""
},
"departure_date_time" : "20170626T204100",
"duration" : 4620,
"type" : "waiting",
"id" : "section_3_0"
}, {
"from" : {
"embedded_type" : "stop_point",
"stop_point" : {
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"equipments" : [],
"administrative_regions" : [{
"insee" : "17415",
"name" : "Saintes",
"level" : 8,
"coord" : {
"lat" : "45.742081",
"lon" : "-0.629932"
},
"label" : "Saintes (17100)",
"id" : "admin:fr:17415",
"zip_code" : "17100"
}
],
"id" : "stop_point:OCE:SP:TrainTER-87491001",
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-491001-BV"
}
],
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87491001"
}
},
"quality" : 0,
"id" : "stop_point:OCE:SP:TrainTER-87491001",
"name" : "Saintes (Saintes)"
},
"links" : [{
"type" : "vehicle_journey",
"id" : "vehicle_journey:OCE:SN864588F01002"
}, {
"type" : "line",
"id" : "line:OCE:90"
}, {
"type" : "route",
"id" : "route:OCE:90-TrainTER-87583005-87491803"
}, {
"type" : "commercial_mode",
"id" : "commercial_mode:ter"
}, {
"type" : "physical_mode",
"id" : "physical_mode:LocalTrain"
}, {
"type" : "network",
"id" : "network:sncf"
}
],
"arrival_date_time" : "20170626T223100",
"additional_informations" : ["regular"],
"co2_emission" : {
"value" : 1046.4402,
"unit" : "gEC"
},
"display_informations" : {
"direction" : "Royan (Royan)",
"code" : "",
"description" : "",
"links" : [],
"color" : "000000",
"physical_mode" : "TER",
"headsign" : "864589",
"commercial_mode" : "TER",
"equipments" : [],
"label" : "Royan - Angoul\u00eame",
"text_color" : "",
"network" : "SNCF"
},
"to" : {
"embedded_type" : "stop_point",
"stop_point" : {
"name" : "Royan",
"links" : [],
"coord" : {
"lat" : "45.625509",
"lon" : "-1.017215"
},
"label" : "Royan (Royan)",
"equipments" : [],
"administrative_regions" : [{
"insee" : "17306",
"name" : "Royan",
"level" : 8,
"coord" : {
"lat" : "45.624535",
"lon" : "-1.028763"
},
"label" : "Royan (17200)",
"id" : "admin:fr:17306",
"zip_code" : "17200"
}
],
"id" : "stop_point:OCE:SP:TrainTER-87491803",
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-491803-00"
}
],
"name" : "Royan",
"links" : [],
"coord" : {
"lat" : "45.625509",
"lon" : "-1.017215"
},
"label" : "Royan (Royan)",
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87491803"
}
},
"quality" : 0,
"id" : "stop_point:OCE:SP:TrainTER-87491803",
"name" : "Royan (Royan)"
},
"base_arrival_date_time" : "20170626T223100",
"base_departure_date_time" : "20170626T215800",
"departure_date_time" : "20170626T215800",
"geojson" : {
"type" : "LineString",
"properties" : [{
"length" : 34086
}
],
"coordinates" : [[-0.617591, 45.747836], [-0.9306, 45.667041], [-1.017215, 45.625509]]
},
"duration" : 1980,
"type" : "public_transport",
"id" : "section_4_0",
"stop_date_times" : [{
"stop_point" : {
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"equipments" : [],
"id" : "stop_point:OCE:SP:TrainTER-87491001"
},
"links" : [],
"arrival_date_time" : "20170626T215000",
"additional_informations" : [],
"departure_date_time" : "20170626T215800",
"base_arrival_date_time" : "20170626T215000",
"base_departure_date_time" : "20170626T215800"
}, {
"stop_point" : {
"name" : "Saujon",
"links" : [],
"coord" : {
"lat" : "45.667041",
"lon" : "-0.9306"
},
"label" : "Saujon (Saujon)",
"equipments" : [],
"id" : "stop_point:OCE:SP:TrainTER-87491811"
},
"links" : [],
"arrival_date_time" : "20170626T222200",
"additional_informations" : [],
"departure_date_time" : "20170626T222300",
"base_arrival_date_time" : "20170626T222200",
"base_departure_date_time" : "20170626T222300"
}, {
"stop_point" : {
"name" : "Royan",
"links" : [],
"coord" : {
"lat" : "45.625509",
"lon" : "-1.017215"
},
"label" : "Royan (Royan)",
"equipments" : [],
"id" : "stop_point:OCE:SP:TrainTER-87491803"
},
"links" : [],
"arrival_date_time" : "20170626T223100",
"additional_informations" : [],
"departure_date_time" : "20170626T223100",
"base_arrival_date_time" : "20170626T223100",
"base_departure_date_time" : "20170626T223100"
}
]
}, {
"from" : {
"embedded_type" : "stop_point",
"stop_point" : {
"name" : "Royan",
"links" : [],
"coord" : {
"lat" : "45.625509",
"lon" : "-1.017215"
},
"label" : "Royan (Royan)",
"equipments" : [],
"administrative_regions" : [{
"insee" : "17306",
"name" : "Royan",
"level" : 8,
"coord" : {
"lat" : "45.624535",
"lon" : "-1.028763"
},
"label" : "Royan (17200)",
"id" : "admin:fr:17306",
"zip_code" : "17200"
}
],
"id" : "stop_point:OCE:SP:TrainTER-87491803",
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-491803-00"
}
],
"name" : "Royan",
"links" : [],
"coord" : {
"lat" : "45.625509",
"lon" : "-1.017215"
},
"label" : "Royan (Royan)",
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87491803"
}
},
"quality" : 0,
"id" : "stop_point:OCE:SP:TrainTER-87491803",
"name" : "Royan (Royan)"
},
"links" : [],
"arrival_date_time" : "20170626T223100",
"co2_emission" : {
"value" : 0.0,
"unit" : ""
},
"to" : {
"embedded_type" : "stop_area",
"quality" : 0,
"stop_area" : {
"codes" : [{
"type" : "CR-CI-CH",
"value" : "0087-491803-00"
}
],
"name" : "Royan",
"links" : [],
"coord" : {
"lat" : "45.625509",
"lon" : "-1.017215"
},
"label" : "Royan (Royan)",
"administrative_regions" : [{
"insee" : "17306",
"name" : "Royan",
"level" : 8,
"coord" : {
"lat" : "45.624535",
"lon" : "-1.028763"
},
"label" : "Royan (17200)",
"id" : "admin:fr:17306",
"zip_code" : "17200"
}
],
"timezone" : "Europe\/Paris",
"id" : "stop_area:OCE:SA:87491803"
},
"name" : "Royan (Royan)",
"id" : "stop_area:OCE:SA:87491803"
},
"departure_date_time" : "20170626T223100",
"duration" : 0,
"type" : "crow_fly",
"id" : "section_5_0",
"mode" : "walking"
}
],
"co2_emission" : {
"value" : 3288.3169,
"unit" : "gEC"
},
"duration" : 19560,
"type" : "best"
}
],
"disruptions" : [{
"disruption_id" : "f74aa9ef-1c02-493e-91e6-927ae93db16c",
"status" : "future",
"severity" : {
"color" : "#000000",
"priority" : 42,
"name" : "trip delayed",
"effect" : "SIGNIFICANT_DELAYS"
},
"impact_id" : "f74aa9ef-1c02-493e-91e6-927ae93db16c",
"application_periods" : [{
"begin" : "20170626T170500",
"end" : "20170626T220859"
}
],
"updated_at" : "20170626T132551",
"uri" : "f74aa9ef-1c02-493e-91e6-927ae93db16c",
"impacted_objects" : [{
"impacted_stops" : [{
"amended_arrival_time" : "170500",
"stop_point" : {
"name" : "Nantes",
"links" : [],
"coord" : {
"lat" : "47.217516",
"lon" : "-1.541943"
},
"label" : "Nantes (Nantes)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87481002"
},
"stop_time_effect" : "unchanged",
"departure_status" : "unchanged",
"amended_departure_time" : "170500",
"base_arrival_time" : "170500",
"cause" : "",
"base_departure_time" : "170500",
"arrival_status" : "unchanged"
}, {
"amended_arrival_time" : "174700",
"stop_point" : {
"name" : "La Roche-sur-Yon",
"links" : [],
"coord" : {
"lat" : "46.672027",
"lon" : "-1.4357"
},
"label" : "La Roche-sur-Yon (La Roche-sur-Yon)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87486019"
},
"stop_time_effect" : "unchanged",
"departure_status" : "unchanged",
"amended_departure_time" : "174900",
"base_arrival_time" : "174700",
"cause" : "",
"base_departure_time" : "174900",
"arrival_status" : "unchanged"
}, {
"amended_arrival_time" : "183200",
"stop_point" : {
"name" : "Lu\u00e7on",
"links" : [],
"coord" : {
"lat" : "46.463716",
"lon" : "-1.167462"
},
"label" : "Lu\u00e7on (Lu\u00e7on)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87486258"
},
"stop_time_effect" : "unchanged",
"departure_status" : "unchanged",
"amended_departure_time" : "183300",
"base_arrival_time" : "183200",
"cause" : "",
"base_departure_time" : "183300",
"arrival_status" : "unchanged"
}, {
"amended_arrival_time" : "194600",
"stop_point" : {
"name" : "La Rochelle-Ville",
"links" : [],
"coord" : {
"lat" : "46.152696",
"lon" : "-1.145317"
},
"label" : "La Rochelle-Ville (La Rochelle)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87485003"
},
"stop_time_effect" : "unchanged",
"departure_status" : "unchanged",
"amended_departure_time" : "195000",
"base_arrival_time" : "194600",
"cause" : "",
"base_departure_time" : "195000",
"arrival_status" : "unchanged"
}, {
"amended_arrival_time" : "200900",
"stop_point" : {
"name" : "Rochefort",
"links" : [],
"coord" : {
"lat" : "45.94741",
"lon" : "-0.963804"
},
"label" : "Rochefort (Rochefort)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87485144"
},
"stop_time_effect" : "unchanged",
"departure_status" : "unchanged",
"amended_departure_time" : "201100",
"base_arrival_time" : "200900",
"cause" : "",
"base_departure_time" : "201100",
"arrival_status" : "unchanged"
}, {
"amended_arrival_time" : "204100",
"stop_point" : {
"name" : "Saintes",
"links" : [],
"coord" : {
"lat" : "45.747836",
"lon" : "-0.617591"
},
"label" : "Saintes (Saintes)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87491001"
},
"stop_time_effect" : "unchanged",
"departure_status" : "unchanged",
"amended_departure_time" : "204300",
"base_arrival_time" : "204100",
"cause" : "",
"base_departure_time" : "204300",
"arrival_status" : "unchanged"
}, {
"amended_arrival_time" : "211100",
"stop_point" : {
"name" : "Jonzac",
"links" : [],
"coord" : {
"lat" : "45.438707",
"lon" : "-0.442018"
},
"label" : "Jonzac (Jonzac)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87491142"
},
"stop_time_effect" : "unchanged",
"departure_status" : "unchanged",
"amended_departure_time" : "211200",
"base_arrival_time" : "211100",
"cause" : "",
"base_departure_time" : "211200",
"arrival_status" : "unchanged"
}, {
"amended_arrival_time" : "220900",
"stop_point" : {
"name" : "Bordeaux-St-Jean",
"links" : [],
"coord" : {
"lat" : "44.826529",
"lon" : "-0.556211"
},
"label" : "Bordeaux-St-Jean (Bordeaux)",
"equipments" : [],
"id" : "stop_point:OCE:SP:CorailIntercit\u00e9-87581009"
},
"stop_time_effect" : "delayed",
"departure_status" : "delayed",
"amended_departure_time" : "220900",
"base_arrival_time" : "215900",
"cause" : "Travaux sur les voies",
"base_departure_time" : "215900",
"arrival_status" : "delayed"
}
],
"pt_object" : {
"embedded_type" : "trip",
"trip" : {
"id" : "OCE:SN003837F01001",
"name" : "3837"
},
"quality" : 0,
"id" : "OCE:SN003837F01001",
"name" : "OCE:SN003837F01001"
}
}
],
"id" : "f74aa9ef-1c02-493e-91e6-927ae93db16c",
"contributor" : "",
"cause" : "",
"disruption_uri" : "f74aa9ef-1c02-493e-91e6-927ae93db16c"
}
],
"notes" : [],
"feed_publishers" : [],
"context" : {
"car_direct_path" : {
"co2_emission" : {
"value" : 45105.6953633852,
"unit" : "gEC"
}
}
},
"exceptions" : []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment