Porównaj commity

...

32 Commity

Autor SHA1 Wiadomość Data
ache051 f13efefab3
Merge 27c2ab76ce into e6faa69a70 2024-04-24 10:53:01 +01:00
Tomas Pohanka e6faa69a70
Fix z7-z4 roads (#1656)
Some US roads were not included in tiles, because the `ST_AsMVTGeom` did not transform geometry (result was NULL). This PR is trying to fix the geometry for `ST_AsMVTGeom`, even if the geometry is marked as valid (`ST_IsValid`). The odd geometry was caused by simplification when it could create `LINESTRING(1 1, 2 2, 1 1)` linestring, which in some cases was not converted into MVT. 

Also, for the US (on zoom 4) keeps just the network `us-interstate` and the `highway=motorway` or `osm_national_network(network)` for the rest of the world.
2024-04-24 11:47:27 +02:00
ache051 27c2ab76ce
Merge branch 'master' into power_facilities 2022-10-20 15:30:26 +13:00
ache051 88b47916fb
Merge branch 'master' into power_facilities 2022-08-03 09:20:11 +12:00
ache051 868f0a8328
Merge branch 'master' into power_facilities 2022-05-25 13:14:36 +12:00
ache051 567164d592
Merge branch 'master' into power_facilities 2022-04-05 15:05:03 +12:00
ache051 b3b69b411c
Merge branch 'master' into power_facilities 2022-02-28 13:39:55 +13:00
ache051 b049530905
Merge branch 'master' into power_facilities 2022-01-06 10:31:10 +13:00
ache051 c91d702f00
Merge branch 'master' into power_facilities 2021-12-03 09:30:32 +13:00
ache051 6338b86d0a
Merge branch 'master' into power_facilities 2021-11-03 11:13:09 +13:00
ache051 40ae39fd03
Merge branch 'master' into power_facilities 2021-10-23 17:48:02 +13:00
ache051 c3478a40b4
Merge branch 'master' into power_facilities 2021-10-15 09:07:24 +13:00
ache051 c0e3e7955d
Updated rendering zoom level and etl diagrams
https://github.com/openmaptiles/openmaptiles/pull/1235#issuecomment-928976474
https://github.com/openmaptiles/openmaptiles/pull/1235#issuecomment-938699373
2021-10-13 14:29:37 +13:00
Tomas Pohanka 6a539b22db
Merge branch 'master' into power_facilities 2021-10-08 15:54:11 +02:00
ache051 302887ba16
Merge branch 'master' into power_facilities 2021-09-30 21:20:50 +13:00
ache051 15138206eb
Merge branch 'master' into power_facilities 2021-09-28 21:04:41 +13:00
ache051 412f7edd31
Merge branch 'master' into power_facilities 2021-09-22 14:31:56 +12:00
ache051 b3a3fa5223
Merge branch 'master' into power_facilities 2021-09-21 17:48:00 +12:00
ache051 d2b589d691
Generated mapping and etl diagram 2021-09-18 15:35:07 +12:00
ache051 08554e43b8
Delete power_polygon.sql
Clean-up old stuff.
2021-09-18 15:34:22 +12:00
ache051 b6554d535c
Delete power_point.sql
Clean-up old stuff.
2021-09-18 15:34:03 +12:00
ache051 f24308be36
Update power.yaml
Clean-up old stuff
2021-09-18 15:33:44 +12:00
ache051 1bc93cee64
Update power.sql
Clean-up old stuff.
2021-09-18 15:33:20 +12:00
ache051 24eec53839
Update mapping.yaml
Clean-up old stuff
2021-09-18 15:32:56 +12:00
ache051 4cf98ed27d
Remove parts for new lake centerlines 2021-09-18 15:31:31 +12:00
ache051 cc0729eff8
Update openmaptiles.yaml 2021-09-18 15:30:22 +12:00
ache051 933f118396
Remove generation of skiing layer
Remove generation of skiing layer to avoid confusion
2021-09-18 15:30:12 +12:00
ache051 90495aaf28
Delete generating new lake centerlines
Delete parts for generating new lake centerlines to avoid confusion.
2021-09-18 15:29:31 +12:00
ache051 7bbca699c5
Remove skiiing layer to avoid confusion 2021-09-18 15:28:13 +12:00
ache051 b6e93147b8
Delete fast.sh 2021-09-18 15:27:04 +12:00
ache051 d2f1244249
Merge branch 'openmaptiles:master' into power_facilities 2021-09-18 15:24:37 +12:00
ache051 d69c18227e Added power facilities layer 2021-09-16 11:56:32 +12:00
8 zmienionych plików z 287 dodań i 18 usunięć

Wyświetl plik

@ -0,0 +1,9 @@
## power
### Docs
### Mapping Diagram
![Mapping diagram for transportation](mapping_diagram.png?raw=true)
### ETL diagram
![ETL diagram for transportation](etl_diagram.png?raw=true)

Plik binarny nie jest wyświetlany.

Po

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

Wyświetl plik

@ -0,0 +1,99 @@
tables:
# etldoc: imposm3 -> osm_power_point
power_point:
type: point
fields:
- name: osm_id
type: id
- name: geometry
type: geometry
- key: power
name: class
type: string
- key: plant:source
name: source
type: string
- key: plant:method
name: method
type: string
- key: generator:source
name: gen_source
type: string
- key: generator:method
name: gen_method
type: string
- key: power
name: name
type: string
mapping:
power:
- tower
- pole
- catenary_mast
- generator
- portal
- transformer
- switch
- insulator
# etldoc: imposm3 -> osm_power_linestring
power_linestring:
type: linestring
fields:
- name: osm_id
type: id
- name: geometry
type: geometry
- key: power
name: class
type: string
- key: plant:source
name: source
type: string
- key: plant:method
name: method
type: string
- key: generator:source
name: gen_source
type: string
- key: generator:method
name: gen_method
type: string
- key: name
name: name
type: string
mapping:
power:
- line
- minor_line
# etldoc: imposm3 -> osm_power_polygon
power_polygon:
type: polygon
fields:
- name: osm_id
type: id
- name: geometry
type: geometry
- key: power
name: class
type: string
- key: plant:source
name: source
type: string
- key: plant:method
name: method
type: string
- key: generator:source
name: gen_source
type: string
- key: generator:method
name: gen_method
type: string
- key: name
name: name
type: string
mapping:
power:
- generator
- plant
- substation
- transformer

Plik binarny nie jest wyświetlany.

Po

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

Wyświetl plik

@ -0,0 +1,41 @@
-- etldoc: layer_power[shape=record fillcolor=lightpink, style="rounded,filled",
-- etldoc: label="layer_power | <z13> z13 | <z14> z14+ " ] ;
CREATE OR REPLACE FUNCTION layer_power(bbox geometry, zoom_level int)
RETURNS TABLE(geometry geometry, class text, source text, method text, name text) AS $$
SELECT geometry, class, COALESCE(NULLIF(source, ''),NULLIF(gen_source, '')), method, name
FROM(
-- etldoc: osm_power_point -> layer_power:z13
SELECT geometry, class, source, gen_source, method, name
FROM osm_power_point
WHERE zoom_level >= 13 AND class = 'tower' AND geometry && bbox
UNION ALL
-- etldoc: osm_power_point -> layer_power:z14
SELECT geometry, class, source, gen_source, method, name
FROM osm_power_point
WHERE zoom_level >= 14 AND class = 'pole' AND geometry && bbox
UNION ALL
-- etldoc: osm_power_linestring -> layer_power:z13
SELECT geometry, class, source, gen_source, method, name
FROM osm_power_linestring
WHERE zoom_level >= 13 AND class = 'line' AND geometry && bbox
UNION ALL
-- etldoc: osm_power_linestring -> layer_power:z14
SELECT geometry, class, source, gen_source, method, name
FROM osm_power_linestring
WHERE zoom_level >= 14 AND class = 'minor_line' AND geometry && bbox
UNION ALL
-- etldoc: osm_power_polygon -> layer_power:z13
SELECT geometry, class, source, gen_source, method, name
FROM osm_power_polygon
WHERE zoom_level >= 13 AND class = 'plant' AND geometry && bbox
UNION ALL
-- etldoc: osm_power_polygon -> layer_power:z14
SELECT geometry, class, source, gen_source, method, name
FROM osm_power_polygon
WHERE zoom_level >= 14 AND class IN ('substation', 'generator', 'transformer') AND geometry && bbox
) AS zoom_levels
WHERE geometry && bbox;
$$ LANGUAGE SQL STABLE
-- STRICT
PARALLEL SAFE;

Wyświetl plik

@ -0,0 +1,74 @@
layer:
id: "power"
description: |
**power** contains power cables and lines.
buffer_size: 4
fields:
name:
description: |
Name of the feature.
class:
description: |
Class is derived from the value of the
[`power`](http://wiki.openstreetmap.org/wiki/Key:power) tag.
values:
- line
- minor_line
- tower
- pole
- catenary_mast
- plant
- generator
- substation
- portal
- transformer
- switch
- insulator
source:
description: |
Class is derived from the value of the
[`plant:source`](http://wiki.openstreetmap.org/wiki/Key:plant:source) tag.
values:
- battery
- biogas
- biomass
- coal
- combustion
- diesel
- gas
- geothermal
- hydro
- nuclear
- oil
- solar
- solar_thermal
- waste
- wind
- wind_turbine
- wood
method:
description: |
Class is derived from the value of the
[`plant:method`](http://wiki.openstreetmap.org/wiki/Key:plant:method) tag.
values:
- anaerobic_digestion
- combustion
- dam
- fission
- gasification
- photovoltaic
- run-of-the-river
- thermal
- water-pumpted-storage
- water-storage
- wind_turbine
datasource:
geometry_field: geometry
query: (SELECT geometry, class, source, method, name FROM layer_power(!bbox!, z(!scale_denominator!))) AS t
schema:
- ./power.sql
datasources:
- type: imposm3
mapping_file: ./mapping.yaml

Wyświetl plik

@ -465,7 +465,7 @@ CREATE INDEX IF NOT EXISTS osm_transportation_merge_linestring_gen_z9_geometry_i
-- etldoc: osm_transportation_merge_linestring_gen_z9 -> osm_transportation_merge_linestring_gen_z8
CREATE TABLE IF NOT EXISTS osm_transportation_merge_linestring_gen_z8(
geometry geometry('LineString'),
geometry geometry,
id SERIAL,
osm_id bigint,
source_ids int[],
@ -684,25 +684,68 @@ BEGIN
-- etldoc: osm_transportation_merge_linestring_gen_z8 -> osm_transportation_merge_linestring_gen_z7
INSERT INTO osm_transportation_merge_linestring_gen_z7
SELECT ST_Simplify(geometry, ZRes(9)) AS geometry,
id,
osm_id,
highway,
network,
construction,
-- Remove bridge/tunnel/ford attributes from short sections of road so they can be merged
visible_brunnel(geometry, is_bridge, 8) AS is_bridge,
visible_brunnel(geometry, is_tunnel, 8) AS is_tunnel,
visible_brunnel(geometry, is_ford, 8) AS is_ford,
expressway,
z_order
FROM osm_transportation_merge_linestring_gen_z8
WITH roads_z8 AS (
SELECT id,
osm_id,
ST_SnapToGrid(
ST_Node(
ST_Collect(
ST_Simplify(geometry, ZRes(9))
)
), ZRes(9)
) AS geometry,
highway,
NULLIF(network, '') as network,
construction,
is_bridge,
is_tunnel,
is_ford,
expressway,
z_order
FROM osm_transportation_merge_linestring_gen_z8
GROUP BY id, osm_id, highway, construction, network, is_bridge, is_tunnel, is_ford, expressway, z_order
),
roads_z8_merge AS (
SELECT id,
osm_id,
ST_LineMerge(
ST_Union(geometry)
) AS geometry,
highway,
network,
construction,
is_bridge,
is_tunnel,
is_ford,
expressway,
z_order
FROM roads_z8
GROUP BY id, osm_id, highway, network, construction, is_bridge, is_tunnel, is_ford, expressway, z_order
)
SELECT CASE
WHEN ST_StartPoint(geometry) = ST_EndPoint(geometry)
THEN ST_RemovePoint(geometry, ST_NPoints(geometry) - 1)
ELSE geometry
END AS geometry,
id,
osm_id,
highway,
network,
construction,
-- Remove bridge/tunnel/ford attributes from short sections of road so they can be merged
visible_brunnel(geometry, is_bridge, 8) AS is_bridge,
visible_brunnel(geometry, is_tunnel, 8) AS is_tunnel,
visible_brunnel(geometry, is_ford, 8) AS is_ford,
expressway,
z_order
FROM roads_z8_merge
-- Current view: motorway/trunk/primary
WHERE
(full_update IS TRUE OR EXISTS(
SELECT NULL FROM transportation.changes_z4_z5_z6_z7
WHERE transportation.changes_z4_z5_z6_z7.is_old IS FALSE AND
transportation.changes_z4_z5_z6_z7.id = osm_transportation_merge_linestring_gen_z8.id
transportation.changes_z4_z5_z6_z7.id = roads_z8_merge.id
)) AND
(ST_Length(geometry) > 50)
ON CONFLICT (id) DO UPDATE SET osm_id = excluded.osm_id, highway = excluded.highway, network = excluded.network,
@ -825,10 +868,12 @@ 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' OR construction = 'motorway'
-- All motorways without network (e.g. EU, Asia, South America)
((highway = 'motorway' OR construction = 'motorway') AND (network is NULL or network = '')
) OR
(osm_national_network(network) AND network != 'gb-trunk'
) AND
-- All roads in network included in osm_national_network except gb-trunk and us-highway
( (osm_national_network(network) AND network NOT IN ('gb-trunk', 'us-highway')
)) AND
-- Current view: national-importance motorways and trunks
ST_Length(geometry) > 1000
ON CONFLICT (id) DO UPDATE SET osm_id = excluded.osm_id, highway = excluded.highway, network = excluded.network,

Wyświetl plik

@ -1,5 +1,6 @@
tileset:
layers:
- layers/power/power.yaml
- layers/water/water.yaml
- layers/waterway/waterway.yaml
- layers/landcover/landcover.yaml