From 1a0be825a434dfd61b39b4059809290b86bca054 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Rodrigo?= Date: Sun, 22 Sep 2024 18:17:12 +0200 Subject: [PATCH] Add bus stops ref to route --- datasources/sources/gtfs_shape.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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