[WIP] Expanded road route attributes (#1620)

This PR replaces the `route_N` attribute scheme with individual attributes for name and colour on routes.  Thus you will have:
* `route_N_network` to hold the route `network` value
* `route_N_ref` to hold the route `ref` value
* `route_N_name` to hold the route `name` value
* `route_N_colour` to hold the route `colour` or `ref:colour` value
This commit is contained in:
Brian Sperlongano
2024-02-20 11:38:11 -05:00
committed by GitHub
parent ee8259ced5
commit b3c32321a3
7 changed files with 154 additions and 81 deletions

View File

@@ -51,12 +51,12 @@ CREATE TABLE IF NOT EXISTS osm_transportation_name_linestring(
layer integer,
indoor boolean,
network route_network_type,
route_1 text,
route_2 text,
route_3 text,
route_4 text,
route_5 text,
route_6 text,
route_1 hstore,
route_2 hstore,
route_3 hstore,
route_4 hstore,
route_5 hstore,
route_6 hstore,
z_order integer,
route_rank integer
);
@@ -170,12 +170,12 @@ FROM (
layer,
NULL AS indoor,
NULL AS network_type,
NULL AS route_1,
NULL AS route_2,
NULL AS route_3,
NULL AS route_4,
NULL AS route_5,
NULL AS route_6,
NULL::hstore AS route_1,
NULL::hstore AS route_2,
NULL::hstore AS route_3,
NULL::hstore AS route_4,
NULL::hstore AS route_5,
NULL::hstore AS route_6,
min(z_order) AS z_order,
NULL::int AS route_rank
FROM (
@@ -228,12 +228,12 @@ FROM (
layer,
NULL AS indoor,
NULL AS network_type,
NULL AS route_1,
NULL AS route_2,
NULL AS route_3,
NULL AS route_4,
NULL AS route_5,
NULL AS route_6,
NULL::hstore AS route_1,
NULL::hstore AS route_2,
NULL::hstore AS route_3,
NULL::hstore AS route_4,
NULL::hstore AS route_5,
NULL::hstore AS route_6,
min(z_order) AS z_order,
NULL::int AS route_rank
FROM (
@@ -276,12 +276,12 @@ CREATE TABLE IF NOT EXISTS osm_transportation_name_linestring_gen1 (
subclass text,
brunnel text,
network route_network_type,
route_1 text,
route_2 text,
route_3 text,
route_4 text,
route_5 text,
route_6 text,
route_1 hstore,
route_2 hstore,
route_3 hstore,
route_4 hstore,
route_5 hstore,
route_6 hstore,
z_order integer
);
@@ -752,13 +752,13 @@ BEGIN
CASE WHEN highway IN ('footway', 'steps') THEN layer END AS layer,
CASE WHEN highway IN ('footway', 'steps') THEN level END AS level,
CASE WHEN highway IN ('footway', 'steps') THEN indoor END AS indoor,
NULLIF(rm1.network, '') || '=' || COALESCE(rm1.ref, '') AS route_1,
NULLIF(rm2.network, '') || '=' || COALESCE(rm2.ref, '') AS route_2,
NULLIF(rm3.network, '') || '=' || COALESCE(rm3.ref, '') AS route_3,
NULLIF(rm4.network, '') || '=' || COALESCE(rm4.ref, '') AS route_4,
NULLIF(rm5.network, '') || '=' || COALESCE(rm5.ref, '') AS route_5,
NULLIF(rm6.network, '') || '=' || COALESCE(rm6.ref, '') AS route_6,
hl.z_order,
create_route_hstore(rm1.network, rm1.ref, rm1.name, rm1.colour, rm1.ref_colour) AS route_1,
create_route_hstore(rm2.network, rm2.ref, rm2.name, rm2.colour, rm2.ref_colour) AS route_2,
create_route_hstore(rm3.network, rm3.ref, rm3.name, rm3.colour, rm3.ref_colour) AS route_3,
create_route_hstore(rm4.network, rm4.ref, rm4.name, rm4.colour, rm4.ref_colour) AS route_4,
create_route_hstore(rm5.network, rm5.ref, rm5.name, rm5.colour, rm5.ref_colour) AS route_5,
create_route_hstore(rm6.network, rm6.ref, rm6.name, rm6.colour, rm6.ref_colour) AS route_6,
hl.z_order,
LEAST(rm1.rank, rm2.rank, rm3.rank, rm4.rank, rm5.rank, rm6.rank) AS route_rank
FROM osm_highway_linestring hl
JOIN transportation_name.network_changes AS c ON