kopia lustrzana https://github.com/openmaptiles/openmaptiles
Add GB primary/secondary routes (#1465)
This PR adds an additional pseudo-network for UK non-primary [routes](https://en.wikipedia.org/wiki/Great_Britain_road_numbering_scheme), which are signed with black on white signage with "A" and "B" prefixes. This scheme is described on the [OSM wiki](https://wiki.openstreetmap.org/wiki/Roads_in_the_United_Kingdom). Adding this third psuedo network is needed for generating shields for UK white/black signage for non-primary routes. Additionally, this fixes a minor bug under which single-digit refs would have been included. Single-digit refs don't exist in the UK, because the numbering scheme is always prefixed by a letter, e.g. "A4". I also included documentation updates and fixed the typo where a view was named "bg" instead of "gb".pull/1470/head^2
rodzic
af8c6883dd
commit
5f7b2c11b3
Plik binarny nie jest wyświetlany.
Przed Szerokość: | Wysokość: | Rozmiar: 538 KiB Po Szerokość: | Wysokość: | Rozmiar: 640 KiB |
|
@ -16,7 +16,7 @@ $$
|
||||||
CREATE TYPE route_network_type AS enum (
|
CREATE TYPE route_network_type AS enum (
|
||||||
'us-interstate', 'us-highway', 'us-state',
|
'us-interstate', 'us-highway', 'us-state',
|
||||||
'ca-transcanada', 'ca-provincial-arterial', 'ca-provincial',
|
'ca-transcanada', 'ca-provincial-arterial', 'ca-provincial',
|
||||||
'gb-motorway', 'gb-trunk'
|
'gb-motorway', 'gb-trunk', 'gb-primary'
|
||||||
);
|
);
|
||||||
END
|
END
|
||||||
$$;
|
$$;
|
||||||
|
|
|
@ -1,23 +1,27 @@
|
||||||
CREATE TABLE IF NOT EXISTS ne_10m_admin_0_bg_buffer AS
|
CREATE TABLE IF NOT EXISTS ne_10m_admin_0_gb_buffer AS
|
||||||
SELECT ST_Buffer(geometry, 10000)
|
SELECT ST_Buffer(geometry, 10000)
|
||||||
FROM ne_10m_admin_0_countries
|
FROM ne_10m_admin_0_countries
|
||||||
WHERE iso_a2 = 'GB';
|
WHERE iso_a2 = 'GB';
|
||||||
|
|
||||||
|
-- etldoc: osm_route_member -> gbr_route_members_view
|
||||||
CREATE OR REPLACE VIEW gbr_route_members_view AS
|
CREATE OR REPLACE VIEW gbr_route_members_view AS
|
||||||
SELECT 0,
|
SELECT 0,
|
||||||
osm_id,
|
osm_id,
|
||||||
substring(ref FROM E'^[AM][0-9AM()]+'),
|
substring(ref FROM E'^[ABM][0-9ABM()]+'),
|
||||||
CASE WHEN highway = 'motorway' THEN 'omt-gb-motorway' ELSE 'omt-gb-trunk' END
|
-- See https://wiki.openstreetmap.org/wiki/Roads_in_the_United_Kingdom
|
||||||
|
CASE WHEN highway = 'motorway' THEN 'omt-gb-motorway'
|
||||||
|
WHEN highway = 'trunk' THEN 'omt-gb-trunk'
|
||||||
|
WHEN highway IN ('primary','secondary') THEN 'omt-gb-primary' END AS network
|
||||||
FROM osm_highway_linestring
|
FROM osm_highway_linestring
|
||||||
WHERE length(ref) > 0
|
WHERE length(ref) > 1
|
||||||
AND ST_Intersects(geometry, (SELECT * FROM ne_10m_admin_0_bg_buffer))
|
AND ST_Intersects(geometry, (SELECT * FROM ne_10m_admin_0_gb_buffer))
|
||||||
AND highway IN ('motorway', 'trunk')
|
AND highway IN ('motorway', 'trunk', 'primary', 'secondary')
|
||||||
;
|
;
|
||||||
-- Create GBR relations (so we can use it in the same way as other relations)
|
-- Create GBR relations (so we can use it in the same way as other relations)
|
||||||
DELETE
|
DELETE
|
||||||
FROM osm_route_member
|
FROM osm_route_member
|
||||||
WHERE network IN ('omt-gb-motorway', 'omt-gb-trunk');
|
WHERE network IN ('omt-gb-motorway', 'omt-gb-trunk', 'omt-gb-primary');
|
||||||
-- etldoc: osm_highway_linestring -> osm_route_member
|
-- etldoc: gbr_route_members_view -> osm_route_member
|
||||||
INSERT INTO osm_route_member (osm_id, member, ref, network)
|
INSERT INTO osm_route_member (osm_id, member, ref, network)
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM gbr_route_members_view;
|
FROM gbr_route_members_view;
|
||||||
|
@ -43,6 +47,7 @@ SELECT CASE
|
||||||
WHEN network LIKE 'CA:__' OR network LIKE 'CA:__:%' THEN 'ca-provincial'::route_network_type
|
WHEN network LIKE 'CA:__' OR network LIKE 'CA:__:%' THEN 'ca-provincial'::route_network_type
|
||||||
WHEN network = 'omt-gb-motorway' THEN 'gb-motorway'::route_network_type
|
WHEN network = 'omt-gb-motorway' THEN 'gb-motorway'::route_network_type
|
||||||
WHEN network = 'omt-gb-trunk' THEN 'gb-trunk'::route_network_type
|
WHEN network = 'omt-gb-trunk' THEN 'gb-trunk'::route_network_type
|
||||||
|
WHEN network = 'omt-gb-primary' THEN 'gb-primary'::route_network_type
|
||||||
END;
|
END;
|
||||||
$$ LANGUAGE sql IMMUTABLE
|
$$ LANGUAGE sql IMMUTABLE
|
||||||
PARALLEL SAFE;
|
PARALLEL SAFE;
|
||||||
|
@ -62,7 +67,7 @@ BEGIN
|
||||||
FROM osm_route_member AS r
|
FROM osm_route_member AS r
|
||||||
USING
|
USING
|
||||||
transportation_name.network_changes AS c
|
transportation_name.network_changes AS c
|
||||||
WHERE network IN ('omt-gb-motorway', 'omt-gb-trunk')
|
WHERE network IN ('omt-gb-motorway', 'omt-gb-trunk', 'omt-gb-primary')
|
||||||
AND r.osm_id = c.osm_id;
|
AND r.osm_id = c.osm_id;
|
||||||
|
|
||||||
INSERT INTO osm_route_member (osm_id, member, ref, network)
|
INSERT INTO osm_route_member (osm_id, member, ref, network)
|
||||||
|
|
|
@ -32,6 +32,7 @@ layer:
|
||||||
- ca-provincial
|
- ca-provincial
|
||||||
- gb-motorway
|
- gb-motorway
|
||||||
- gb-trunk
|
- gb-trunk
|
||||||
|
- gb-primary
|
||||||
- road (default)
|
- road (default)
|
||||||
class:
|
class:
|
||||||
description: |
|
description: |
|
||||||
|
|
Ładowanie…
Reference in New Issue