Skip to content

Commit

Permalink
Run get_basic_name after osml10n_street_abbrev_* (#1326)
Browse files Browse the repository at this point in the history
PR move `get_basic_names(tags, geometry)` function from `transportation_name_tags` function and adding it after `transportation_name_tags` resolve street abbrevation.

PR runs through `test-sql` test without error. Adding to `osm_transportation_name_network` (table and for update) was done in consequence of `test-sql` errors ([update test 500](https://github.com/openmaptiles/openmaptiles/blob/a747d985508933c9619c9a765efc59d8c5c88085/tests/test-post-update.sql#L53)). Originally `get_basic_names` was just in `osm_transportation_name_linestring` table.

FIX #1324

![seattle_fix](https://user-images.githubusercontent.com/5182210/145085141-7857e97e-9b83-4467-bb98-84cc4a2e0623.png)
  • Loading branch information
TomPohys committed Dec 8, 2021
1 parent a747d98 commit 73dcd23
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions layers/transportation/highway_name.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ SELECT hstore(string_agg(nullif(slice_language_tags(tags ||
'name:en', CASE WHEN length(name_en) > 15 THEN osml10n_street_abbrev_en(name_en) ELSE NULLIF(name_en, '') END,
'name:de', CASE WHEN length(name_de) > 15 THEN osml10n_street_abbrev_de(name_de) ELSE NULLIF(name_de, '') END
]))::text,
''), ','))
|| get_basic_names(tags, geometry);
''), ','));
$$ LANGUAGE SQL IMMUTABLE
PARALLEL SAFE;
2 changes: 1 addition & 1 deletion layers/transportation/update_transportation_merge.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ CREATE TABLE IF NOT EXISTS osm_transportation_name_network AS
SELECT
geometry,
osm_id,
tags,
tags || get_basic_names(tags, geometry) AS tags,
ref,
highway,
subclass,
Expand Down
6 changes: 3 additions & 3 deletions layers/transportation_name/update_transportation_name.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
-- etldoc: osm_aerialway_linestring -> osm_transportation_name_linestring
CREATE TABLE IF NOT EXISTS osm_transportation_name_linestring AS
SELECT (ST_Dump(geometry)).geom AS geometry,
tags,
tags || get_basic_names(tags, geometry) AS tags,
ref,
highway,
subclass,
Expand Down Expand Up @@ -278,7 +278,7 @@ BEGIN
SELECT
geometry,
osm_id,
tags,
tags || get_basic_names(tags, geometry) AS tags,
ref,
highway,
subclass,
Expand Down Expand Up @@ -493,7 +493,7 @@ BEGIN

INSERT INTO osm_transportation_name_linestring
SELECT (ST_Dump(geometry)).geom AS geometry,
tags,
tags|| get_basic_names(tags, geometry) AS tags,
ref,
highway,
subclass,
Expand Down

0 comments on commit 73dcd23

Please sign in to comment.