Porównaj commity

...

4 Commity

Autor SHA1 Wiadomość Data
tompohys@gmail.com 05df279032 For z12-13 used LineLabel (ref, name). 2024-03-20 18:07:28 +01:00
tompohys@gmail.com 14387ce666 Do not group roads by z_order for genX (z6-11). 2024-03-20 18:06:04 +01:00
Tomas Pohanka f95feabe2c
Merge branch 'master' into zlw-defrag-streets 2024-03-20 10:00:18 +01:00
Adam Laža 136e1db4d1
Fix maritime low zooms (#1644)
This PR fixes boundary layer at low zoom levels:

-z4 - remove maritime boundary (Peru, northern and southern end of boundary between Canada and Alaska).
-z1-z4 - do not mix disputed boundary from NE and OSM - linestrings got duplicated. Use only NE data (z0-z4), then OSM data (z5+)
2024-03-18 13:23:38 +01:00
4 zmienionych plików z 23 dodań i 81 usunięć

Wyświetl plik

@ -150,38 +150,10 @@ CREATE MATERIALIZED VIEW osm_border_linestring_gen_z4 AS
(
SELECT ST_Simplify(geometry, ZRes(5)) AS geometry, adm0_l, adm0_r, admin_level, disputed, name, claimed_by, maritime
FROM osm_border_linestring_gen_z5
WHERE admin_level = 2 AND (maritime OR disputed)
WHERE admin_level = 2 AND maritime
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS osm_border_linestring_gen_z4_idx ON osm_border_linestring_gen_z4 USING gist (geometry);
-- etldoc: osm_border_linestring_gen_z4 -> osm_border_disp_linestring_gen_z3
DROP MATERIALIZED VIEW IF EXISTS osm_border_disp_linestring_gen_z3 CASCADE;
CREATE MATERIALIZED VIEW osm_border_disp_linestring_gen_z3 AS
(
SELECT ST_Simplify(geometry, ZRes(4)) AS geometry, adm0_l, adm0_r, admin_level, TRUE AS disputed, name, claimed_by, maritime
FROM osm_border_linestring_gen_z4
WHERE disputed -- AND admin_level = 2
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS osm_border_disp_linestring_gen_z3_idx ON osm_border_disp_linestring_gen_z3 USING gist (geometry);
-- etldoc: osm_border_disp_linestring_gen_z3 -> osm_border_disp_linestring_gen_z2
DROP MATERIALIZED VIEW IF EXISTS osm_border_disp_linestring_gen_z2 CASCADE;
CREATE MATERIALIZED VIEW osm_border_disp_linestring_gen_z2 AS
(
SELECT ST_Simplify(geometry, ZRes(3)) AS geometry, adm0_l, adm0_r, admin_level, TRUE AS disputed, name, claimed_by, maritime
FROM osm_border_disp_linestring_gen_z3
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS osm_border_disp_linestring_gen_z2_idx ON osm_border_disp_linestring_gen_z2 USING gist (geometry);
-- etldoc: osm_border_disp_linestring_gen_z2 -> osm_border_disp_linestring_gen_z1
DROP MATERIALIZED VIEW IF EXISTS osm_border_disp_linestring_gen_z1 CASCADE;
CREATE MATERIALIZED VIEW osm_border_disp_linestring_gen_z1 AS
(
SELECT ST_Simplify(geometry, ZRes(2)) AS geometry, adm0_l, adm0_r, admin_level, TRUE AS disputed, name, claimed_by, maritime
FROM osm_border_disp_linestring_gen_z2
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS osm_border_disp_linestring_gen_z1_idx ON osm_border_disp_linestring_gen_z1 USING gist (geometry);
-- ne_10m_admin_0_boundary_lines_land
-- etldoc: ne_10m_admin_0_boundary_lines_land -> ne_10m_admin_0_boundary_lines_land_gen_z4
DROP MATERIALIZED VIEW IF EXISTS ne_10m_admin_0_boundary_lines_land_gen_z4 CASCADE;
@ -370,16 +342,6 @@ SELECT geometry,
claimed_by,
maritime
FROM ne_10m_admin_1_states_provinces_lines_gen_z1
UNION ALL
SELECT geometry,
admin_level,
NULL::text AS adm0_l,
NULL::text AS adm0_r,
TRUE AS disputed,
edit_name(name) AS disputed_name,
claimed_by,
maritime
FROM osm_border_disp_linestring_gen_z1
);
CREATE INDEX IF NOT EXISTS boundary_z1_idx ON boundary_z1 USING gist (geometry);
@ -409,16 +371,6 @@ SELECT geometry,
claimed_by,
maritime
FROM ne_10m_admin_1_states_provinces_lines_gen_z2
UNION ALL
SELECT geometry,
admin_level,
NULL::text AS adm0_l,
NULL::text AS adm0_r,
TRUE AS disputed,
edit_name(name) AS disputed_name,
claimed_by,
maritime
FROM osm_border_disp_linestring_gen_z2
);
CREATE INDEX IF NOT EXISTS boundary_z2_idx ON boundary_z2 USING gist (geometry);
@ -447,16 +399,6 @@ SELECT geometry,
claimed_by,
maritime
FROM ne_10m_admin_1_states_provinces_lines_gen_z3
UNION ALL
SELECT geometry,
admin_level,
NULL::text AS adm0_l,
NULL::text AS adm0_r,
TRUE AS disputed,
edit_name(name) AS disputed_name,
claimed_by,
maritime
FROM osm_border_disp_linestring_gen_z3
);
CREATE INDEX IF NOT EXISTS boundary_z3_idx ON boundary_z3 USING gist (geometry);

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 910 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 759 KiB

Wyświetl plik

@ -204,7 +204,7 @@ FROM (
indoor
FROM osm_transportation_name_linestring
WHERE zoom_level = 12
AND LineLabel(zoom_level, COALESCE(tags->'name', ref), geometry)
AND LineLabel(zoom_level, COALESCE(ref, tags->'name'), geometry)
AND NOT highway_is_link(highway)
AND
CASE WHEN highway_class(highway, NULL::text, NULL::text) NOT IN ('path', 'minor') THEN TRUE
@ -228,7 +228,7 @@ FROM (
indoor
FROM osm_transportation_name_linestring
WHERE zoom_level = 13
AND LineLabel(zoom_level, COALESCE(tags->'name', ref), geometry)
AND LineLabel(zoom_level, COALESCE(ref, tags->'name'), geometry)
AND
CASE WHEN highway <> 'path' THEN TRUE
WHEN highway = 'path' AND (

Wyświetl plik

@ -426,17 +426,17 @@ BEGIN
-- etldoc: osm_transportation_name_linestring -> osm_transportation_name_linestring_gen1
INSERT INTO osm_transportation_name_linestring_gen1 (id, geometry, tags, ref, highway, subclass, brunnel, network,
route_1, route_2, route_3, route_4, route_5, route_6, z_order)
route_1, route_2, route_3, route_4, route_5, route_6)
SELECT MIN(id) as id,
ST_Simplify(ST_LineMerge(ST_Collect(geometry)), 50) AS geometry,
tags, ref, highway, subclass, brunnel, network,
route_1, route_2, route_3, route_4, route_5, route_6, z_order
route_1, route_2, route_3, route_4, route_5, route_6
FROM (
SELECT id,
geometry,
tags, ref, highway, subclass,
visible_text(geometry, brunnel, 9) AS brunnel,
network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
network, route_1, route_2, route_3, route_4, route_5, route_6
FROM osm_transportation_name_linestring
) osm_transportation_name_linestring_gen1_pre_merge
WHERE (
@ -449,12 +449,12 @@ BEGIN
) AND (
(highway IN ('motorway', 'trunk') OR highway = 'construction' AND subclass IN ('motorway', 'trunk'))
)
GROUP BY tags, ref, highway, subclass, brunnel, network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
GROUP BY tags, ref, highway, subclass, brunnel, network, route_1, route_2, route_3, route_4, route_5, route_6
ON CONFLICT (id) DO UPDATE SET geometry = excluded.geometry, tags = excluded.tags, ref = excluded.ref,
highway = excluded.highway, subclass = excluded.subclass,
brunnel = excluded.brunnel, network = excluded.network, route_1 = excluded.route_1,
route_2 = excluded.route_2, route_3 = excluded.route_3, route_4 = excluded.route_4,
route_5 = excluded.route_5, route_6 = excluded.route_6, z_order = excluded.z_order;
route_5 = excluded.route_5, route_6 = excluded.route_6;
-- Analyze source table
ANALYZE osm_transportation_name_linestring_gen1;
@ -469,17 +469,17 @@ BEGIN
-- etldoc: osm_transportation_name_linestring_gen1 -> osm_transportation_name_linestring_gen2
INSERT INTO osm_transportation_name_linestring_gen2 (id, geometry, tags, ref, highway, subclass, brunnel, network,
route_1, route_2, route_3, route_4, route_5, route_6, z_order)
route_1, route_2, route_3, route_4, route_5, route_6)
SELECT MIN(id) as id,
ST_Simplify(ST_LineMerge(ST_Collect(geometry)), 120) AS geometry,
tags, ref, highway, subclass, brunnel, network,
route_1, route_2, route_3, route_4, route_5, route_6, z_order
route_1, route_2, route_3, route_4, route_5, route_6
FROM (
SELECT id,
(ST_Dump(geometry)).geom AS geometry,
tags, ref, highway, subclass,
visible_text(geometry, brunnel, 8) AS brunnel,
network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
network, route_1, route_2, route_3, route_4, route_5, route_6
FROM osm_transportation_name_linestring_gen1
) osm_transportation_name_linestring_gen2_pre_merge
WHERE (
@ -492,12 +492,12 @@ BEGIN
) AND (
(highway IN ('motorway', 'trunk') OR highway = 'construction' AND subclass IN ('motorway', 'trunk'))
)
GROUP BY tags, ref, highway, subclass, brunnel, network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
GROUP BY tags, ref, highway, subclass, brunnel, network, route_1, route_2, route_3, route_4, route_5, route_6
ON CONFLICT (id) DO UPDATE SET geometry = excluded.geometry, tags = excluded.tags, ref = excluded.ref,
highway = excluded.highway, subclass = excluded.subclass,
brunnel = excluded.brunnel, network = excluded.network, route_1 = excluded.route_1,
route_2 = excluded.route_2, route_3 = excluded.route_3, route_4 = excluded.route_4,
route_5 = excluded.route_5, route_6 = excluded.route_6, z_order = excluded.z_order;
route_5 = excluded.route_5, route_6 = excluded.route_6;
-- Analyze source table
ANALYZE osm_transportation_name_linestring_gen2;
@ -512,17 +512,17 @@ BEGIN
-- etldoc: osm_transportation_name_linestring_gen2 -> osm_transportation_name_linestring_gen3
INSERT INTO osm_transportation_name_linestring_gen3 (id, geometry, tags, ref, highway, subclass, brunnel, network,
route_1, route_2, route_3, route_4, route_5, route_6, z_order)
route_1, route_2, route_3, route_4, route_5, route_6)
SELECT MIN(id) as id,
ST_Simplify(ST_LineMerge(ST_Collect(geometry)), 200) AS geometry,
tags, ref, highway, subclass, brunnel, network,
route_1, route_2, route_3, route_4, route_5, route_6, z_order
route_1, route_2, route_3, route_4, route_5, route_6
FROM (
SELECT id,
(ST_Dump(geometry)).geom AS geometry,
tags, ref, highway, subclass,
visible_text(geometry, brunnel, 7) AS brunnel,
network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
network, route_1, route_2, route_3, route_4, route_5, route_6
FROM osm_transportation_name_linestring_gen2
) osm_transportation_name_linestring_gen3_pre_merge
WHERE (
@ -535,12 +535,12 @@ BEGIN
) AND (
(highway = 'motorway' OR highway = 'construction' AND subclass = 'motorway')
)
GROUP BY tags, ref, highway, subclass, brunnel, network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
GROUP BY tags, ref, highway, subclass, brunnel, network, route_1, route_2, route_3, route_4, route_5, route_6
ON CONFLICT (id) DO UPDATE SET geometry = excluded.geometry, tags = excluded.tags, ref = excluded.ref,
highway = excluded.highway, subclass = excluded.subclass,
brunnel = excluded.brunnel, network = excluded.network, route_1 = excluded.route_1,
route_2 = excluded.route_2, route_3 = excluded.route_3, route_4 = excluded.route_4,
route_5 = excluded.route_5, route_6 = excluded.route_6, z_order = excluded.z_order;
route_5 = excluded.route_5, route_6 = excluded.route_6;
-- Analyze source table
ANALYZE osm_transportation_name_linestring_gen3;
@ -555,17 +555,17 @@ BEGIN
-- etldoc: osm_transportation_name_linestring_gen3 -> osm_transportation_name_linestring_gen4
INSERT INTO osm_transportation_name_linestring_gen4 (id, geometry, tags, ref, highway, subclass, brunnel, network,
route_1, route_2, route_3, route_4, route_5, route_6, z_order)
route_1, route_2, route_3, route_4, route_5, route_6)
SELECT MIN(id) as id,
ST_Simplify(ST_LineMerge(ST_Collect(geometry)), 500) AS geometry,
tags, ref, highway, subclass, brunnel, network,
route_1, route_2, route_3, route_4, route_5, route_6, z_order
route_1, route_2, route_3, route_4, route_5, route_6
FROM (
SELECT id,
(ST_Dump(geometry)).geom AS geometry,
tags, ref, highway, subclass,
visible_text(geometry, brunnel, 6) AS brunnel,
network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
network, route_1, route_2, route_3, route_4, route_5, route_6
FROM osm_transportation_name_linestring_gen3
) osm_transportation_name_linestring_gen4_pre_merge
WHERE (
@ -579,12 +579,12 @@ BEGIN
ST_Length(geometry) > 20000 AND
(highway = 'motorway' OR highway = 'construction' AND subclass = 'motorway')
)
GROUP BY tags, ref, highway, subclass, brunnel, network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
GROUP BY tags, ref, highway, subclass, brunnel, network, route_1, route_2, route_3, route_4, route_5, route_6
ON CONFLICT (id) DO UPDATE SET geometry = excluded.geometry, tags = excluded.tags, ref = excluded.ref,
highway = excluded.highway, subclass = excluded.subclass,
brunnel = excluded.brunnel, network = excluded.network, route_1 = excluded.route_1,
route_2 = excluded.route_2, route_3 = excluded.route_3, route_4 = excluded.route_4,
route_5 = excluded.route_5, route_6 = excluded.route_6, z_order = excluded.z_order;
route_5 = excluded.route_5, route_6 = excluded.route_6;
-- noinspection SqlWithoutWhere
DELETE FROM transportation_name.name_changes_gen;