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 offices as dots + names #3163

Merged
merged 3 commits into from
Apr 19, 2018
Merged
Show file tree
Hide file tree
Changes from all 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
99 changes: 98 additions & 1 deletion amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@memorials: @amenity-brown;
@culture: @amenity-brown;
@public-service: @amenity-brown;
@office: #4863A0;
@man-made-icon: #555;
@advertising-grey: @man-made-icon;
@landform-color: #d08f55;
Expand Down Expand Up @@ -992,6 +993,18 @@
marker-clip: false;
}

// office points
[office != null][zoom >= 17] {
marker-width: 4;
[zoom >= 18] {
marker-width: 6;
}
marker-line-width: 0;
marker-placement: interior;
marker-clip: false;
marker-fill: @office;
}

[feature = 'leisure_water_park'][zoom >= 17] {
marker-file: url('symbols/water_park.svg');
marker-placement: interior;
Expand Down Expand Up @@ -2221,7 +2234,7 @@
[feature = 'shop_tyres'],
[feature = 'shop_variety_store'],
[feature = 'shop_wine'],
[feature = 'shop_other']{
[feature = 'shop_other'] {
[way_pixels > 3000][zoom >= 17],
[zoom >= 18] {
text-name: "[name]";
Expand All @@ -2240,6 +2253,90 @@
}
}

// potentially larger offices
[zoom >= 17] {
[feature = 'office_administrative'],
[feature = 'office_adoption_agency'],
[feature = 'office_educational_institution'],
[feature = 'office_employment_agency'],
[feature = 'office_energy_supplier'],
[feature = 'office_financial'],
[feature = 'office_government'],
[feature = 'office_newspaper'],
[feature = 'office_ngo'],
[feature = 'office_political_party'],
[feature = 'office_quango'],
[feature = 'office_religion'],
[feature = 'office_research'],
[feature = 'office_tax'],
[feature = 'office_telecommunication'],
[feature = 'office_water_utility'],
{
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-dy: 8;
text-fill: @office;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: rgba(255, 255, 255, 0.6);
text-placement: interior;
}
}

// other documented office types
[zoom >= 18] {
[feature = 'office_accountant'],
[feature = 'office_advertising_agency'],
[feature = 'office_architect'],
[feature = 'office_association'],
[feature = 'office_charity'],
[feature = 'office_company'],
[feature = 'office_estate_agent'],
[feature = 'office_forestry'],
[feature = 'office_foundation'],
[feature = 'office_guide'],
[feature = 'office_insurance'],
[feature = 'office_it'],
[feature = 'office_lawyer'],
[feature = 'office_logistics'],
[feature = 'office_moving_company'],
[feature = 'office_notary'],
[feature = 'office_physician'],
[feature = 'office_private_investigator'],
[feature = 'office_property_management'],
[feature = 'office_surveyor'],
[feature = 'office_tax_advisor'],
[feature = 'office_therapist'],
[feature = 'office_travel_agent'] {
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-dy: 8;
text-fill: @office;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: rgba(255, 255, 255, 0.6);
text-placement: interior;
}
}

// all other offices
[office != null][zoom >= 19] {
text-name: "[name]";
text-size: @standard-font-size;
text-wrap-width: @standard-wrap-width;
text-line-spacing: @standard-line-spacing-size;
text-dy: 8;
text-fill: @office;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: rgba(255, 255, 255, 0.6);
text-placement: interior;
}

[feature = 'shop_supermarket'],
[feature = 'shop_department_store'] {
[zoom >= 16] {
Expand Down
13 changes: 13 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1444,6 +1444,7 @@ Layer:
'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace', 'waste_disposal', 'shower', 'bbq') THEN amenity ELSE NULL END,
'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END,
'shop' || CASE WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END,
'office_' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR tags->'office' IS NULL THEN NULL ELSE tags->'office' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table',
'fitness_centre', 'fitness_station', 'firepit', 'sauna') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
Expand Down Expand Up @@ -1471,6 +1472,7 @@ Layer:
tags->'power_source' as power_source,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'office' as office,
tags->'recycling_type' as recycling_type,
tags->'tower:construction' as "tower:construction",
tags->'tower:type' as "tower:type",
Expand All @@ -1492,6 +1494,7 @@ Layer:
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR tags->'advertising' IN ('column')
OR shop IS NOT NULL
OR tags->'office' IS NOT NULL
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'fitness_centre',
'fitness_station', 'firepit', 'sauna')
OR man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk')
Expand Down Expand Up @@ -1548,6 +1551,7 @@ Layer:
'advertising_' || CASE WHEN tags->'advertising' in ('column') THEN tags->'advertising' else NULL END,
'emergency_' || CASE WHEN tags->'emergency' IN ('phone') THEN tags->'emergency' ELSE NULL END,
'shop' || CASE WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE '' END,
'office_' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR tags->'office' IS NULL THEN NULL ELSE tags->'office' END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('mast', 'tower', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
Expand Down Expand Up @@ -1587,6 +1591,7 @@ Layer:
tags->'power_source' as power_source,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'office' as office,
tags->'recycling_type' as recycling_type,
tags->'tower:construction' as "tower:construction",
tags->'tower:type' as "tower:type",
Expand All @@ -1608,6 +1613,7 @@ Layer:
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR shop IS NOT NULL
OR tags->'advertising' IN ('column')
OR tags->'office' IS NOT NULL
OR leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park', 'fitness_centre', 'fitness_station', 'firepit', 'sauna')
OR barrier IN ('toll_booth')
Expand Down Expand Up @@ -1994,6 +2000,7 @@ Layer:
'perfumery', 'cosmetics', 'variety_store', 'wine', 'outdoor', 'copyshop', 'sports', 'deli', 'tobacco', 'art', 'tea',
'coffee', 'tyres', 'pastry', 'chocolate', 'music', 'medical_supply', 'dairy') THEN shop
WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END,
'office_' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR tags->'office' IS NULL THEN NULL ELSE tags->'office' END,
'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'fitness_centre', 'sports_centre', 'stadium', 'track',
'pitch', 'playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina',
'picnic_table', 'dog_park', 'fitness_station', 'firepit', 'sauna') THEN leisure ELSE NULL END,
Expand Down Expand Up @@ -2028,6 +2035,7 @@ Layer:
tags->'operator' as operator,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'office' as office,
tags->'recycling_type' as recycling_type,
ref,
way_area,
Expand All @@ -2040,6 +2048,7 @@ Layer:
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR tags->'advertising' IN ('column')
OR shop IS NOT NULL
OR tags->'office' IS NOT NULL
OR leisure IS NOT NULL
OR landuse IS NOT NULL
OR man_made IN ('lighthouse', 'windmill', 'mast', 'tower', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk', 'works')
Expand Down Expand Up @@ -2109,6 +2118,7 @@ Layer:
operator,
icao,
iata,
office,
recycling_type,
ref,
way_area,
Expand Down Expand Up @@ -2139,6 +2149,7 @@ Layer:
'variety_store', 'wine', 'outdoor', 'copyshop', 'sports', 'deli', 'tobacco', 'art', 'tea', 'coffee', 'tyres',
'pastry', 'chocolate', 'music', 'medical_supply','dairy') THEN shop
WHEN shop IN ('no', 'vacant', 'closed', 'disused', 'empty') OR shop IS NULL THEN NULL ELSE 'other' END,
'office_' || CASE WHEN tags->'office' IN ('no', 'vacant', 'closed', 'disused', 'empty') OR tags->'office' IS NULL THEN NULL ELSE tags->'office' END,
'leisure_' || CASE WHEN leisure IN ('swimming_pool', 'water_park', 'miniature_golf', 'golf_course', 'fitness_centre', 'sports_centre', 'stadium', 'track',
'pitch','playground', 'park', 'recreation_ground', 'common', 'garden', 'nature_reserve', 'marina',
'slipway', 'picnic_table', 'dog_park', 'fitness_station', 'firepit', 'sauna') THEN leisure ELSE NULL END,
Expand Down Expand Up @@ -2178,6 +2189,7 @@ Layer:
tags->'operator' as operator,
tags->'icao' as icao,
tags->'iata' as iata,
tags->'office' as office,
tags->'recycling_type' as recycling_type,
ref,
NULL AS way_area,
Expand All @@ -2190,6 +2202,7 @@ Layer:
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR tags->'advertising' IN ('column')
OR shop IS NOT NULL
OR tags->'office' IS NOT NULL
OR leisure IS NOT NULL
OR landuse IN ('reservoir', 'basin', 'recreation_ground', 'village_green', 'quarry', 'vineyard', 'orchard', 'cemetery', 'residential',
'garages', 'meadow', 'grass', 'allotments', 'forest', 'farmyard', 'farmland', 'greenhouse_horticulture',
Expand Down