diff options
author | Christopher Baines <cb15g11@soton.ac.uk> | 2014-08-20 18:56:58 +0100 |
---|---|---|
committer | Christopher Baines <cb15g11@soton.ac.uk> | 2014-08-20 18:56:58 +0100 |
commit | 08979071ac39ae9d4acc14c24f801a9bffed4caf (patch) | |
tree | abbe0fcb769c1859a9023f3f2981a66c66ac7d78 | |
parent | 0fe9d05d8756e4839cc2d1baba1da7a11a736c05 (diff) | |
download | leaflet-soton-08979071ac39ae9d4acc14c24f801a9bffed4caf.tar leaflet-soton-08979071ac39ae9d4acc14c24f801a9bffed4caf.tar.gz |
Quick fix to remove duplicate routes
-rwxr-xr-x | create-data.js | 11 |
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); |