Add international airports at z8-9 (#1187)
Closes #1082 This PR moves the aerodrome/aerodrome_type consolidation (via template) into the lower-level `osm_aerodrome_label_point` table, and creates a partial index on class `international` for airports with an `iata` code. The presence of an `iata` code is more significant than an `icao` code which exists at many smaller, general aviation airport. Therefore, `international` + `iata` should be a sufficient filter. Zoom 8 international airports in the NYC area (blue dots):  Zoom 10 in the same area: 
This commit is contained in:
committed by
GitHub
parent
aee838e29f
commit
7e9a6812d7
@@ -19,6 +19,28 @@ CREATE OR REPLACE FUNCTION layer_aerodrome_label(bbox geometry,
|
||||
)
|
||||
AS
|
||||
$$
|
||||
SELECT
|
||||
-- etldoc: osm_aerodrome_label_point -> layer_aerodrome_label:z8
|
||||
-- etldoc: osm_aerodrome_label_point -> layer_aerodrome_label:z9
|
||||
ABS(osm_id) AS id, -- mvt feature IDs can't be negative
|
||||
geometry,
|
||||
name,
|
||||
COALESCE(NULLIF(name_en, ''), name) AS name_en,
|
||||
COALESCE(NULLIF(name_de, ''), name, name_en) AS name_de,
|
||||
tags,
|
||||
aerodrome_type AS class,
|
||||
NULLIF(iata, '') AS iata,
|
||||
NULLIF(icao, '') AS icao,
|
||||
substring(ele FROM E'^(-?\\d+)(\\D|$)')::int AS ele,
|
||||
round(substring(ele FROM E'^(-?\\d+)(\\D|$)')::int * 3.2808399)::int AS ele_ft
|
||||
FROM osm_aerodrome_label_point
|
||||
WHERE geometry && bbox
|
||||
AND aerodrome_type = 'international'
|
||||
AND iata <> ''
|
||||
AND zoom_level BETWEEN 8 AND 9
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT
|
||||
-- etldoc: osm_aerodrome_label_point -> layer_aerodrome_label:z10_
|
||||
ABS(osm_id) AS id, -- mvt feature IDs can't be negative
|
||||
@@ -27,10 +49,7 @@ SELECT
|
||||
COALESCE(NULLIF(name_en, ''), name) AS name_en,
|
||||
COALESCE(NULLIF(name_de, ''), name, name_en) AS name_de,
|
||||
tags,
|
||||
CASE
|
||||
%%FIELD_MAPPING: class %%
|
||||
ELSE 'other'
|
||||
END AS class,
|
||||
aerodrome_type AS class,
|
||||
NULLIF(iata, '') AS iata,
|
||||
NULLIF(icao, '') AS icao,
|
||||
substring(ele FROM E'^(-?\\d+)(\\D|$)')::int AS ele,
|
||||
|
||||
Reference in New Issue
Block a user