Porównaj commity

...

12 Commity

Autor SHA1 Wiadomość Data
Christopher Beddow 565f1bb5a7
Merge aeb78a8476 into eae7d7e1ed 2024-04-18 13:10:07 +02:00
Tomas Pohanka eae7d7e1ed
Documentation update. (#1654)
- Unifying `name_de` description for `mountain_peak` layer.
- Update the version of PostGIS for `generate-sqltomvt` function.
2024-04-03 15:26:59 +02:00
Tomas Pohanka 382b12ae8a
Drop osm_transportation_name_network table before recreation. (#1653)
Drop the main table for layer `transportation_name` layer before creation.

For the first SQL import, it is OK, but for the second import (e.g. for a different country by `import-osm area=yyy`) without dropping the whole database it will keep `osm_transportation_name_network` filled with data from the first import (after first `import-sql` step)

This PR will drop the already-filled table from the first import and insert data from the reimported area.
2024-04-03 13:43:28 +02:00
Tomas Pohanka 59692656bd
Preserving the highway network in Canada for z4. (#1652)
This PR reverts important Canada TransCanada road to zoom 4.

At zoom 4, the network `gb-trunk` is too dense, so it is moved to zoom 5+.
2024-04-02 14:22:37 +02:00
Tomas Pohanka ee19519905
Add network for GBR and IRL. (#1649)
Fix a missing e-road relation for the United Kingdom and Ireland.
2024-04-02 11:08:50 +02:00
Tomas Pohanka 8266197149
Revert `e-road` and `a-road`. (#1648)
Partial revert the `e-road` and `a-road` added in https://github.com/openmaptiles/openmaptiles/pull/1619.

This PR leads to breaking the change of `network` and `ref` attributes for roads, which are not included in `osm_route_member_network_type`.
2024-04-02 10:09:20 +02:00
zstadler 3f0ba7ceba
Replace `["geometry-type"]` with `"$type"` (#1646)
Related to https://github.com/maplibre/maplibre-style-spec/pull/519 and https://github.com/maplibre/maplibre-gl-js/issues/3516

According to the Style Spec, `["geometry-type"]` is expected to distinguish between LineString and MultiLineString, while `"$type"` does not. For the transportation layer, the distinction is harmful.

All of OMT style layers, except these two, use `"$type"`.
2024-03-28 10:52:38 +01:00
Adam Laža c2ae2503c8
Fix borders z0-z4 (#1647)
This PR fixes two things:
- remove disputed name like `ne_*m_ogc_fid` from lines
- use South Sudan disputed boundary from `ne_10m_admin_0_boundary_lines_land_disputed` so there is no gap.
2024-03-27 13:56:23 +01:00
Tomas Pohanka d709a51de6
Salt pond with class `pond` (#1645)
The salt pond is now under the class `lake`, this PR moves it into class `pond`.
2024-03-21 15:58:58 +01:00
Brian Sperlongano af6dc684ef
Reduce transportation_name segmentation (#1643)
This PR reduces transportation_name layer fragmentation by ensuring the short brunnel segments are merged rather than dropped from view.

---------

Co-authored-by: Tomas Pohanka <TomPohys@gmail.com>
2024-03-21 08:08:56 +01:00
Tomas Pohanka aeb78a8476
Merge branch 'master' into parking 2023-12-28 06:56:49 +01:00
Christopher Beddow 69ab451984 fix: add parking to landuse as amenity 2022-10-15 10:43:58 +02:00
13 zmienionych plików z 131 dodań i 83 usunięć

Wyświetl plik

@ -289,7 +289,7 @@ ifeq (,$(wildcard build/sql/run_last.sql))
$(DOCKER_COMPOSE) run $(DC_OPTS) openmaptiles-tools bash -c \
'generate-sql $(TILESET_FILE) --dir ./build/sql \
&& generate-sqltomvt $(TILESET_FILE) \
--key --gzip --postgis-ver 3.2.3 \
--key --gzip --postgis-ver 3.3.4 \
--function --fname=getmvt >> ./build/sql/run_last.sql'
endif

Wyświetl plik

@ -162,7 +162,7 @@ CREATE MATERIALIZED VIEW ne_10m_admin_0_boundary_lines_land_gen_z4 AS
SELECT ST_Simplify(geometry, ZRes(6)) as geometry,
2 AS admin_level,
(CASE WHEN featurecla LIKE 'Disputed%' THEN TRUE ELSE FALSE END) AS disputed,
(CASE WHEN featurecla LIKE 'Disputed%' THEN 'ne10m_' || ogc_fid ELSE NULL::text END) AS disputed_name,
NULL::text AS disputed_name,
NULL::text AS claimed_by,
FALSE AS maritime
FROM ne_10m_admin_0_boundary_lines_land
@ -170,6 +170,21 @@ WHERE featurecla <> 'Lease limit'
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_10m_admin_0_boundary_lines_land_gen_z4_idx ON ne_10m_admin_0_boundary_lines_land_gen_z4 USING gist (geometry);
-- etldoc: ne_10m_admin_0_boundary_lines_land -> ne_10m_admin_0_boundary_lines_land_disputed
DROP MATERIALIZED VIEW IF EXISTS ne_10m_admin_0_boundary_lines_land_disputed CASCADE;
CREATE MATERIALIZED VIEW ne_10m_admin_0_boundary_lines_land_disputed AS
(
SELECT geometry,
2 AS admin_level,
(CASE WHEN featurecla LIKE 'Disputed%' THEN TRUE ELSE FALSE END) AS disputed,
NULL::text AS disputed_name,
NULL::text AS claimed_by,
FALSE AS maritime
FROM ne_10m_admin_0_boundary_lines_land
WHERE featurecla LIKE 'Disputed%' AND adm0_left = 'South Sudan' AND adm0_right = 'Kenya'
) /* DELAY_MATERIALIZED_VIEW_CREATION */ ;
CREATE INDEX IF NOT EXISTS ne_10m_admin_0_boundary_lines_land_disputed_idx ON ne_10m_admin_0_boundary_lines_land_disputed USING gist (geometry);
-- ne_10m_admin_1_states_provinces_lines
-- etldoc: ne_10m_admin_1_states_provinces_lines -> ne_10m_admin_1_states_provinces_lines_gen_z4
DROP MATERIALIZED VIEW IF EXISTS ne_10m_admin_1_states_provinces_lines_gen_z4 CASCADE;
@ -239,7 +254,7 @@ CREATE MATERIALIZED VIEW ne_50m_admin_0_boundary_lines_land_gen_z3 AS
SELECT ST_Simplify(geometry, ZRes(5)) as geometry,
2 AS admin_level,
(CASE WHEN featurecla LIKE 'Disputed%' THEN TRUE ELSE FALSE END) AS disputed,
(CASE WHEN featurecla LIKE 'Disputed%' THEN 'ne50m_' || ogc_fid ELSE NULL::text END) AS disputed_name,
NULL::text AS disputed_name,
NULL::text AS claimed_by,
FALSE AS maritime
FROM ne_50m_admin_0_boundary_lines_land
@ -282,7 +297,7 @@ CREATE MATERIALIZED VIEW ne_110m_admin_0_boundary_lines_land_gen_z0 AS
SELECT ST_Simplify(geometry, ZRes(2)) as geometry,
2 AS admin_level,
(CASE WHEN featurecla LIKE 'Disputed%' THEN TRUE ELSE FALSE END) AS disputed,
(CASE WHEN featurecla LIKE 'Disputed%' THEN 'ne110m_' || ogc_fid ELSE NULL::text END) AS disputed_name,
NULL::text AS disputed_name,
NULL::text AS claimed_by,
FALSE AS maritime
FROM ne_110m_admin_0_boundary_lines_land
@ -319,6 +334,7 @@ FROM ne_110m_admin_0_boundary_lines_land_gen_z0
-- etldoc: ne_50m_admin_0_boundary_lines_land_gen_z1 -> boundary_z1
-- etldoc: ne_10m_admin_1_states_provinces_lines_gen_z1 -> boundary_z1
-- etldoc: ne_10m_admin_0_boundary_lines_land_disputed -> boundary_z1
-- etldoc: osm_border_disp_linestring_gen_z1 -> boundary_z1
DROP MATERIALIZED VIEW IF EXISTS boundary_z1 CASCADE;
CREATE MATERIALIZED VIEW boundary_z1 AS
@ -342,12 +358,23 @@ 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,
disputed,
disputed_name,
claimed_by,
maritime
FROM ne_10m_admin_0_boundary_lines_land_disputed
);
CREATE INDEX IF NOT EXISTS boundary_z1_idx ON boundary_z1 USING gist (geometry);
-- etldoc: ne_50m_admin_0_boundary_lines_land_gen_z2 -> boundary_z2
-- etldoc: ne_10m_admin_1_states_provinces_lines_gen_z2 -> boundary_z2
-- etldoc: ne_10m_admin_0_boundary_lines_land_disputed -> boundary_z2
-- etldoc: osm_border_disp_linestring_gen_z2 -> boundary_z2
DROP MATERIALIZED VIEW IF EXISTS boundary_z2 CASCADE;
CREATE MATERIALIZED VIEW boundary_z2 AS
@ -371,11 +398,22 @@ 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,
disputed,
disputed_name,
claimed_by,
maritime
FROM ne_10m_admin_0_boundary_lines_land_disputed
);
CREATE INDEX IF NOT EXISTS boundary_z2_idx ON boundary_z2 USING gist (geometry);
-- etldoc: ne_50m_admin_0_boundary_lines_land_gen_z3 -> boundary_z3
-- etldoc: ne_10m_admin_1_states_provinces_lines_gen_z3 -> boundary_z3
-- etldoc: ne_10m_admin_0_boundary_lines_land_disputed -> boundary_z3
-- etldoc: osm_border_disp_linestring_gen_z3 -> boundary_z3
DROP MATERIALIZED VIEW IF EXISTS boundary_z3 CASCADE;
CREATE MATERIALIZED VIEW boundary_z3 AS
@ -399,6 +437,16 @@ 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,
disputed,
disputed_name,
claimed_by,
maritime
FROM ne_10m_admin_0_boundary_lines_land_disputed
);
CREATE INDEX IF NOT EXISTS boundary_z3_idx ON boundary_z3 USING gist (geometry);

Plik binarny nie jest wyświetlany.

Przed

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

Po

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

Wyświetl plik

@ -45,6 +45,7 @@ layer:
- neighbourhood
- dam
- quarry
- parking
datasource:
geometry_field: geometry
query: (SELECT geometry, class FROM layer_landuse(!bbox!, z(!scale_denominator!))) AS t

Wyświetl plik

@ -90,6 +90,7 @@ tables:
- library
- hospital
- grave_yard
- parking
leisure:
- stadium
- pitch

Wyświetl plik

@ -10,7 +10,7 @@ layer:
fields:
name: The OSM [`name`](http://wiki.openstreetmap.org/wiki/Key:name) value of the peak. Language-specific values are in `name:xx`.
name_en: English name `name:en` if available, otherwise `name`. This is deprecated and will be removed in a future release in favor of `name:en`.
name_de: German name `name:de` if available, otherwise `name` or `name:en`.
name_de: German name `name:de` if available, otherwise `name` or `name:en`. This is deprecated and will be removed in a future release in favor of `name:de`.
class:
description: |
Use the **class** to differentiate between natural objects.

Plik binarny nie jest wyświetlany.

Przed

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

Po

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

Wyświetl plik

@ -4529,9 +4529,7 @@
"all",
[
"==",
[
"geometry-type"
],
"$type",
"LineString"
],
[
@ -4633,9 +4631,7 @@
"all",
[
"==",
[
"geometry-type"
],
"$type",
"LineString"
],
[
@ -7834,4 +7830,4 @@
"order": 183
}
]
}
}

Wyświetl plik

@ -48,10 +48,6 @@ WHERE length(ref) > 1
CREATE OR REPLACE FUNCTION osm_route_member_network_type(network text, ref text) RETURNS route_network_type AS
$$
SELECT CASE
-- https://wiki.openstreetmap.org/wiki/WikiProject_Europe/E-road_network
WHEN network = 'e-road' THEN 'e-road'::route_network_type
-- https://wiki.openstreetmap.org/wiki/Asia/Asian_Highway_Network
WHEN network = 'AsianHighway' THEN 'a-road'::route_network_type
-- https://wiki.openstreetmap.org/wiki/United_States_roads_tagging
WHEN network = 'US:I' THEN 'us-interstate'::route_network_type
WHEN network = 'US:US' THEN 'us-highway'::route_network_type
@ -110,35 +106,6 @@ BEGIN
USING transportation_name.network_changes c
WHERE c.is_old IS TRUE AND transportation_route_member_coalesced.member = c.osm_id;
-- Create GBR/IRE relations (so we can use it in the same way as other relations)
-- etldoc: gbr_route_members_view -> transportation_route_member_coalesced
INSERT INTO transportation_route_member_coalesced (member, network, ref, network_type, concurrency_index, osm_id)
SELECT member, network, coalesce(ref, '') AS ref,
osm_route_member_network_type(network, coalesce(ref, '')) AS network_type,
1 AS concurrency_index, 0 AS osm_id
FROM gbr_route_members_view
WHERE full_update OR EXISTS(
SELECT NULL
FROM transportation_name.network_changes c
WHERE c.is_old IS FALSE AND c.osm_id = gbr_route_members_view.member
)
GROUP BY member, network, coalesce(ref, '')
ON CONFLICT (member, network, ref) DO NOTHING;
-- etldoc: ire_route_members_view -> transportation_route_member_coalesced
INSERT INTO transportation_route_member_coalesced (member, network, ref, network_type, concurrency_index, osm_id)
SELECT member, network, coalesce(ref, '') AS ref,
osm_route_member_network_type(network, coalesce(ref, '')) AS network_type,
1 AS concurrency_index, 0 AS osm_id
FROM ire_route_members_view
WHERE full_update OR EXISTS(
SELECT NULL
FROM transportation_name.network_changes c
WHERE c.is_old IS FALSE AND c.osm_id = ire_route_members_view.member
)
GROUP BY member, network, coalesce(ref, '')
ON CONFLICT (member, network, ref) DO NOTHING;
-- etldoc: osm_route_member -> transportation_route_member_coalesced
INSERT INTO transportation_route_member_coalesced
SELECT
@ -155,11 +122,13 @@ BEGIN
END AS rank
FROM (
-- etldoc: osm_route_member -> osm_route_member
-- etldoc: gbr_route_members_view -> osm_route_member
-- etldoc: ire_route_members_view -> osm_route_member
-- see http://wiki.openstreetmap.org/wiki/Relation:route#Road_routes
SELECT DISTINCT ON (member, COALESCE(network, ''), COALESCE(ref, ''))
member,
COALESCE(network, '') AS network,
COALESCE(ref, '') AS ref,
SELECT DISTINCT ON (member, COALESCE(rel.network, ''), COALESCE(rel.ref, ''))
rel.member,
COALESCE(NULLIF(rel.network,''), gb_way.network, ir_way.network, '') AS network,
COALESCE(rel.ref, '') AS ref,
osm_id,
role,
type,
@ -167,11 +136,13 @@ BEGIN
osmc_symbol,
colour,
ref_colour
FROM osm_route_member
FROM osm_route_member rel
LEFT JOIN gbr_route_members_view gb_way ON (gb_way.member=rel.member)
LEFT JOIN ire_route_members_view ir_way ON (ir_way.member=rel.member)
WHERE full_update OR EXISTS(
SELECT NULL
FROM transportation_name.network_changes c
WHERE c.is_old IS FALSE AND c.osm_id = osm_route_member.member
WHERE c.is_old IS FALSE AND c.osm_id = rel.member
)
) osm_route_member_filtered
ON CONFLICT (member, network, ref) DO UPDATE SET osm_id = EXCLUDED.osm_id, role = EXCLUDED.role,

Wyświetl plik

@ -42,6 +42,23 @@ SELECT
$$ LANGUAGE SQL IMMUTABLE
PARALLEL SAFE;
-- Determine whether a segment is long enough to have an attribute
CREATE OR REPLACE FUNCTION visible_text(g geometry, attr text, zoom_level integer)
RETURNS text AS
$$
SELECT
CASE WHEN
-- Width of a tile in meters (111,842 is the length of one degree of latitude at the equator in meters)
-- 111,842 * 180 / 2^zoom_level
-- = 20131560 / POW(2, zoom_level)
-- Drop brunnel if length of way < 2% of tile width (less than 3 pixels)
ST_Length(g) *
COS(RADIANS(ST_Y(ST_Centroid(ST_Transform(g, 4326))))) *
POW(2, zoom_level) / 20131560 > 0.02
THEN attr END
$$ LANGUAGE SQL IMMUTABLE
PARALLEL SAFE;
-- Instead of using relations to find out the road names we
-- stitch together the touching ways with the same name
-- to allow for nice label rendering
@ -49,7 +66,8 @@ $$ LANGUAGE SQL IMMUTABLE
-- etldoc: osm_highway_linestring -> osm_transportation_name_network
-- etldoc: transportation_route_member_coalesced -> osm_transportation_name_network
CREATE TABLE IF NOT EXISTS osm_transportation_name_network AS
DROP TABLE IF EXISTS osm_transportation_name_network;
CREATE TABLE osm_transportation_name_network AS
SELECT
geometry,
osm_id,
@ -807,7 +825,9 @@ BEGIN
WHERE transportation.changes_z4_z5_z6_z7.is_old IS FALSE AND
transportation.changes_z4_z5_z6_z7.id = osm_transportation_merge_linestring_gen_z5.id
)) AND
(highway = 'motorway' AND osm_national_network(network)
(highway = 'motorway' OR construction = 'motorway'
) OR
(osm_national_network(network) AND network != 'gb-trunk'
) AND
-- Current view: national-importance motorways and trunks
ST_Length(geometry) > 1000

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,
CASE WHEN ST_Length(geometry) > 8000 THEN brunnel ELSE '' END AS brunnel,
network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
visible_text(geometry, brunnel, 9) AS brunnel,
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,
CASE WHEN ST_Length(geometry) > 14000 THEN brunnel ELSE '' END AS brunnel,
network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
visible_text(geometry, brunnel, 8) AS brunnel,
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,
CASE WHEN ST_Length(geometry) > 20000 THEN brunnel ELSE '' END AS brunnel,
network, route_1, route_2, route_3, route_4, route_5, route_6, z_order
visible_text(geometry, brunnel, 7) AS brunnel,
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,25 +555,36 @@ 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)
SELECT id, ST_Simplify(geometry, 500) AS geometry, tags, ref, highway, subclass, brunnel, network, route_1, route_2,
route_3, route_4, route_5, route_6, z_order
FROM osm_transportation_name_linestring_gen3
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
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
FROM osm_transportation_name_linestring_gen3
) osm_transportation_name_linestring_gen4_pre_merge
WHERE (
full_update IS TRUE OR EXISTS (
SELECT NULL
FROM transportation_name.name_changes_gen
WHERE transportation_name.name_changes_gen.is_old IS FALSE AND
transportation_name.name_changes_gen.id = osm_transportation_name_linestring_gen3.id
transportation_name.name_changes_gen.id = osm_transportation_name_linestring_gen4_pre_merge.id
)
) AND (
(highway = 'motorway' OR highway = 'construction' AND subclass = 'motorway') AND
ST_Length(geometry) > 20000
) ON CONFLICT (id) DO UPDATE SET geometry = excluded.geometry, tags = excluded.tags, ref = excluded.ref,
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
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;

Wyświetl plik

@ -40,7 +40,7 @@ layer:
river:
water: ['river', 'stream', 'canal', 'ditch', 'drain']
pond:
water: ['pond', 'basin', 'wastewater']
water: ['pond', 'basin', 'wastewater', 'salt_pond']
lake:
ocean:
swimming_pool: