From bb3ed10f7ff375e02bba02089fad165af55beaa6 Mon Sep 17 00:00:00 2001 From: Hidde Wieringa Date: Mon, 16 Dec 2024 21:22:33 +0100 Subject: [PATCH] simplify standard_railway_text_stations query --- import/sql/tile_views.sql | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/import/sql/tile_views.sql b/import/sql/tile_views.sql index 7ef7382f..c1f6cb9e 100644 --- a/import/sql/tile_views.sql +++ b/import/sql/tile_views.sql @@ -187,21 +187,9 @@ CREATE OR REPLACE VIEW standard_railway_text_stations AS ELSE 50 END AS rank, count - FROM ( - SELECT - id, - osm_id, - center, - railway, - route_count, - station, - railway_ref, - name, - 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 - ) AS r + 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 ORDER by rank DESC NULLS LAST, route_count DESC NULLS LAST; CREATE OR REPLACE VIEW standard_railway_grouped_stations AS