Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render addr:flats #4082

Merged
merged 7 commits into from
Apr 7, 2020
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -2083,9 +2083,10 @@ 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))
richlv marked this conversation as resolved.
Show resolved Hide resolved
AND building IS NOT NULL
AND way_area < 4000000*POW(!scale_denominator!*0.001*0.28,2)
UNION ALL
Expand All @@ -2094,9 +2095,10 @@ 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))
richlv marked this conversation as resolved.
Show resolved Hide resolved
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] + "\n" + [addr_flats] + "\n" + [addr_housename];
richlv marked this conversation as resolved.
Show resolved Hide resolved
}
}
}
[zoom >= 20] {
text-size: 11;
Expand Down