From 5cd77cda731a4053ce1dfdd757294aabcac33711 Mon Sep 17 00:00:00 2001 From: Arindam Bose Date: Fri, 22 Nov 2024 20:38:09 -0800 Subject: [PATCH] Adress CR comments part 2 --- src/flatten-stop-routes.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/flatten-stop-routes.js b/src/flatten-stop-routes.js index e0553a2..ba75186 100644 --- a/src/flatten-stop-routes.js +++ b/src/flatten-stop-routes.js @@ -6,18 +6,14 @@ function flattenStopRoutes(geojson) { for(const feature of geojson.features){ if(feature.geometry.type === 'Point'){ - const routes = feature.properties.routes; - feature.properties['route_ids'] = routes.map((route) => route.route_id).join(','); - delete feature.properties.routes; - const stopId = feature.properties['stop_id']; - if (stopId && stopId.length > 0 ) { + if (stopId) { const point = turf.point(feature.geometry.coordinates); stopIdPointLookup[stopId] = point } } else if(feature.geometry.type === 'LineString') { const routeId = feature.properties.route_id; - if (routeId && routeId.length > 0) { + if (routeId) { const lineString = turf.lineString(feature.geometry.coordinates); routeIdLineStringLookup[routeId] = lineString; } @@ -29,4 +25,4 @@ function flattenStopRoutes(geojson) { module.exports = { flattenStopRoutes, -} \ No newline at end of file +}; \ No newline at end of file