diff --git a/import/sql/tile_views.sql b/import/sql/tile_views.sql index 2be954b4..0544cdd7 100644 --- a/import/sql/tile_views.sql +++ b/import/sql/tile_views.sql @@ -1,77 +1,5 @@ --- Shared --- -CREATE OR REPLACE VIEW railway_line_low AS - SELECT - id, - way, - highspeed, - -- speeds are converted to kph in this layer because it is used for colouring - maxspeed, - train_protection, - train_protection_rank, - railway_to_int(voltage) AS voltage, - railway_to_float(frequency) AS frequency, - railway_to_int(gauge) AS gaugeint0, - gauge as gauge0 - FROM ( - SELECT - id, - way, - railway_dominant_speed(preferred_direction, maxspeed, maxspeed_forward, maxspeed_backward) AS maxspeed, - highspeed, - train_protection, - train_protection_rank, - frequency, - voltage, - railway_desired_value_from_list(1, gauge) AS gauge - FROM railway_line - WHERE railway = 'rail' AND usage = 'main' AND service IS NULL - ) AS r - ORDER by - highspeed, - maxspeed NULLS FIRST; - -CREATE OR REPLACE VIEW railway_line_med AS - SELECT - id, - way, - usage, - highspeed, - maxspeed, - train_protection_rank, - train_protection, - electrification_state, - voltage, - frequency, - railway_to_int(gauge) AS gaugeint0, - gauge as gauge0 - FROM - (SELECT - id, - way, - railway, - usage, - highspeed, - -- speeds are converted to kph in this layer because it is used for colouring - railway_dominant_speed(preferred_direction, maxspeed, maxspeed_forward, maxspeed_backward) AS maxspeed, - train_protection_rank, - train_protection, - railway_electrification_state(railway, electrified, deelectrified, abandoned_electrified, NULL, NULL, true) AS electrification_state, - railway_to_int(voltage) AS voltage, - railway_to_float(frequency) AS frequency, - railway_desired_value_from_list(1, gauge) AS gauge - FROM railway_line - WHERE railway = 'rail' AND usage IN ('main', 'branch') AND service IS NULL - ) AS r - ORDER by - CASE - WHEN railway = 'rail' AND usage = 'main' AND highspeed THEN 2000 - WHEN railway = 'rail' AND usage = 'main' THEN 1100 - WHEN railway = 'rail' AND usage = 'branch' THEN 1000 - ELSE 50 - END NULLS LAST, - maxspeed NULLS FIRST; - CREATE OR REPLACE VIEW railway_line_high AS SELECT id, @@ -187,6 +115,20 @@ CREATE OR REPLACE VIEW railway_line_high AS rank NULLS LAST, maxspeed NULLS FIRST; +CREATE OR REPLACE VIEW railway_line_med AS + SELECT + * + FROM + railway_line_high + WHERE railway = 'rail' AND usage IN ('main', 'branch') AND service IS NULL; + +CREATE OR REPLACE VIEW railway_line_low AS + SELECT + * + FROM + railway_line_high + WHERE railway = 'rail' AND usage = 'main' AND service IS NULL; + --- Standard --- CREATE OR REPLACE VIEW standard_railway_text_stations_low AS diff --git a/martin/configuration.yml b/martin/configuration.yml index e1c4cb50..51ff69c5 100644 --- a/martin/configuration.yml +++ b/martin/configuration.yml @@ -33,16 +33,35 @@ postgres: geometry_column: way geometry_type: LINESTRING properties: + # TODO calculate labels in frontend id: integer + railway: string + feature: string + usage: string + service: string highspeed: boolean - maxspeed: integer + tunnel: boolean + bridge: boolean + ref: string + standard_label: string + track_ref: string + maxspeed: number + speed_label: string train_protection: string train_protection_rank: integer - frequency: double - voltage: integer - gaugeint0: integer + electrification_state: string + frequency: number + voltage: number + future_frequency: number + future_voltage: number + electrification_label: string gauge0: string - # TODO define more properties + gaugeint0: number + gauge1: string + gaugeint1: number + gauge2: string + gaugeint2: number + gauge_label: string railway_line_med: schema: public @@ -51,18 +70,35 @@ postgres: geometry_column: way geometry_type: LINESTRING properties: + # TODO calculate labels in frontend id: integer + railway: string + feature: string usage: string + service: string highspeed: boolean - maxspeed: integer + tunnel: boolean + bridge: boolean + ref: string + standard_label: string + track_ref: string + maxspeed: number + speed_label: string train_protection: string train_protection_rank: integer electrification_state: string - frequency: double - voltage: integer - gaugeint0: integer + frequency: number + voltage: number + future_frequency: number + future_voltage: number + electrification_label: string gauge0: string - # TODO define more properties + gaugeint0: number + gauge1: string + gaugeint1: number + gauge2: string + gaugeint2: number + gauge_label: string railway_line_high: schema: public