From 373293ecd42b7190fba10d6d96ac61e3f4b9a353 Mon Sep 17 00:00:00 2001 From: jeisenbe Date: Sun, 22 Sep 2019 13:20:18 +0900 Subject: [PATCH 1/3] Switch addresses to use ST_PointOnSurface This makes addresses consistent with `amenity-points` and `building` names. Address numbers will no longer be displayed separately than the POI or building name for oddly-shaped polygons --- project.mml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project.mml b/project.mml index e6146513f9..9f2004393b 100644 --- a/project.mml +++ b/project.mml @@ -2079,7 +2079,7 @@ Layer: <<: *osm2pgsql table: |- (SELECT - way, + ST_PointOnSurface(way) AS way, "addr:housenumber" AS addr_housenumber, "addr:housename" AS addr_housename, tags->'addr:unit' AS addr_unit, From 6b39d1daece9a0436b458313b69a77b11b9089d5 Mon Sep 17 00:00:00 2001 From: jeisenbe Date: Sun, 22 Sep 2019 19:01:55 +0900 Subject: [PATCH 2/3] Remove `text-placement: interior` from addresses This line is no longer necessary, since all are now labeled on a point that is generated with ST_PointOnSurface --- addressing.mss | 1 - 1 file changed, 1 deletion(-) diff --git a/addressing.mss b/addressing.mss index 1b3f8cd54d..3b41936109 100644 --- a/addressing.mss +++ b/addressing.mss @@ -25,7 +25,6 @@ } } } - text-placement: interior; text-face-name: @book-fonts; text-fill: @address-color; text-halo-radius: @standard-halo-radius; From c98d93a92371b0e88efab4d0adbb00eacd30bd5d Mon Sep 17 00:00:00 2001 From: jeisenbe Date: Tue, 24 Sep 2019 21:45:11 +0900 Subject: [PATCH 3/3] Add way && !bbox! condition --- project.mml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/project.mml b/project.mml index 9f2004393b..5509d23cb4 100644 --- a/project.mml +++ b/project.mml @@ -2085,7 +2085,7 @@ Layer: tags->'addr:unit' AS addr_unit, way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels FROM planet_osm_polygon - WHERE (("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL) OR ((tags->'addr:unit') IS NOT NULL)) + WHERE way && !bbox! AND (("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL) OR ((tags->'addr:unit') IS NOT NULL)) AND building IS NOT NULL UNION ALL SELECT @@ -2095,7 +2095,7 @@ Layer: tags->'addr:unit' AS addr_unit, NULL AS way_pixels FROM planet_osm_point - WHERE ("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL) OR ((tags->'addr:unit') IS NOT NULL) + WHERE way && !bbox! AND ("addr:housenumber" IS NOT NULL) OR ("addr:housename" IS NOT NULL) OR ((tags->'addr:unit') IS NOT NULL) ORDER BY way_pixels DESC NULLS LAST ) AS addresses properties: