summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-03-28 22:32:33 +0000
committerChristopher Baines <cb15g11@soton.ac.uk>2014-03-28 22:32:33 +0000
commitfba03f4f3829438d697eed21928e2b7876d517a1 (patch)
tree21d49d450ca4e0d74a491339e90341fda23f78ec
parenta06710fc33672ea224e5118198c7162109c528fb (diff)
downloadleaflet-soton-fba03f4f3829438d697eed21928e2b7876d517a1.tar
leaflet-soton-fba03f4f3829438d697eed21928e2b7876d517a1.tar.gz
Crude replacement of University of Southampton bus stop uri's
In OSM, the stops have the national URI's. However, for the map, its better to link to the bus.soton.ac.uk site. Hence, the URI's are now rewritten to achieve this.
-rwxr-xr-xcreate-data.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/create-data.js b/create-data.js
index 1a9fa2e..0d2fcb1 100755
--- a/create-data.js
+++ b/create-data.js
@@ -1068,9 +1068,15 @@ function createBusStop(stopArea, routes, callback) {
var routeArray = "{" + routes.join(", ") + "}";
+ var uri = stopArea.tags.uri;
+
+ if (uri.indexOf("http://transport.data.gov.uk/id/stop-point/") === 0) {
+ uri = "http://id.southampton.ac.uk/bus-stop/" + uri.slice(43);
+ }
+
var pgQuery = "insert into uni_bus_stop values(ST_SetSRID(ST_MakePoint("
pgQuery = pgQuery + node.geometry.coordinates[0] + ", " + node.geometry.coordinates[1];
- pgQuery = pgQuery + "),4326), '" + name + "', '" + stopArea.tags.uri + "', '" + routeArray + "');";
+ pgQuery = pgQuery + "),4326), '" + name + "', '" + uri + "', '" + routeArray + "');";
pg.query(pgQuery, function(err, result) {
if (err) {