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):
![image](https://user-images.githubusercontent.com/3254090/130335311-10b7aa35-d2f9-42cc-a054-878048012040.png)

Zoom 10 in the same area:
![image](https://user-images.githubusercontent.com/3254090/130335327-3989cfba-80ca-46dd-a157-45b375f84a8d.png)
This commit is contained in:
Brian Sperlongano
2021-08-23 08:14:50 -04:00
committed by GitHub
parent aee838e29f
commit 7e9a6812d7
3 changed files with 35 additions and 4 deletions

View File

@@ -2,6 +2,18 @@ DROP TRIGGER IF EXISTS trigger_flag ON osm_aerodrome_label_point;
DROP TRIGGER IF EXISTS trigger_store ON osm_aerodrome_label_point;
DROP TRIGGER IF EXISTS trigger_refresh ON aerodrome_label.updates;
-- Partial index for zoom 8/9 queries
CREATE INDEX IF NOT EXISTS osm_aerodrome_label_point_type_partial_idx
ON osm_aerodrome_label_point USING gist (geometry)
WHERE aerodrome_type = 'international'
AND iata <> '';
UPDATE osm_aerodrome_label_point SET aerodrome_type=(
CASE
%%FIELD_MAPPING: class %%
ELSE 'other' END
);
CREATE SCHEMA IF NOT EXISTS aerodrome_label;
CREATE TABLE IF NOT EXISTS aerodrome_label.osm_ids