summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Baines <cb15g11@soton.ac.uk>2014-08-20 18:56:58 +0100
committerChristopher Baines <cb15g11@soton.ac.uk>2014-08-20 18:56:58 +0100
commit08979071ac39ae9d4acc14c24f801a9bffed4caf (patch)
treeabbe0fcb769c1859a9023f3f2981a66c66ac7d78
parent0fe9d05d8756e4839cc2d1baba1da7a11a736c05 (diff)
downloadleaflet-soton-08979071ac39ae9d4acc14c24f801a9bffed4caf.tar
leaflet-soton-08979071ac39ae9d4acc14c24f801a9bffed4caf.tar.gz
Quick fix to remove duplicate routes
-rwxr-xr-xcreate-data.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/create-data.js b/create-data.js
index a365e2c..d97092c 100755
--- a/create-data.js
+++ b/create-data.js
@@ -1515,6 +1515,17 @@ function loadBusData(collections, callback) {
function(routes, callback) {
async.eachSeries(routes, function(route, callback) {
processRoute(route, null, stopAreaRoutes, function(err, feature) {
+ // Check if this route is a duplicate
+
+ for (var i in collections.busRoutes.features) {
+ var route = collections.busRoutes.features[i];
+
+ if (route.properties.name === feature.properties.name) {
+ callback(err);
+ return;
+ }
+ }
+
collections.busRoutes.features.push(feature);
callback(err);