Skip to content

Commit

Permalink
Merge pull request #4082 from richlv/patch-1
Browse files Browse the repository at this point in the history
Render addr:flats
  • Loading branch information
pnorman authored Apr 7, 2020
2 parents 0adeed6 + 2c03357 commit e7fc0c9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
8 changes: 6 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -2026,9 +2026,11 @@ Layer:
"addr:housenumber" AS addr_housenumber,
"addr:housename" AS addr_housename,
tags->'addr:unit' AS addr_unit,
tags->'addr:flats' AS addr_flats,
way_area/NULLIF(POW(!scale_denominator!*0.001*0.28,2),0) AS way_pixels
FROM planet_osm_polygon
WHERE way && !bbox! AND (("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) OR ((tags->'addr:flats') IS NOT NULL))
AND building IS NOT NULL
AND way_area < 4000000*POW(!scale_denominator!*0.001*0.28,2)
UNION ALL
Expand All @@ -2037,9 +2039,11 @@ Layer:
"addr:housenumber" AS addr_housenumber,
"addr:housename" AS addr_housename,
tags->'addr:unit' AS addr_unit,
tags->'addr:flats' AS addr_flats,
NULL AS way_pixels
FROM planet_osm_point
WHERE way && !bbox! AND (("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) OR ((tags->'addr:flats') IS NOT NULL))
ORDER BY way_pixels DESC NULLS LAST
) AS addresses
properties:
Expand Down
22 changes: 16 additions & 6 deletions style/addressing.mss
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,7 @@
["addr_housename" != null] {
text-name: [addr_housenumber] + "\n" + [addr_housename];
}
["addr_unit" != null] {
text-name: [addr_housenumber] + " " + [addr_unit];
["addr_housename" != null] {
text-name: [addr_housenumber] + " " + [addr_unit] + "\n" + [addr_housename];
}
}

}
text-face-name: @book-fonts;
text-fill: @address-color;
Expand All @@ -38,6 +33,21 @@
["addr_unit" != null]["addr_housenumber" = null] {
text-name: [addr_unit];
}
["addr_flats" != null]["addr_housenumber" = null] {
text-name: [addr_flats];
}
["addr_unit" != null] {
text-name: [addr_housenumber] + " " + [addr_unit];
["addr_housename" != null] {
text-name: [addr_housenumber] + " " + [addr_unit] + "\n" + [addr_housename];
}
}
["addr_flats" != null] {
text-name: [addr_housenumber] + " " + [addr_flats];
["addr_housename" != null] {
text-name: [addr_housenumber] + " " + [addr_flats] + "\n" + [addr_housename];
}
}
}
[zoom >= 20] {
text-size: 11;
Expand Down

0 comments on commit e7fc0c9

Please sign in to comment.