diff --git a/datasources/sources/gtfs_shape.rb b/datasources/sources/gtfs_shape.rb index 3dca67e..62f3492 100644 --- a/datasources/sources/gtfs_shape.rb +++ b/datasources/sources/gtfs_shape.rb @@ -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 @@ -61,4 +62,8 @@ def map_tags(feat) }, } end + + def map_refs(feat) + feat['properties']['stop_ids']&.[](..-2)&.split('~,') + end end