Added scripts to generate data files.

This commit is contained in:
George Kaklamanos 2016-02-21 15:39:36 +02:00
parent a5002729fa
commit 49c232f56c
3 changed files with 25 additions and 0 deletions

14
GenBusposition.php Normal file
View file

@ -0,0 +1,14 @@
<?php
$positions = array();
foreach ($routes as $route){
print_r($route);
foreach (BusPosition($route['id'], 'go') as $p){
array_push($positions, $p);
}
foreach (BusPosition($route['id'], 'come') as $p){
array_push($positions, $p);
}
}
file_put_contents('data/buspositions.json', json_encode($positions, JSON_UNESCAPED_UNICODE));
?>

5
GenRoutes.php Normal file
View file

@ -0,0 +1,5 @@
<?php
include 'modules/libdata.php';
file_put_contents('data/routes.json', json_encode(Routes(), JSON_UNESCAPED_UNICODE));
?>

6
GenStops.php Normal file
View file

@ -0,0 +1,6 @@
<?php
include 'modules/libdata.php';
file_put_contents('data/stops.json', json_encode(GetStops(), JSON_UNESCAPED_UNICODE));
?>