Add and Remove operations for between stops
Add and Remove operations for between stops

--- /dev/null
+++ b/betweenpoint.add.php
@@ -1,1 +1,50 @@
+<?php
+  /*
+   * GeoPo Encode in PHP
+   * @author : Shintaro Inagaki
+   * @param $location (Array)
+   * @return $geopo (String)
+   */
+  function geopoEncode($lat, $lng)
+  {
+      // 64characters (number + big and small letter + hyphen + underscore)
+      $chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
+      
+      $geopo = "";
+      $scale = 7;
+      
+      // Change a degree measure to a decimal number
+      $lat = ($lat + 90) / 180 * pow(8, 10);
+      $lng = ($lng + 180) / 360 * pow(8, 10);
+      // Compute a GeoPo code from head and concatenate
+      for ($i = 0; $i < $scale; $i++) {
+          $geopo .= substr($chars, floor($lat / pow(8, 9 - $i) % 8) + floor($lng / pow(8, 9 - $i) % 8) * 8, 1);
+      }
+      return $geopo;
+  }
 
+  
+  $conn = pg_connect("dbname=bus user=postgres password=snmc");
+  if (!$conn) {
+      echo "An error occured.\n";
+      exit;
+  }
+  if ($_REQUEST['newlatlng']) {
+      $latlng = explode(";", $_REQUEST['newlatlng']);
+      $lat = (float)$latlng[0];
+      $lng = (float)$latlng[1];
+      
+      $geoPo = geopoEncode($lat, $lng);
+      $nodelat = (int)($lat * 10000000);
+      $nodelon = (int)($lng * 10000000);
+      echo($nodelat . "," . $nodelon . "=$geoPo<br>");
+      $sql = "INSERT INTO stops (geohash,lat,lng) VALUES ('$geoPo', '$nodelat', '$nodelon')";
+      $result = pg_query($conn, $sql);
+      if (!$result) {
+          echo("Error in SQL query: " . pg_last_error() . "<br>\n");
+      } else {
+      echo "Inserted new point at $geoPo <br>";
+	}
+  }
+  flush();
+?>

--- /dev/null
+++ b/betweenpoint.delete.php
@@ -1,1 +1,19 @@
-
+<?php
+  
+  $conn = pg_connect("dbname=bus user=postgres password=snmc");
+  if (!$conn) {
+      echo "An error occured.\n";
+      exit;
+  }
+  if ($_REQUEST['oldgeopo']) {
+    
+      $sql = " DELETE from stops WHERE geohash = '{$_REQUEST['oldgeopo']}'";
+      $result = pg_query($conn, $sql);
+      if (!$result) {
+          echo("Error in SQL query: " . pg_last_error() . "<br>\n");
+      } else {
+      echo "Deleted {$_REQUEST['oldgeopo']}<br>";
+      }
+  }
+  flush();
+?>

--- /dev/null
+++ b/betweenpoint.move.php
@@ -1,1 +1,92 @@
-
+<?php
+  /*
+   * GeoPo Encode in PHP
+   * @author : Shintaro Inagaki
+   * @param $location (Array)
+   * @return $geopo (String)
+   */
+  function geopoEncode($lat, $lng)
+  {
+      // 64characters (number + big and small letter + hyphen + underscore)
+      $chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
+      
+      $geopo = "";
+      $scale = 7;
+      
+      // Change a degree measure to a decimal number
+      $lat = ($lat + 90) / 180 * pow(8, 10);
+      $lng = ($lng + 180) / 360 * pow(8, 10);
+      // Compute a GeoPo code from head and concatenate
+      for ($i = 0; $i < $scale; $i++) {
+          $geopo .= substr($chars, floor($lat / pow(8, 9 - $i) % 8) + floor($lng / pow(8, 9 - $i) % 8) * 8, 1);
+      }
+      return $geopo;
+  }
+  
+  /*
+   * GeoPo Decode in PHP
+   * @author : Shintaro Inagaki
+   * @param $geopo (String)
+   * @return $location (Array)
+   */
+  function geopoDecode($geopo)
+  {
+      // 64characters (number + big and small letter + hyphen + underscore)
+      $chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ-_";
+      // Array for geolocation
+      $location = array();
+      
+      for ($i = 0; $i < strlen($geopo); $i++) {
+          // What number of character that equal to a GeoPo code (0-63)
+          $order = strpos($chars, substr($geopo, $i, 1));
+          // Lat/Lng plus geolocation value of scale 
+          $location['lat'] = $location['lat'] + floor($order % 8) * pow(8, 9 - $i);
+          $location['lng'] = $location['lng'] + floor($order / 8) * pow(8, 9 - $i);
+      }
+      
+      // Change a decimal number to a degree measure, and plus revised value that shift center of area
+      $location['lat'] = $location['lat'] * 180 / pow(8, 10) + 180 / pow(8, strlen($geopo)) / 2 - 90;
+      $location['lng'] = $location['lng'] * 360 / pow(8, 10) + 360 / pow(8, strlen($geopo)) / 2 - 180;
+      $location['scale'] = strlen($geopo);
+      
+      return $location;
+  }
+  
+  $conn = pg_connect("dbname=bus user=postgres password=snmc");
+  if (!$conn) {
+      echo "An error occured.\n";
+      exit;
+  }
+  if ($_REQUEST['newlatlng']) {
+      $latlng = explode(";", $_REQUEST['newlatlng']);
+      $lat = (float)$latlng[0];
+      $lng = (float)$latlng[1];
+      
+      $geoPo = geopoEncode($lat, $lng);
+      $nodelat = (int)($lat * 10000000);
+      $nodelon = (int)($lng * 10000000);
+      echo($nodelat . "," . $nodelon . "=$geoPo<br>");
+      $sql = "UPDATE stops SET geohash='$geoPo', lat='$nodelat', lng='$nodelon', name=null, suburb=null WHERE geohash = '{$_REQUEST['oldgeopo']}'";
+      $result = pg_query($conn, $sql);
+      if (!$result) {
+          echo("Error in SQL query: " . pg_last_error() . "<br>\n");
+      } else if (pg_affected_rows($result) == 0) {
+	echo ("Error 0 points moved, please refresh page and try again");
+      } else {
+      echo $_REQUEST['oldgeopo'] . " replaced with $geoPo <br>";
+      $updatedroutes = 0;
+      $result_outdatedroutes = pg_query($conn, "Select * FROM between_stops where points LIKE '%" . $_REQUEST['oldgeopo'] . ";%'");
+      while ($outdatedroute = pg_fetch_assoc($result_outdatedroutes)) {
+          $newpoints = str_replace($_REQUEST['oldgeopo'], $geoPo, $outdatedroute['points']);
+          $sql = "UPDATE  between_stops set points='$newpoints' where fromlocation = '{$outdatedroute['fromlocation']}' AND tolocation = '{$outdatedroute['tolocation']}' ";
+          $result = pg_query($conn, $sql);
+          if (!$result) {
+              echo("Error in SQL query: " . pg_last_error() . "<br>\n");
+          }
+          $updatedroutes++;
+      }
+      echo "updated $updatedroutes routes<br>";
+      }
+  }
+  flush();
+?>

--- a/betweenpoint.php
+++ b/betweenpoint.php
@@ -10,11 +10,46 @@
     // create the ol map object
     var map = new OpenLayers.Map('map');
     
-  var osmtiles = new OpenLayers.Layer.OSM("local", "http://127.0.0.1/tiles/${z}/${x}/${y}.png")
+  var osmtiles = new OpenLayers.Layer.OSM("local", "http://10.0.1.154/tiles/${z}/${x}/${y}.png")
 // use http://open.atlas.free.fr/GMapsTransparenciesImgOver.php and http://code.google.com/p/googletilecutter/ to make tiles
     markers = new OpenLayers.Layer.Markers("Between Stop Markers");
  
-
+ //hanlde mousedown on regions that are not points by reporting latlng
+OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {                
+                defaultHandlerOptions: {
+                    'single': true,
+                    'double': false,
+                    'pixelTolerance': 0,
+                    'stopSingle': false,
+                    'stopDouble': false
+                },
+ 
+                initialize: function(options) {
+                    this.handlerOptions = OpenLayers.Util.extend(
+                        {}, this.defaultHandlerOptions
+                    );
+                    OpenLayers.Control.prototype.initialize.apply(
+                        this, arguments
+                    ); 
+                    this.handler = new OpenLayers.Handler.Click(
+                        this, {
+                            'click': this.trigger
+                        }, this.handlerOptions
+                    );
+                }, 
+ 
+                trigger: function(e) {
+                    var lonlat = map.getLonLatFromViewPortPx(e.xy).transform(
+            new OpenLayers.Projection("EPSG:900913"),
+	    new OpenLayers.Projection("EPSG:4326")
+            );
+                    $('form input[name="newlatlng"]').val(lonlat.lat + ";" + lonlat.lon );
+                }
+ 
+            });
+          var click = new OpenLayers.Control.Click();
+                map.addControl(click);
+                click.activate();
 <?php
   $conn = pg_connect("dbname=bus user=postgres password=snmc");
   if (!$conn) {
@@ -34,7 +69,9 @@
             marker.id="' . $stop['geohash'] . '";
             markers.addMarker(marker);
 marker.events.register("mousedown", marker, function() {
+
 document.getElementById("between_points").innerHTML += this.id+";";
+$(\'form input[name="oldgeopo"]\').val(this.id);
 });
 ';
   }
@@ -55,7 +92,27 @@
 	return false;
       });
 };
-
+function submitMove () {
+        $.post("betweenpoint.move.php", $("#moveform").serialize(), function(html){
+        $("#response").html(html);
+	clearForms();
+	return false;
+      });
+};
+function submitDelete () {
+        $.post("betweenpoint.delete.php", $("#moveform").serialize(), function(html){
+        $("#response").html(html);
+	clearForms();
+	return false;
+      });
+};
+function submitAdd () {
+        $.post("betweenpoint.add.php", $("#moveform").serialize(), function(html){
+        $("#response").html(html);
+	clearForms();
+	return false;
+      });
+};
 function OnChange(dropdown)
 {
     var myindex  = dropdown.selectedIndex
@@ -178,6 +235,13 @@
 <br>
 <textarea name="between_points" id="between_points" rows="1" cols="120"></textarea>
 </form>
+    <form id="moveform">
+oldgeopo <input type="text" name="oldgeopo" id="oldgeopo"/>
+newlatlng <input type="text" name="newlatlng" id="newlatlng" size="60"/>
+ <input type="button" onclick="javascript:submitMove()" value="Move!">
+ <input type="button" onclick="javascript:submitAdd()" value="Add!">
+   <input type="button" onclick="javascript:submitDelete()" value="Delete!">
+</form> 
 <div id="response">
     <!-- Our message will be echoed out here -->
   </div>

--- a/betweenpoint.submit.php
+++ b/betweenpoint.submit.php
@@ -6,8 +6,8 @@
 }

 print_r($_REQUEST);

 $reverse=$_REQUEST["reverse"];

-$from=$_REQUEST["from"];

-$to=$_REQUEST["to"];

+$from=pg_escape_string($_REQUEST["from"]);

+$to=pg_escape_string($_REQUEST["to"]);

 $routes=$_REQUEST["routes"] ;

 $points=$_REQUEST["between_points"];

    $sql = "INSERT INTO between_stops (fromLocation, toLocation, points, routes) VALUES('$from','$to','$points','$routes')";


--- a/busui/common.inc.php
+++ b/busui/common.inc.php
@@ -19,6 +19,9 @@
 }
 
 function include_header($pageTitle, $opendiv = true, $geolocate = false) {
+ // this starts the session 
+ session_start(); 
+ 
     // if (isDebug()) // set php error level high
     echo '
 <!DOCTYPE html> 

--- a/busui/index.php
+++ b/busui/index.php
@@ -7,7 +7,7 @@
  session_destroy();
  if (isset($_REQUEST['service_period'])) $_SESSION['service_period'] = $_REQUEST['service_period'];
  if (isset($_REQUEST['time'])) $_SESSION['time'] = $_REQUEST['time'];
- 
+ // todo take in cellids and crossreference with http://realtimeblog.free.fr/latest/cellular/processed/sqlite/505_sqlite_zones.zip to estimate location
 include_header("bus.lambdacomplex.org",false, true)
 ?>
 <div data-role="page" data-theme="b" id="jqm-home" class="ui-page ui-body-b ui-page-active">

--- a/display.php
+++ b/display.php
@@ -18,7 +18,7 @@
 		// create the ol map object
 		var map = new OpenLayers.Map('map', options);
     
-var osmtiles = new OpenLayers.Layer.OSM("local", "http://10.0.1.153/tiles/${z}/${x}/${y}.png");
+var osmtiles = new OpenLayers.Layer.OSM("local", "http://10.0.1.154/tiles/${z}/${x}/${y}.png");
 // use http://open.atlas.free.fr/GMapsTransparenciesImgOver.php and http://code.google.com/p/googletilecutter/ to make tiles
  var graphic = new OpenLayers.Layer.Image(
                 'Weekday Bus Map',

--- a/maxious-canberra-transit-feed/04-locatebetweenpoints.osm.xml.php
+++ b/maxious-canberra-transit-feed/04-locatebetweenpoints.osm.xml.php
@@ -2,7 +2,7 @@
 header('Content-Type: application/xml');

 echo "<?xml version='1.0' encoding='UTF-8'?>

 <osm version='0.6' generator='xapi: OSM Extended API 2.0' xmlns:xapi='http://www.informationfreeway.org/xapi/0.6' 

-xapi:uri='/api/0.6/*[bbox=148.98,-35.48,149.25,-35.15]' xapi:planetDate='20100630' xapi:copyright='2010 OpenStreetMap contributors' 

+xapi:uri='/api/0.6/*[bbox=148.98,-35.48,149.21,-35.15]' xapi:planetDate='20100630' xapi:copyright='2010 OpenStreetMap contributors' 

 xapi:license='Creative commons CC-BY-SA 2.0' xapi:bugs='For assistance or to report bugs contact 80n80n@gmail.com' xapi:instance='zappyHyper'>

 ";

 $conn = pg_connect("dbname=openstreetmap user=postgres password=snmc");


--- a/maxious-canberra-transit-feed/04-locatebetweenpoints.reversegeocode.php
+++ b/maxious-canberra-transit-feed/04-locatebetweenpoints.reversegeocode.php
@@ -15,20 +15,40 @@
   echo "An error occured.\n";
   exit;
 }
-$sql = "Select * from stops where name is null";
+$sql = "Select * from stops where name is null or suburb is null";
      $result_stops = pg_query($conn, $sql);
      if (!$result_stops) {
-	cho("Error in SQL query: " . pg_last_error() ."<br>\n");
+	echo("Error in SQL query: " . pg_last_error() ."<br>\n");
      }
      while ($stop = pg_fetch_assoc($result_stops)) {
-      echo "Processing ".$stop['geohash'] . " ... ";
+	if ($stop['name'] == "") {
+      echo "Processing ".$stop['geohash'] . " streetname ... ";
       $url = "http://geocoding.cloudmade.com/daa03470bb8740298d4b10e3f03d63e6/geocoding/v2/find.js?around=".($stop['lat']/10000000).",".($stop['lng']/10000000)."&distance=closest&object_type=road";
       $contents = json_decode(getPage($url));
+      //print_r($contents);
       $name = $contents->features[0]->properties->name;
       echo "Saving $name ! <br>" ;
       $result_save = pg_query($conn, "UPDATE stops set name = '".pg_escape_string($name)."' where geohash = '{$stop['geohash']}' ");
 			      if (!$result_save) {
 	echo("Error in SQL query: " . pg_last_error() ."<br>\n");
+			      }
+	}
+	if ($stop['suburb'] == "") {
+      echo "Processing ".$stop['geohash'] . " suburb ... ";
+	$sql = "select * from suburbs where the_geom @> 'POINT(".($stop['lng']/10000000)." ".($stop['lat']/10000000).")'::geometry";
+     $result_suburbs = pg_query($conn, $sql);
+     if (!$result_suburbs) {
+	echo("Error in SQL query: " . pg_last_error() ."<br>\n");
+     }
+     $suburbs = "";
+     while ($suburb = pg_fetch_assoc($result_suburbs)) {
+	$suburbs .= $suburb['name_2006'].";";
+     }
+      echo "Saving $suburbs ! <br>" ;
+      $result_save = pg_query($conn, "UPDATE stops set suburb = '".pg_escape_string($suburbs)."' where geohash = '{$stop['geohash']}' ");
+			      if (!$result_save) {
+	echo("Error in SQL query: " . pg_last_error() ."<br>\n");
+			      }
      }
      flush();
      }

--- a/maxious-canberra-transit-feed/cbrtable.yml
+++ b/maxious-canberra-transit-feed/cbrtable.yml
@@ -1682,7 +1682,36 @@
   - { name: Parkinson Street,stop_code: WjrX-0-, lat: -35.3424839, lng: 149.052828}
   - { name: Backler Place,stop_code: WjrXZv5, lat: -35.3432647, lng: 149.0558034}
   - { name: Gilmore Crescent,stop_code: Wjz3BfO, lat: -35.3434784, lng: 149.1088951}
+  - { name: Edinburgh Avenue,stop_code: Wjz5EKJ, lat: -35.28346, lng: 149.1252}
 routes:
+  -  
+    time_points: [Gungahlin Marketplace, Flemington Rd / Sandford St, Northbourne Avenue / Antill St, Macarthur / Northbourne Ave, City Bus Station (Platform 9), Russell Offices, Kings Ave / National Circuit, Railway Station Kingston, Fyshwick Direct Factory Outlet]
+    long_name: To Fyshwick DirectFactory Outlet
+    between_stops: 
+      Russell Offices-Kings Ave / National Circuit: [Wjz4RFJ, Wjz4RwH, Wjz4Quk]
+      Northbourne Avenue / Antill St-Macarthur / Northbourne Ave: [Wjz5SDc, Wjz5Sux, Wjz5SrO, Wjz5Sqk, Wjz5RvC, Wjz5Rsi, Wjz5RkN]
+      Macarthur / Northbourne Ave-City Bus Station (Platform 9): [Wjz5QmR, Wjz5Qmu, Wjz5Qgn, Wjz5Qi2, Wjz5Pl0, Wjz5PdJ, Wjz5P8K, Wjz5P8n, Wjz5Oci, Wjz5O3Q]
+      City Bus Station (Platform 9)-Russell Offices: [Wjz5Nht, Wjz5MsD, Wjz5MsT, Wjz5MEL, Wjz4T-X, Wjz4_jm, Wjz4_wS, Wjz4-KO, Wjz4-Rc, Wjz4-WL, Wjz4-WZ]
+    short_name: "200"
+    stop_times: [[701a, 709a, 715a, 718a, 723a, 732a, 736a, 742a, 749a], [716a, 724a, 731a, 737a, 747a, 757a, 801a, 807a, 814a], [731a, 740a, 749a, 755a, 805a, 815a, 819a, 825a, 832a], [746a, 755a, 804a, 810a, 820a, 830a, 834a, 840a, 847a], [801a, 810a, 819a, 825a, 835a, 845a, 849a, 855a, 902a], [816a, 825a, 834a, 840a, 850a, 900a, 904a, 910a, 917a], [831a, 840a, 849a, 855a, 902a, 910a, 914a, 920a, 927a], [846a, 855a, 902a, 905a, 910a, 918a, 922a, 928a, 935a], [901a, 909a, 915a, 918a, 923a, 931a, 935a, 941a, 948a], [916a, 924a, 930a, 933a, 938a, 946a, 950a, 956a, 1003a], [931a, 939a, 945a, 948a, 953a, 1001a, 1005a, 1011a, 1018a], [946a, 954a, 1000a, 1003a, 1008a, 1016a, 1020a, 1026a, 1033a], [1001a, 1009a, 1015a, 1018a, 1023a, 1031a, 1035a, 1041a, 1048a], [1016a, 1024a, 1030a, 1033a, 1038a, 1046a, 1050a, 1056a, 1103a], [1031a, 1039a, 1045a, 1048a, 1053a, 1101a, 1105a, 1111a, 1118a], [1046a, 1054a, 1100a, 1103a, 1108a, 1116a, 1120a, 1126a, 1133a], [1101a, 1109a, 1115a, 1118a, 1123a, 1131a, 1135a, 1141a, 1148a], [1116a, 1124a, 1130a, 1133a, 1138a, 1146a, 1150a, 1156a, 1203p], [1131a, 1139a, 1145a, 1148a, 1153a, 1201p, 1205p, 1211p, 1218p], [1146a, 1154a, 1200p, 1203p, 1208p, 1216p, 1220p, 1226p, 1233p], [1201p, 1209p, 1215p, 1218p, 1223p, 1231p, 1235p, 1241p, 1248p], [1216p, 1224p, 1230p, 1233p, 1238p, 1246p, 1250p, 1256p, 103p], [1233p, 1241p, 1247p, 1250p, 1255p, 103p, 107p, 113p, 120p], [1246p, 1254p, 100p, 103p, 108p, 116p, 120p, 126p, 133p], [101p, 109p, 115p, 118p, 123p, 131p, 135p, 141p, 148p], [116p, 124p, 130p, 133p, 138p, 146p, 150p, 156p, 203p], [131p, 139p, 145p, 148p, 153p, 201p, 205p, 211p, 218p], [146p, 154p, 200p, 203p, 208p, 216p, 220p, 226p, 233p], [201p, 209p, 215p, 218p, 223p, 231p, 235p, 241p, 248p], [216p, 224p, 230p, 233p, 238p, 246p, 250p, 256p, 303p], [231p, 239p, 245p, 248p, 253p, 301p, 305p, 311p, 318p], [246p, 254p, 300p, 303p, 308p, 316p, 320p, 326p, 333p], [301p, 309p, 315p, 318p, 323p, 331p, 335p, 341p, 348p], [316p, 324p, 330p, 333p, 338p, 346p, 350p, 356p, 404p], [331p, 339p, 345p, 348p, 353p, 402p, 407p, 415p, 424p], [346p, 354p, 400p, 403p, 412p, 422p, 427p, 435p, 444p], [401p, 410p, 417p, 420p, 429p, 439p, 444p, 452p, 501p], [416p, 425p, 432p, 435p, 444p, 454p, 459p, 507p, 516p], [431p, 440p, 447p, 450p, 459p, 509p, 514p, 522p, 531p], [446p, 455p, 502p, 505p, 514p, 524p, 529p, 537p, 546p], [501p, 510p, 517p, 520p, 529p, 539p, 544p, 552p, 600p], [516p, 525p, 532p, 535p, 544p, 554p, 559p, 605p, 612p], [531p, 540p, 547p, 550p, 559p, 607p, 611p, 617p, 624p], [546p, 555p, 601p, 604p, 609p, 617p, 621p, 627p, 634p], [601p, 609p, 615p, 618p, 623p, 631p, 635p, 641p, 648p], [616p, 624p, 630p, 633p, 638p, 646p, 650p, 656p, 703p], [631p, 639p, 645p, 648p, 653p, 701p, 705p, 711p, 718p], [646p, 654p, 700p, 703p, 708p, 716p, 720p, 726p, 733p]]
+  -  
+    time_points: [Cohen Street Bus Station (Platform 1), Westfield Bus Station (Platform 1), Belconnen Community Bus Station (Platform 2), Chuculba / William Slim Dr, Mirrabei Drive / Dam Wall, Paul Coe / Mirrabei Dr, Katherine Ave / Horse Park Drive, Gungahlin Marketplace, Hibberson / Kate Crace, Flemington Rd / Sandford St, Northbourne Avenue / Antill St]
+    long_name: To Northbourne Avenue / Antill St
+    between_stops: 
+      Belconnen Community Bus Station (Platform 2)-Chuculba / William Slim Dr: [Wjz69gA, Wjz69ht, Wjz69uI, Wjz69vO, Wjz6mip]
+      Cohen Street Bus Station (Platform 1)-Westfield Bus Station (Platform 1): []
+      Westfield Bus Station (Platform 1)-Belconnen Community Bus Station (Platform 2): []
+    short_name: "59"
+    stop_times: [["-", "-", "-", "-", 537a, 541a, 547a, 603a, 606a, "-", "-"], ["-", "-", "-", "-", 612a, 616a, 622a, 638a, 641a, "-", "-"], ["-", "-", "-", "-", 646a, 650a, 656a, 711a, 714a, 717a, 724a], ["-", "-", "-", "-", 702a, 706a, 712a, 727a, 730a, 733a, 740a], ["-", "-", "-", "-", 712a, 716a, 722a, 737a, 740a, 743a, 753a], ["-", "-", "-", "-", 733a, 737a, 743a, 758a, 801a, 806a, 817a], ["-", "-", "-", "-", 809a, 813a, 819a, 834a, 837a, 842a, 853a], ["-", "-", "-", "-", 820a, 824a, 830a, 845a, 848a, 853a, 903a], ["-", "-", "-", "-", 849a, 853a, 859a, 914a, 917a, 920a, 927a], [900a, 902a, 906a, 923a, "-", 933a, 939a, 955a, 958a, "-", "-"], [1000a, 1002a, 1006a, 1023a, "-", 1033a, 1039a, 1055a, 1058a, "-", "-"], [1100a, 1102a, 1106a, 1123a, "-", 1133a, 1139a, 1155a, 1158a, "-", "-"], [1200p, 1202p, 1206p, 1223p, "-", 1233p, 1239p, 1255p, 1258p, "-", "-"], [100p, 102p, 106p, 123p, "-", 133p, 139p, 155p, 158p, "-", "-"], [200p, 202p, 206p, 223p, "-", 233p, 239p, 255p, 258p, "-", "-"], [240p, 242p, 246p, 303p, "-", 313p, 319p, 335p, 338p, "-", "-"], [318p, 320p, 324p, 342p, "-", 352p, 358p, 414p, 417p, "-", "-"], [333p, 335p, 339p, 357p, "-", 407p, 413p, 429p, 432p, "-", "-"], [348p, 350p, 354p, 412p, "-", 422p, 428p, 444p, 447p, "-", "-"], [403p, 405p, 409p, 427p, "-", 437p, 443p, 459p, 502p, "-", "-"], [418p, 420p, 424p, 442p, "-", 452p, 458p, 514p, 517p, "-", "-"], [433p, 435p, 439p, 457p, "-", 507p, 513p, 529p, 532p, "-", "-"], [448p, 450p, 454p, 512p, "-", 522p, 528p, 544p, 547p, "-", "-"], [503p, 505p, 509p, 527p, "-", 537p, 543p, 559p, 602p, "-", "-"], [518p, 520p, 524p, 542p, "-", 552p, 558p, 614p, 617p, "-", "-"], [530p, 532p, 536p, 554p, "-", 604p, 610p, 626p, 629p, "-", "-"], [548p, 550p, 554p, 611p, "-", 620p, 626p, 642p, 645p, "-", "-"], [603p, 605p, 609p, 626p, "-", 635p, 641p, 657p, 700p, "-", "-"], [703p, 705p, 709p, 726p, "-", 735p, 741p, 757p, 800p, "-", "-"], [803p, 805p, 809p, 826p, "-", 835p, 841p, 857p, 900p, "-", "-"], [903p, 905p, 909p, 926p, "-", 935p, 941p, 957p, 1000p, "-", "-"], [1003p, 1005p, 1009p, 1026p, "-", 1035p, 1041p, 1057p, 1100p, "-", "-"], [1103p, 1105p, 1109p, 1126p, "-", 1135p, 1141p, 1157p, 1200a, "-", "-"]]
+  -  
+    time_points: [Cohen Street Bus Station (Platform 1), Westfield Bus Station (Platform 1), Belconnen Community Bus Station (Platform 2), Chuculba / William Slim Dr, Federation Square, Nicholls Primary, Ngunnawal Primary, Gungahlin Marketplace]
+    long_name: To Gungahlin Marketplace
+    between_stops: 
+      Belconnen Community Bus Station (Platform 2)-Chuculba / William Slim Dr: [Wjz69gA, Wjz69ht, Wjz69uI, Wjz69vO, Wjz6mip]
+      Cohen Street Bus Station (Platform 1)-Westfield Bus Station (Platform 1): []
+      Westfield Bus Station (Platform 1)-Belconnen Community Bus Station (Platform 2): []
+    short_name: "951"
+    stop_times_sunday: [[920a, 922a, 926a, 934a, 939a, 944a, 954a, 1004a], [1020a, 1022a, 1026a, 1034a, 1039a, 1044a, 1054a, 1104a], [1120a, 1122a, 1126a, 1134a, 1139a, 1144a, 1154a, 1204p], [1220p, 1222p, 1226p, 1234p, 1239p, 1244p, 1254p, 104p], [120p, 122p, 126p, 134p, 139p, 144p, 154p, 204p], [220p, 222p, 226p, 234p, 239p, 244p, 254p, 304p], [320p, 322p, 326p, 334p, 339p, 344p, 354p, 404p], [420p, 422p, 426p, 434p, 439p, 444p, 454p, 504p], [520p, 522p, 526p, 534p, 539p, 544p, 554p, 604p], [620p, 622p, 626p, 634p, 639p, 644p, 654p, 704p]]
   -  
     time_points: [Belconnen Community Bus Station (Platform 5), Westfield Bus Station (Platform 2), Cohen Street Bus Station (Platform 5), Kippax, Macgregor, Charnwood, Macgregor, Kippax, Cohen Street Bus Station, Westfield Bus Station, Belconnen Community Bus Station]
     long_name: To Belconnen Community Bus Station
@@ -1694,15 +1723,6 @@
     short_name: "43"
     stop_times: [["-", "-", "-", "-", 621a, 629a, 638a, 643a, 648a, 650a, 654a], ["-", "-", "-", "-", 640a, 648a, 657a, 702a, 707a, 709a, 713a], [644a, 646a, 650a, 655a, 700a, 708a, 717a, 722a, 727a, 729a, 733a], ["-", "-", "-", "-", 720a, 728a, 739a, 744a, 752a, 754a, 758a], ["-", "-", "-", "-", 741a, 749a, 800a, 805a, 813a, 815a, 819a], ["-", "-", "-", "-", 802a, 810a, 821a, 826a, 834a, 836a, 840a], ["-", "-", "-", "-", 824a, 832a, 843a, 848a, 856a, 858a, 902a], [823a, 825a, 829a, 837a, 842a, 850a, 901a, 906a, 914a, 916a, 920a], [843a, 845a, 849a, 857a, 902a, 910a, 921a, 926a, 933a, 935a, 939a], [903a, 905a, 909a, 917a, 922a, 930a, 939a, 944a, 952a, 954a, 958a], [1003a, 1005a, 1009a, 1015a, 1020a, 1028a, 1037a, 1042a, 1048a, 1050a, 1054a], [1103a, 1105a, 1109a, 1115a, 1120a, 1128a, 1137a, 1142a, 1148a, 1150a, 1154a], [1203p, 1205p, 1209p, 1215p, 1220p, 1228p, 1237p, 1242p, 1248p, 1250p, 1254p], [103p, 105p, 109p, 115p, 120p, 128p, 137p, 142p, 148p, 150p, 154p], [203p, 205p, 209p, 215p, 220p, 228p, 237p, 242p, 248p, 250p, 254p], [254p, 256p, 300p, 308p, 313p, 321p, 332p, 337p, 345p, 347p, 351p], [323p, 325p, 329p, 337p, 342p, 350p, 401p, 406p, 414p, 416p, 420p], [343p, 345p, 349p, 357p, 402p, 410p, 421p, 426p, 434p, 436p, 440p], [403p, 405p, 409p, 417p, 422p, 430p, 441p, 446p, 454p, 456p, 500p], [423p, 425p, 429p, 437p, 442p, 450p, 501p, 506p, 514p, 516p, 520p], [443p, 445p, 449p, 457p, 502p, 510p, 521p, 526p, 534p, 536p, 540p], [503p, 505p, 509p, 517p, 522p, 530p, 541p, 546p, 554p, 556p, 600p], [523p, 525p, 529p, 537p, 542p, 550p, 601p, 606p, 614p, 616p, 620p], [602p, 604p, 608p, 616p, 621p, 629p, 638p, 643p, 648p, 650p, 654p], [702p, 704p, 708p, 713p, 718p, 726p, 735p, 740p, 745p, 747p, 751p], [802p, 804p, 808p, 813p, 818p, 826p, 835p, 840p, 845p, 847p, 851p], [902p, 904p, 908p, 913p, 918p, 926p, 935p, 940p, 945p, 947p, 951p], [1002p, 1004p, 1008p, 1013p, 1018p, 1026p, 1035p, 1040p, 1045p, 1047p, 1051p], [1102p, 1104p, 1108p, 1113p, 1118p, 1126p, 1135p, "-", "-", "-", "-"], []]
   -  
-    time_points: [Cohen Street Bus Station (Platform 1), Westfield Bus Station (Platform 1), Belconnen Community Bus Station (Platform 2), Chuculba / William Slim Dr, Federation Square, Nicholls Primary, Ngunnawal Primary, Gungahlin Marketplace]
-    long_name: To Gungahlin Marketplace
-    between_stops: 
-      Belconnen Community Bus Station (Platform 2)-Chuculba / William Slim Dr: [Wjz69gA, Wjz69ht, Wjz69uI, Wjz69vO, Wjz6mip]
-      Cohen Street Bus Station (Platform 1)-Westfield Bus Station (Platform 1): []
-      Westfield Bus Station (Platform 1)-Belconnen Community Bus Station (Platform 2): []
-    short_name: "951"
-    stop_times_sunday: [[920a, 922a, 926a, 934a, 939a, 944a, 954a, 1004a], [1020a, 1022a, 1026a, 1034a, 1039a, 1044a, 1054a, 1104a], [1120a, 1122a, 1126a, 1134a, 1139a, 1144a, 1154a, 1204p], [1220p, 1222p, 1226p, 1234p, 1239p, 1244p, 1254p, 104p], [120p, 122p, 126p, 134p, 139p, 144p, 154p, 204p], [220p, 222p, 226p, 234p, 239p, 244p, 254p, 304p], [320p, 322p, 326p, 334p, 339p, 344p, 354p, 404p], [420p, 422p, 426p, 434p, 439p, 444p, 454p, 504p], [520p, 522p, 526p, 534p, 539p, 544p, 554p, 604p], [620p, 622p, 626p, 634p, 639p, 644p, 654p, 704p]]
-  -  
     time_points: [City Bus Station (Platform 8), Macarthur / Northbourne Ave, Flemington Rd / Sandford St, Flemington Rd / Nullabor Ave, Anthony Rolfe Av / Moonlight Av, Gungahlin Marketplace, Shoalhaven / Katherine Ave, Ngunnawal Primary, Chuculba / William Slim Dr, Belconnen Community Bus Station, Westfield Bus Station, Cohen Street Bus Station]
     long_name: To Cohen Street Bus Station
     between_stops: 
@@ -1720,13 +1740,12 @@
     short_name: "786"
     stop_times: [[646a, 656a, 716a, 726a], [706a, 716a, 736a, 746a], [727a, 737a, 804a, 814a]]
   -  
-    time_points: [City Bus Station (Platform 8), Macarthur / Northbourne Ave, Northbourne Avenue / Antill St, Flemington Rd / Sandford St, Hoskins Street / Oodgeroo Ave, Manning Clarke / Oodgeroo, Gungahlin Marketplace]
-    long_name: To Gungahlin Marketplace
-    between_stops: 
-      Macarthur / Northbourne Ave-Northbourne Avenue / Antill St: [Wjz5RkN, Wjz5Rsi, Wjz5RvC, Wjz5Sqk, Wjz5SrO, Wjz5Sux, Wjz5SDc]
-      City Bus Station (Platform 8)-Macarthur / Northbourne Ave: [Wjz5O3Q, Wjz5Oci, Wjz5P8n, Wjz5P8K, Wjz5PdJ, Wjz5Pl0, Wjz5Qi2, Wjz5Qgn, Wjz5Qmu, Wjz5QmR]
-    short_name: "57"
-    stop_times: [[655a, 701a, 703a, 709a, 717a, 720a, 724a], [725a, 731a, 733a, 739a, 747a, 750a, 754a], [755a, 802a, 804a, 810a, 818a, 821a, 825a], [825a, 832a, 834a, 840a, 848a, 851a, 855a], [855a, 902a, 904a, 910a, 918a, 921a, 925a], [957a, 1003a, 1005a, 1011a, 1019a, 1022a, 1026a], [1055a, 1101a, 1103a, 1109a, 1117a, 1120a, 1124a], [1155a, 1201p, 1203p, 1209p, 1217p, 1220p, 1224p], [1255p, 101p, 103p, 109p, 117p, 120p, 124p], [155p, 201p, 203p, 209p, 217p, 220p, 224p], [255p, 301p, 303p, 310p, 318p, 321p, 325p], [355p, 402p, 404p, 411p, 419p, 422p, 426p], [425p, 432p, 434p, 441p, 449p, 452p, 456p], [455p, 502p, 504p, 511p, 519p, 522p, 526p], [525p, 532p, 534p, 541p, 549p, 552p, 556p], [555p, 602p, 604p, 609p, 617p, 620p, 624p], [625p, 631p, 633p, 638p, 646p, 649p, 653p], [655p, 701p, 703p, 708p, 716p, 719p, 723p]]
+    time_points: [Woden Bus Station (Platform 14), Canberra Hospital, Red Hill, Manuka, Kings Ave / National Circuit, City Bus Station (Platform 4), Lyneham / Wattle St, North Lyneham, Dickson / Antill St]
+    long_name: To Dickson
+    between_stops: 
+      Woden Bus Station (Platform 14)-Canberra Hospital: [Wjz3mAg, Wjz3mPO, Wjz3mWn]
+    short_name: "6"
+    stop_times: [[618a, 626a, 638a, 645a, 650a, 701a, 713a, 719a, 725a], [653a, 701a, 713a, 720a, 725a, 737a, 751a, 759a, 806a], [723a, 731a, 745a, 753a, 758a, 812a, 826a, 834a, 841a], [753a, 803a, 817a, 825a, 830a, 844a, 858a, 906a, 913a], [823a, 833a, 847a, 855a, 900a, 914a, 928a, 936a, 943a], [853a, 903a, 917a, 925a, 930a, 944a, 956a, 1004a, 1011a], [923a, 933a, 945a, 952a, 957a, 1011a, 1023a, 1031a, 1038a], [1023a, 1033a, 1045a, 1052a, 1057a, 1111a, 1123a, 1131a, 1138a], [1123a, 1133a, 1145a, 1152a, 1157a, 1211p, 1223p, 1231p, 1238p], [1223p, 1233p, 1245p, 1252p, 1257p, 111p, 123p, 131p, 138p], [123p, 133p, 145p, 152p, 157p, 211p, 223p, 231p, 238p], [223p, 233p, 245p, 252p, 257p, 311p, 325p, 333p, 340p], ["-", "-", "-", "-", "-", 344p, 358p, 406p, 413p], [323p, 333p, 347p, 355p, 400p, 414p, 428p, 436p, 443p], [353p, 403p, 417p, 425p, 430p, 444p, 458p, 506p, 513p], [423p, 433p, 447p, 455p, 500p, 514p, 528p, 536p, 543p], [453p, 503p, 517p, 525p, 530p, 544p, 558p, 606p, 613p], [516p, 526p, 540p, 548p, 553p, 607p, 621p, 629p, 635p], [553p, 603p, 617p, 625p, 630p, 640p, 650p, 656p, 702p], [630p, 638p, 648p, 655p, 700p, 710p, 720p, 726p, 732p], [730p, 738p, 748p, 755p, 800p, 810p, 820p, 826p, 832p], [830p, 838p, 848p, 855p, 900p, 910p, 920p, 926p, 932p], [930p, 938p, 948p, 955p, 1000p, 1010p, 1020p, 1026p, 1032p], [1030p, 1038p, 1048p, 1055p, 1100p, 1110p, 1120p, 1126p, 1132p]]
   -  
     time_points: [Cooleman Court, Duffy, Holder, Weston Primary, Woden Bus Station]
     long_name: To Woden Bus Station
@@ -1753,15 +1772,15 @@
     short_name: 19 319
     stop_times: [["-", "-", "-", "-", "-", 705a, 711a, 716a, 725a, 731a], ["-", "-", "-", "-", "-", 740a, 747a, 754a, 803a, 810a], [700a, 702a, 706a, 726a, 743a, 801a, 808a, 815a, 824a, 831a], [730a, 732a, 736a, 758a, 815a, 833a, 840a, 847a, 856a, 903a], ["-", "-", "-", "-", "-", 901a, 908a, 915a, 924a, 930a], ["-", "-", "-", "-", "-", 930a, 936a, 941a, 950a, 956a], [900a, 902a, 906a, 928a, 945a, 1001a, 1007a, 1012a, 1021a, 1027a], [930a, 932a, 936a, 956a, 1013a, 1029a, 1035a, 1040a, 1049a, 1055a], [1000a, 1002a, 1006a, 1026a, 1043a, 1059a, 1105a, 1110a, 1119a, 1125a], [1030a, 1032a, 1036a, 1056a, 1113a, 1129a, 1135a, 1140a, 1149a, 1155a], [1100a, 1102a, 1106a, 1126a, 1143a, 1159a, 1205p, 1210p, 1219p, 1225p], [1130a, 1132a, 1136a, 1156a, 1213p, 1229p, 1235p, 1240p, 1249p, 1255p], [1200p, 1202p, 1206p, 1226p, 1243p, 1259p, 105p, 110p, 119p, 125p], [1230p, 1232p, 1236p, 1256p, 113p, 129p, 135p, 140p, 149p, 155p], [100p, 102p, 106p, 126p, 143p, 159p, 205p, 210p, 219p, 225p], [130p, 132p, 136p, 156p, 213p, 229p, 235p, 240p, 249p, 255p], [200p, 202p, 206p, 226p, 243p, 259p, 306p, 313p, 322p, 329p], [230p, 232p, 236p, 256p, 313p, 333p, 340p, 347p, 356p, 403p], ["-", "-", "-", "-", 332p, 352p, 359p, 406p, 415p, 422p], [300p, 302p, 306p, 328p, 345p, 405p, 412p, 419p, 428p, 435p], [330p, 332p, 336p, 358p, 415p, 435p, 442p, 449p, 458p, 505p], [400p, 402p, 406p, 428p, 445p, 505p, 512p, 519p, 528p, 535p], [430p, 432p, 436p, 458p, 515p, 535p, 542p, 549p, 558p, 605p], [450p, 452p, 456p, 518p, 535p, 555p, 602p, 609p, 618p, 625p], [510p, 512p, 516p, 538p, 555p, 615p, 622p, 629p, 638p, 644p], [530p, 532p, 536p, 558p, 615p, 634p, 640p, 645p, 654p, 700p], [600p, 602p, 606p, 628p, 642p, 658p, 704p, 709p, 718p, 724p], [630p, 632p, 636p, 655p, 709p, 725p, 731p, 736p, 745p, 751p], ["-", "-", "-", "-", "-", 818p, 824p, 829p, 838p, 844p], ["-", "-", "-", "-", "-", 918p, 924p, 929p, 938p, 944p], ["-", "-", "-", "-", "-", 1018p, 1024p, 1029p, 1038p, 1044p], ["-", "-", "-", "-", "-", 1118p, 1124p, 1129p, 1138p, 1144p]]
   -  
-    time_points: [Cohen Street Bus Station (Platform 1), Westfield Bus Station (Platform 1), Belconnen Community Bus Station (Platform 3), Copland College, Tillyard / Spalding, Charnwood, Kerrigan / Lhotsky, Charnwood, Tillyard / Spalding, Copland College, Belconnen Community Bus Station, Westfield Bus Station, Cohen Street Bus Station]
+    time_points: [Cohen Street Bus Station (Platform 1), Westfield Bus Station (Platform 1), Belconnen Community Bus Station (Platform 3), Gwydir Square Kaleen, Kaleen Village / Marybrynong, Giralang, Kaleen Village / Marybrynong, Gwydir Square Kaleen, Belconnen Community Bus Station, Westfield Bus Station, Cohen Street Bus Station]
     long_name: To Cohen Street Bus Station
     between_stops: 
       Westfield Bus Station-Cohen Street Bus Station: []
       Belconnen Community Bus Station-Westfield Bus Station: []
       Westfield Bus Station (Platform 1)-Belconnen Community Bus Station (Platform 3): []
       Cohen Street Bus Station (Platform 1)-Westfield Bus Station (Platform 1): []
-    short_name: "45"
-    stop_times: [["-", "-", "-", "-", "-", 627a, 632a, 638a, 640a, 648a, 658a, 700a, 705a], ["-", "-", "-", "-", "-", 657a, 702a, 708a, 710a, 718a, 728a, 730a, 735a], ["-", "-", "-", "-", "-", 729a, 734a, 740a, 742a, 750a, 800a, 802a, 807a], ["-", "-", "-", "-", "-", 759a, 804a, 810a, 812a, 820a, 830a, 832a, 837a], ["-", "-", "-", "-", "-", 822a, 827a, 833a, 835a, 843a, 853a, 855a, 900a], ["-", "-", "-", "-", "-", 844a, 849a, 855a, 857a, 905a, 915a, 917a, 922a], [828a, 830a, 834a, 842a, 850a, 852a, 857a, 903a, 905a, 913a, 923a, 925a, 930a], [858a, 900a, 904a, 912a, 920a, 922a, 927a, 933a, 935a, 943a, 953a, 955a, 1000a], [921a, 923a, 927a, 935a, 943a, 945a, 950a, 956a, 958a, 1006a, 1016a, 1018a, 1023a], [1021a, 1023a, 1027a, 1035a, 1043a, 1045a, 1050a, 1056a, 1058a, 1106a, 1116a, 1118a, 1123a], [1121a, 1123a, 1127a, 1135a, 1143a, 1145a, 1150a, 1156a, 1158a, 1206p, 1216p, 1218p, 1223p], [1221p, 1223p, 1227p, 1235p, 1243p, 1245p, 1250p, 1256p, 1258p, 106p, 116p, 118p, 123p], [121p, 123p, 127p, 135p, 143p, 145p, 150p, 156p, 158p, 206p, 216p, 218p, 223p], [221p, 223p, 227p, 235p, 243p, 245p, 250p, 256p, 258p, 306p, 316p, 318p, 323p], [258p, 300p, 304p, 312p, 320p, 322p, 327p, 333p, 335p, 343p, 353p, 355p, 400p], [328p, 330p, 334p, 342p, 350p, 352p, 357p, 403p, 405p, 413p, 423p, 425p, 430p], [358p, 400p, 404p, 412p, 420p, 422p, 427p, 433p, 435p, 443p, 453p, 455p, 500p], [428p, 430p, 434p, 442p, 450p, 452p, 457p, 503p, 505p, 513p, 523p, 525p, 530p], [458p, 500p, 504p, 512p, 520p, 522p, 527p, 533p, 535p, 543p, 553p, 555p, 600p], [528p, 530p, 534p, 542p, 550p, 552p, 557p, 603p, 605p, 613p, 623p, 625p, 630p], [558p, 600p, 604p, 612p, 620p, 622p, 627p, 633p, 635p, 643p, 652p, 654p, 659p], [621p, 623p, 627p, 634p, 642p, 644p, 649p, 655p, 657p, 705p, 714p, 716p, 721p], [720p, 722p, 726p, 733p, 741p, 743p, 748p, 754p, 756p, 804p, 813p, 815p, 820p], [820p, 822p, 826p, 833p, 841p, 843p, 848p, 854p, 856p, 904p, 913p, 915p, 920p], [920p, 922p, 926p, 933p, 941p, 943p, 948p, 954p, 956p, 1004p, 1013p, 1015p, 1020p], [1020p, 1022p, 1026p, 1033p, 1041p, 1043p, 1048p, 1054p, 1056p, 1104p, 1113p, 1115p, 1120p], [1120p, 1122p, 1126p, 1133p, 1141p, 1143p, 1148p, 1154p, "-", "-", "-", "-", "-"], []]
+    short_nam