From 08979071ac39ae9d4acc14c24f801a9bffed4caf Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Wed, 20 Aug 2014 18:56:58 +0100 Subject: Quick fix to remove duplicate routes --- create-data.js | 11 +++++++++++ 1 file changed, 11 insertions(+) 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); -- cgit v1.2.3