Skip to content

Commit

Permalink
Add bus stops ref to route
Browse files Browse the repository at this point in the history
  • Loading branch information
frodrigo committed Sep 22, 2024
1 parent 79bde0c commit 1a0be82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion datasources/sources/gtfs_shape.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ class Settings < GdalSource::Settings
SELECT
GUnion(DISTINCT shapes_geom.geometry) AS geometry,
routes.*,
group_concat(DISTINCT stops.stop_name) AS stops
group_concat(DISTINCT stops.stop_name) AS stops,
group_concat(DISTINCT stops.stop_id||\'~\') AS stop_ids
FROM
shapes_geom
JOIN trips ON
Expand Down Expand Up @@ -61,4 +62,8 @@ def map_tags(feat)
},
}
end

def map_refs(feat)
feat['properties']['stop_ids']&.[](..-2)&.split('~,')
end
end

0 comments on commit 1a0be82

Please sign in to comment.