Skip to content

Commit

Permalink
Adress CR comments part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
arindam1993 committed Nov 23, 2024
1 parent 10aa6e9 commit 5cd77cd
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/flatten-stop-routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -29,4 +25,4 @@ function flattenStopRoutes(geojson) {

module.exports = {
flattenStopRoutes,
}
};

0 comments on commit 5cd77cd

Please sign in to comment.