Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddewie committed Oct 30, 2024
1 parent d06fb9a commit 154c6f1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 1 addition & 7 deletions import/openrailwaymap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,7 @@ local railway_line = osm2pgsql.define_table({
{ column = 'bridge', type = 'text' },
{ column = 'bridge_name', type = 'text' },
{ column = 'maxspeed', type = 'text' },
{ column = 'maxspeed_forward', type = 'text' },
{ column = 'maxspeed_backward', type = 'text' },
{ column = 'preferred_direction', type = 'text' },
{ column = 'dominant_speed', type = 'real' },
{ column = 'speed_label', type = 'text' },
{ column = 'frequency', type = 'real' },
{ column = 'voltage', type = 'integer' },
Expand Down Expand Up @@ -564,10 +561,7 @@ function osm2pgsql.process_way(object)
end

local preferred_direction = tags['railway:preferred_direction']
local maxspeed = tags['maxspeed']
local maxspeed_forward = tags['maxspeed:forward']
local maxspeed_backward = tags['maxspeed:backward']
local dominant_speed, speed_label = dominant_speed_label(preferred_direction, maxspeed, maxspeed_forward, maxspeed_backward)
local dominant_speed, speed_label = dominant_speed_label(preferred_direction, tags['maxspeed'], tags['maxspeed:forward'], tags['maxspeed:backward'])

local way = object:as_linestring()
railway_line:insert({
Expand Down
4 changes: 2 additions & 2 deletions import/sql/tile_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ CREATE OR REPLACE VIEW railway_line_high AS
WHEN railway = 'razed' THEN 200
ELSE 50
END AS rank,
dominant_speed as maxspeed,
maxspeed,
speed_label,
train_protection_rank,
train_protection,
Expand Down Expand Up @@ -92,7 +92,7 @@ CREATE OR REPLACE VIEW railway_line_high AS
ELSE railway_label_name(name, tunnel, tunnel_name, bridge, bridge_name)
END AS label_name,
preferred_direction,
dominant_speed,
maxspeed,
speed_label,
train_protection_rank,
train_protection,
Expand Down

0 comments on commit 154c6f1

Please sign in to comment.