Fix negative feature IDs (#1185)
This PR removes the possibility of negative feature IDs for the `aerodrome_label` layer by defining the feature as the absolute value of the OSM id (imposm maps relations with negative numbers). There is a very unlikely scenario in which a relation and a way have the same ID (and are also in the same tile), however, unique IDs are not a strict requirement of MVT. Noted in: https://github.com/openmaptiles/openmaptiles/pull/1176#issuecomment-902503655 Positive feature ID for Quonset State Airport, which is mapped as a relation: 
This commit is contained in:
committed by
GitHub
parent
36bd917e05
commit
6ef138635d
@@ -5,7 +5,7 @@ CREATE OR REPLACE FUNCTION layer_aerodrome_label(bbox geometry,
|
||||
zoom_level integer)
|
||||
RETURNS TABLE
|
||||
(
|
||||
osm_id bigint,
|
||||
id bigint,
|
||||
geometry geometry,
|
||||
name text,
|
||||
name_en text,
|
||||
@@ -21,7 +21,7 @@ AS
|
||||
$$
|
||||
SELECT
|
||||
-- etldoc: osm_aerodrome_label_point -> layer_aerodrome_label:z10_
|
||||
osm_id,
|
||||
ABS(osm_id) AS id, -- mvt feature IDs can't be negative
|
||||
geometry,
|
||||
name,
|
||||
COALESCE(NULLIF(name_en, ''), name) AS name_en,
|
||||
|
||||
Reference in New Issue
Block a user