From b4d95802bdeb4388edce52adce5325628c49273b Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sat, 14 Dec 2024 22:20:18 +0100 Subject: [PATCH 1/6] fix tram stop names not rendered --- import/sql/tile_views.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/import/sql/tile_views.sql b/import/sql/tile_views.sql index e2d33ddf..4c5f6459 100644 --- a/import/sql/tile_views.sql +++ b/import/sql/tile_views.sql @@ -197,7 +197,7 @@ CREATE OR REPLACE VIEW standard_railway_text_stations AS railway_ref, name FROM stations_with_route_counts - WHERE railway IN ('station', 'halt', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site') + WHERE railway IN ('station', 'halt', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop') AND name IS NOT NULL ) AS r ORDER by rank DESC NULLS LAST, route_count DESC NULLS LAST; From 97e34bf82f5f13709809228db53187ac5f40d955 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 15 Dec 2024 00:40:14 +0100 Subject: [PATCH 2/6] add grouped stations source --- docker-compose.yml | 2 +- import/sql/get_station_importance.sql | 45 ++++++++++----- import/sql/tile_views.sql | 55 +++++++++++++------ martin/configuration.yml | 14 +++++ proxy/js/features.mjs | 1 + proxy/js/styles.mjs | 79 +++++++++++++++++++++++---- proxy/proxy.conf.template | 2 +- 7 files changed, 155 insertions(+), 43 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index abf8fb05..8eb2e7e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -57,7 +57,7 @@ services: [ "$$TILES" = "low-med" ] && $$MARTIN --min-zoom 7 --max-zoom 7 --source railway_line_med --output-file /tiles/railway_line_med.mbtiles && mbtiles summary /tiles/railway_line_med.mbtiles [ "$$TILES" = "low-med" ] && $$MARTIN --min-zoom 7 --max-zoom 7 --source standard_railway_text_stations_med --output-file /tiles/standard_railway_text_stations_med.mbtiles && mbtiles summary /tiles/standard_railway_text_stations_med.mbtiles [ "$$TILES" = "high" ] && $$MARTIN --min-zoom 8 --max-zoom "$$MAX_ZOOM" --source railway_line_high,railway_text_km --output-file /tiles/high.mbtiles && mbtiles summary /tiles/high.mbtiles - [ "$$TILES" = "standard" ] && $$MARTIN --min-zoom 8 --max-zoom "$$MAX_ZOOM" --source standard_railway_turntables,standard_railway_text_stations,standard_railway_symbols,standard_railway_switch_ref --output-file /tiles/standard.mbtiles && mbtiles summary /tiles/standard.mbtiles + [ "$$TILES" = "standard" ] && $$MARTIN --min-zoom 8 --max-zoom "$$MAX_ZOOM" --source standard_railway_turntables,standard_railway_text_stations,standard_railway_grouped_stations,standard_railway_symbols,standard_railway_switch_ref --output-file /tiles/standard.mbtiles && mbtiles summary /tiles/standard.mbtiles [ "$$TILES" = "speed" ] && $$MARTIN --min-zoom 8 --max-zoom "$$MAX_ZOOM" --source speed_railway_signals --output-file /tiles/speed.mbtiles && mbtiles summary /tiles/speed.mbtiles [ "$$TILES" = "signals" ] && $$MARTIN --min-zoom 8 --max-zoom "$$MAX_ZOOM" --source signals_railway_signals,signals_signal_boxes --output-file /tiles/signals.mbtiles && mbtiles summary /tiles/signals.mbtiles [ "$$TILES" = "electrification" ] && $$MARTIN --min-zoom 8 --max-zoom "$$MAX_ZOOM" --source electrification_signals --output-file /tiles/electrification.mbtiles && mbtiles summary /tiles/electrification.mbtiles diff --git a/import/sql/get_station_importance.sql b/import/sql/get_station_importance.sql index 9128b208..f84e36e0 100644 --- a/import/sql/get_station_importance.sql +++ b/import/sql/get_station_importance.sql @@ -60,24 +60,39 @@ CREATE OR REPLACE VIEW station_nodes_platforms_rel_count AS -- needs about 3 to 4 minutes for whole Germany -- or about 20 to 30 minutes for the whole planet CREATE MATERIALIZED VIEW IF NOT EXISTS stations_with_route_counts AS - SELECT DISTINCT ON (osm_id, name, station, railway_ref, railway) id, osm_id, name, station, railway_ref, railway, route_count, name_tags, way + SELECT + MIN(id) as id, + MIN(osm_id) as osm_id, + name, + station, + railway_ref, + railway, + MAX(route_count) as route_count, + hstore(string_agg(nullif(name_tags::text, ''), ',')) as name_tags, + ST_Collect(way) as way + FROM ( + SELECT + *, + ST_ClusterDBSCAN(way, 400, 1) OVER (PARTITION BY name, station, railway_ref, railway) AS cluster_id FROM ( - SELECT id, osm_id, name, station, railway_ref, railway, ARRAY_LENGTH(ARRAY_AGG(DISTINCT route_id), 1) AS route_count, name_tags, way - FROM ( - SELECT id, osm_id, name, station, railway_ref, railway, UNNEST(route_ids) AS route_id, name_tags, way - FROM station_nodes_stop_positions_rel_count - UNION ALL - SELECT id, osm_id, name, station, railway_ref, railway, UNNEST(route_ids) AS route_id, name_tags, way - FROM station_nodes_platforms_rel_count - ) AS a - GROUP BY id, osm_id, name, station, railway_ref, railway, way, name_tags + SELECT MIN(id) as id, MIN(osm_id) as osm_id, name, station, railway_ref, railway, ARRAY_LENGTH(ARRAY_AGG(DISTINCT route_id), 1) AS route_count, name_tags, way + FROM ( + SELECT id, osm_id, name, station, railway_ref, railway, UNNEST(route_ids) AS route_id, name_tags, way + FROM station_nodes_stop_positions_rel_count + UNION ALL + SELECT id, osm_id, name, station, railway_ref, railway, UNNEST(route_ids) AS route_id, name_tags, way + FROM station_nodes_platforms_rel_count + ) AS a + GROUP BY name, station, railway_ref, railway, way, name_tags UNION ALL SELECT id, osm_id, name, station, railway_ref, railway, 0 AS route_count, name_tags, way - FROM stations - WHERE railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site') - ) AS facilities - -- ORDER BY is required to ensure that the larger route_count is used. - ORDER BY osm_id, name, station, railway_ref, railway, route_count DESC; + FROM stations + WHERE railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site') + ) AS grouped_facilities + ) AS facilities + GROUP BY name, station, railway_ref, railway, cluster_id + -- ORDER BY is required to ensure that the larger route_count is used. + ORDER BY name, station, railway_ref, railway, route_count DESC; CREATE INDEX IF NOT EXISTS stations_with_route_counts_geom_index ON stations_with_route_counts diff --git a/import/sql/tile_views.sql b/import/sql/tile_views.sql index 4c5f6459..cd1a10c6 100644 --- a/import/sql/tile_views.sql +++ b/import/sql/tile_views.sql @@ -139,7 +139,7 @@ CREATE OR REPLACE VIEW standard_railway_text_stations_low AS SELECT id, osm_id, - way, + ST_Centroid(way) as way, railway_ref as label FROM stations_with_route_counts WHERE @@ -153,7 +153,7 @@ CREATE OR REPLACE VIEW standard_railway_text_stations_med AS SELECT id, osm_id, - way, + ST_Centroid(way) as way, railway_ref as label FROM stations_with_route_counts WHERE @@ -186,22 +186,45 @@ CREATE OR REPLACE VIEW standard_railway_text_stations AS WHEN railway = 'crossover' THEN 700 ELSE 50 END AS rank - FROM - (SELECT - id, - osm_id, - way, - railway, - route_count, - station, - railway_ref, - name - FROM stations_with_route_counts - WHERE railway IN ('station', 'halt', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop') - AND name IS NOT NULL - ) AS r + FROM ( + SELECT + id, + osm_id, + ST_Centroid(way) as way, + railway, + route_count, + station, + railway_ref, + name + FROM stations_with_route_counts + WHERE railway IN ('station', 'halt', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop') + AND name IS NOT NULL + ) AS r ORDER by rank DESC NULLS LAST, route_count DESC NULLS LAST; +CREATE OR REPLACE VIEW standard_railway_grouped_stations AS + SELECT + id, + osm_id, + way, + railway, + station, + railway_ref as label, + name + FROM ( + SELECT + id, + osm_id, + ST_Buffer(ST_ConvexHull(way), 50) as way, + railway, + station, + railway_ref, + name + FROM stations_with_route_counts + WHERE railway IN ('station', 'halt', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop') + AND ST_NumGeometries(way) > 1 + ) AS r; + CREATE OR REPLACE VIEW standard_railway_symbols AS SELECT id, diff --git a/martin/configuration.yml b/martin/configuration.yml index 2dd1e8e5..8a573abc 100644 --- a/martin/configuration.yml +++ b/martin/configuration.yml @@ -202,6 +202,20 @@ postgres: label: string name: string + standard_railway_grouped_stations: + schema: public + table: standard_railway_grouped_stations + srid: 3857 + geometry_column: way + geometry_type: POLYGON + properties: + id: integer + osm_id: integer + railway: string + station: string + label: string + name: string + standard_railway_symbols: schema: public table: standard_railway_symbols diff --git a/proxy/js/features.mjs b/proxy/js/features.mjs index 8f2491a4..1bec0a70 100644 --- a/proxy/js/features.mjs +++ b/proxy/js/features.mjs @@ -156,6 +156,7 @@ const features = { 'standard_railway_text_stations_low-standard_railway_text_stations_low': stationFeatures, 'standard_railway_text_stations_med-standard_railway_text_stations_med': stationFeatures, 'openrailwaymap_standard-standard_railway_text_stations': stationFeatures, + 'openrailwaymap_standard-standard_railway_grouped_stations': stationFeatures, 'openrailwaymap_standard-standard_railway_turntables': { features: { turntable: { diff --git a/proxy/js/styles.mjs b/proxy/js/styles.mjs index ac1583f3..916bbbf1 100644 --- a/proxy/js/styles.mjs +++ b/proxy/js/styles.mjs @@ -1384,6 +1384,48 @@ const layers = Object.fromEntries(knownThemes.map(theme => [theme, { 'text-max-width': 5, }, }, + { + id: 'railway_grouped_stations', + type: 'fill', + minzoom: 8, + source: 'openrailwaymap_standard', + 'source-layer': 'standard_railway_grouped_stations', + filter: ['step', ['zoom'], + ['all', + ['==', ['get', 'railway'], 'station'], + ['!=', ['get', 'station'], 'light_rail'], + ['!=', ['get', 'station'], 'subway'], + ['!=', ['get', 'station'], 'funicular'], + ], + 9, + ['all', + ['any', + ['==', ['get', 'railway'], 'station'], + ['==', ['get', 'railway'], 'halt'], + ], + ['!=', ['get', 'station'], 'funicular'], + ], + 10, + ['all', + ['!=', ['get', 'railway'], 'tram_stop'], + ['!=', ['get', 'station'], 'funicular'], + ], + 13, + ['!=', ['get', 'station'], 'funicular'], + ], + paint: { + 'fill-color': ['case', + ['==', ['get', 'railway'], 'tram_stop'], colors[theme].styles.standard.tram, + ['==', ['get', 'station'], 'light_rail'], colors[theme].styles.standard.light_rail, + ['==', ['get', 'station'], 'subway'], colors[theme].styles.standard.subway, + colors[theme].styles.standard.main, + ], + 'fill-opacity': ['case', + ['boolean', ['feature-state', 'hover'], false], 0.3, + 0.2, + ], + }, + }, { id: 'railway_tunnel_casing', type: 'line', @@ -2170,6 +2212,7 @@ const layers = Object.fromEntries(knownThemes.map(theme => [theme, { ['==', ['get', 'railway'], 'station'], ['==', ['get', 'railway'], 'halt'], ], + ['!=', ['get', 'railway'], 'tram_stop'], ['!=', ['get', 'station'], 'funicular'], ], 10, @@ -2177,23 +2220,16 @@ const layers = Object.fromEntries(knownThemes.map(theme => [theme, { ['!=', ['get', 'railway'], 'tram_stop'], ['!=', ['get', 'station'], 'funicular'], ], - 13, - ['!=', ['get', 'station'], 'funicular'], ], paint: { 'text-color': ['case', ['==', ['get', 'railway'], 'yard'], colors[theme].styles.standard.yardText, - ['==', ['get', 'railway'], 'tram_stop'], colors[theme].styles.standard.tramStopText, ['==', ['get', 'railway'], 'station'], colors[theme].styles.standard.stationsText, ['==', ['get', 'railway'], 'halt'], colors[theme].styles.standard.stationsText, colors[theme].styles.standard.defaultText, ], 'text-halo-color': ['case', ['boolean', ['feature-state', 'hover'], false], colors[theme].hover.textHalo, - // ['==', ['get', 'railway'], 'yard'], colors[theme].halo, - // ['==', ['get', 'railway'], 'tram_stop'], colors[theme].halo, - // ['==', ['get', 'railway'], 'station'], colors[theme].halo, - // ['==', ['get', 'railway'], 'halt'], colors[theme].halo, colors[theme].halo, ], 'text-halo-width': 1.5, @@ -2211,10 +2247,32 @@ const layers = Object.fromEntries(knownThemes.map(theme => [theme, { 'text-size': 11, 'text-padding': 10, 'text-max-width': 5, - 'text-offset': ['case', - ['==', ['get', 'railway'], 'tram_stop'], ['literal', [0, 1]], - ['literal', [0, 0]] + }, + }, + { + id: 'railway_tram_stations', + type: 'symbol', + minzoom: 13, + source: 'openrailwaymap_standard', + 'source-layer': 'standard_railway_text_stations', + filter: ['==', ['get', 'railway'], 'tram_stop'], + paint: { + 'text-color': colors[theme].styles.standard.tramStopText, + 'text-halo-color': ['case', + ['boolean', ['feature-state', 'hover'], false], colors[theme].hover.textHalo, + colors[theme].halo, ], + 'text-halo-width': 1.5, + }, + layout: { + 'symbol-z-order': 'source', + 'text-field': '{name}', + // TODO light rail / subway oblique font + 'text-font': ['Noto Sans Bold'], + 'text-size': 11, + 'text-padding': 10, + 'text-max-width': 5, + 'text-variable-anchor': ['top', 'bottom'], }, }, searchResults, @@ -4052,6 +4110,7 @@ const legendData = { railway: feature.feature, }, })), + "openrailwaymap_standard-standard_railway_grouped_stations": [], "openrailwaymap_standard-standard_railway_turntables": [ { legend: 'Turntable', diff --git a/proxy/proxy.conf.template b/proxy/proxy.conf.template index 1af5a7f2..3a72d2a8 100644 --- a/proxy/proxy.conf.template +++ b/proxy/proxy.conf.template @@ -94,7 +94,7 @@ server { location / { if ($http_referer ~ ^http://localhost) { rewrite ^/high$ /railway_line_high,railway_text_km last; - rewrite ^/standard$ /standard_railway_turntables,standard_railway_text_stations,standard_railway_symbols,standard_railway_switch_ref last; + rewrite ^/standard$ /standard_railway_turntables,standard_railway_text_stations,standard_railway_grouped_stations,standard_railway_symbols,standard_railway_switch_ref last; rewrite ^/speed$ /speed_railway_signals last; rewrite ^/signals$ /signals_railway_signals,signals_signal_boxes last; rewrite ^/electrification$ /electrification_signals last; From 6cf7f54f287fcb9fa9ba4df746b4dbf348757163 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 15 Dec 2024 11:04:11 +0100 Subject: [PATCH 3/6] add station count --- import/sql/get_station_importance.sql | 2 +- import/sql/tile_views.sql | 7 ++++--- martin/configuration.yml | 1 + proxy/js/styles.mjs | 16 ++++++++++++++-- 4 files changed, 20 insertions(+), 6 deletions(-) diff --git a/import/sql/get_station_importance.sql b/import/sql/get_station_importance.sql index f84e36e0..6047dcdb 100644 --- a/import/sql/get_station_importance.sql +++ b/import/sql/get_station_importance.sql @@ -69,7 +69,7 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS stations_with_route_counts AS railway, MAX(route_count) as route_count, hstore(string_agg(nullif(name_tags::text, ''), ',')) as name_tags, - ST_Collect(way) as way + ST_RemoveRepeatedPoints(ST_Collect(way)) as way FROM ( SELECT *, diff --git a/import/sql/tile_views.sql b/import/sql/tile_views.sql index cd1a10c6..ba3847a2 100644 --- a/import/sql/tile_views.sql +++ b/import/sql/tile_views.sql @@ -185,7 +185,8 @@ CREATE OR REPLACE VIEW standard_railway_text_stations AS WHEN railway = 'site' THEN 600 WHEN railway = 'crossover' THEN 700 ELSE 50 - END AS rank + END AS rank, + count FROM ( SELECT id, @@ -195,7 +196,8 @@ CREATE OR REPLACE VIEW standard_railway_text_stations AS route_count, station, railway_ref, - name + name, + ST_NumGeometries(way) as count FROM stations_with_route_counts WHERE railway IN ('station', 'halt', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop') AND name IS NOT NULL @@ -222,7 +224,6 @@ CREATE OR REPLACE VIEW standard_railway_grouped_stations AS name FROM stations_with_route_counts WHERE railway IN ('station', 'halt', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site', 'tram_stop') - AND ST_NumGeometries(way) > 1 ) AS r; CREATE OR REPLACE VIEW standard_railway_symbols AS diff --git a/martin/configuration.yml b/martin/configuration.yml index 8a573abc..eee78fd3 100644 --- a/martin/configuration.yml +++ b/martin/configuration.yml @@ -201,6 +201,7 @@ postgres: station: string label: string name: string + count: integer standard_railway_grouped_stations: schema: public diff --git a/proxy/js/styles.mjs b/proxy/js/styles.mjs index 916bbbf1..65a5901f 100644 --- a/proxy/js/styles.mjs +++ b/proxy/js/styles.mjs @@ -2240,10 +2240,15 @@ const layers = Object.fromEntries(knownThemes.map(theme => [theme, { ['get', 'label'], 10, ['get', 'name'], + 15, + ['case', + ['>', ['get', 'count'], 1], ['concat', ['get', 'name'], ' (', ['get', 'count'], ')'], + ['get', 'name'], + ], ], // TODO light rail / subway oblique font 'text-font': ['Noto Sans Bold'], - // TODO text-variable-anchor-offset + 'text-variable-anchor': ['center', 'top', 'bottom', 'left', 'right'], 'text-size': 11, 'text-padding': 10, 'text-max-width': 5, @@ -2266,7 +2271,14 @@ const layers = Object.fromEntries(knownThemes.map(theme => [theme, { }, layout: { 'symbol-z-order': 'source', - 'text-field': '{name}', + 'text-field': ['step', ['zoom'], + ['get', 'name'], + 15, + ['case', + ['>', ['get', 'count'], 1], ['concat', ['get', 'name'], ' (', ['get', 'count'], ')'], + ['get', 'name'], + ], + ], // TODO light rail / subway oblique font 'text-font': ['Noto Sans Bold'], 'text-size': 11, From e8627bd3d79d3b5154048ea43274419bdda0e3b0 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 15 Dec 2024 11:08:33 +0100 Subject: [PATCH 4/6] add station count to facility API --- api/openrailwaymap_api/facility_api.py | 2 +- api/prepare_facilities.sql | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/api/openrailwaymap_api/facility_api.py b/api/openrailwaymap_api/facility_api.py index eeff3c24..6b3e9f6d 100644 --- a/api/openrailwaymap_api/facility_api.py +++ b/api/openrailwaymap_api/facility_api.py @@ -66,7 +66,7 @@ async def search_by_name(self, q, limit): {fields}, latitude, longitude, rank FROM ( SELECT - {fields}, ST_X(ST_Transform(geom, 4326)) AS latitude, ST_Y(ST_Transform(geom, 4326)) AS longitude, openrailwaymap_name_rank(phraseto_tsquery('simple', unaccent(openrailwaymap_hyphen_to_space($1))), terms, route_count, railway, station) AS rank + {fields}, ST_X(ST_Transform(geom, 4326)) AS latitude, ST_Y(ST_Transform(geom, 4326)) AS longitude, openrailwaymap_name_rank(phraseto_tsquery('simple', unaccent(openrailwaymap_hyphen_to_space($1))), terms, route_count, station_count, railway, station) AS rank FROM openrailwaymap_facilities_for_search WHERE terms @@ phraseto_tsquery('simple', unaccent(openrailwaymap_hyphen_to_space($1))) ) AS a diff --git a/api/prepare_facilities.sql b/api/prepare_facilities.sql index 152e03f8..f4b51b1c 100644 --- a/api/prepare_facilities.sql +++ b/api/prepare_facilities.sql @@ -41,6 +41,7 @@ CREATE TABLE openrailwaymap_facilities_for_search AS station, railway_ref, route_count, + station_count, geom FROM ( SELECT DISTINCT ON (osm_id, key, value, name, railway, station, railway_ref, route_count, geom) @@ -52,6 +53,7 @@ CREATE TABLE openrailwaymap_facilities_for_search AS station, railway_ref, route_count, + station_count, geom FROM ( SELECT @@ -62,7 +64,8 @@ CREATE TABLE openrailwaymap_facilities_for_search AS railway_ref, name_tags, route_count, - way AS geom + ST_NumGeometries(way) as station_count, + ST_Centroid(way) AS geom FROM stations_with_route_counts WHERE railway IN ('station', 'halt', 'tram_stop', 'service_station', 'yard', 'junction', 'spur_junction', 'crossover', 'site') From f171b8ec75883ad37006d2af56b3ab74a6e44b59 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 15 Dec 2024 11:18:02 +0100 Subject: [PATCH 5/6] function call --- api/openrailwaymap_api/facility_api.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/openrailwaymap_api/facility_api.py b/api/openrailwaymap_api/facility_api.py index 6b3e9f6d..eeff3c24 100644 --- a/api/openrailwaymap_api/facility_api.py +++ b/api/openrailwaymap_api/facility_api.py @@ -66,7 +66,7 @@ async def search_by_name(self, q, limit): {fields}, latitude, longitude, rank FROM ( SELECT - {fields}, ST_X(ST_Transform(geom, 4326)) AS latitude, ST_Y(ST_Transform(geom, 4326)) AS longitude, openrailwaymap_name_rank(phraseto_tsquery('simple', unaccent(openrailwaymap_hyphen_to_space($1))), terms, route_count, station_count, railway, station) AS rank + {fields}, ST_X(ST_Transform(geom, 4326)) AS latitude, ST_Y(ST_Transform(geom, 4326)) AS longitude, openrailwaymap_name_rank(phraseto_tsquery('simple', unaccent(openrailwaymap_hyphen_to_space($1))), terms, route_count, railway, station) AS rank FROM openrailwaymap_facilities_for_search WHERE terms @@ phraseto_tsquery('simple', unaccent(openrailwaymap_hyphen_to_space($1))) ) AS a From ab5af1af3797b45930551565499a74130cd8e035 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Sun, 15 Dec 2024 11:18:21 +0100 Subject: [PATCH 6/6] remove station_count --- api/prepare_facilities.sql | 3 --- 1 file changed, 3 deletions(-) diff --git a/api/prepare_facilities.sql b/api/prepare_facilities.sql index f4b51b1c..1347d335 100644 --- a/api/prepare_facilities.sql +++ b/api/prepare_facilities.sql @@ -41,7 +41,6 @@ CREATE TABLE openrailwaymap_facilities_for_search AS station, railway_ref, route_count, - station_count, geom FROM ( SELECT DISTINCT ON (osm_id, key, value, name, railway, station, railway_ref, route_count, geom) @@ -53,7 +52,6 @@ CREATE TABLE openrailwaymap_facilities_for_search AS station, railway_ref, route_count, - station_count, geom FROM ( SELECT @@ -64,7 +62,6 @@ CREATE TABLE openrailwaymap_facilities_for_search AS railway_ref, name_tags, route_count, - ST_NumGeometries(way) as station_count, ST_Centroid(way) AS geom FROM stations_with_route_counts WHERE