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 #3061

Closed
wants to merge 8 commits into from
Closed
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
204 changes: 203 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: darkblue;
@man-made-icon: #555;
@landform-color: #d08f55;
@leisure-green: darken(@park, 60%);
Expand Down Expand Up @@ -873,6 +874,104 @@
}
}



// government and public institutions
[zoom >= 17] {
[feature = 'office_administrative'],
[feature = 'office_adoption_agency'],
[feature = 'office_government'],
[feature = 'office_employment_agency'],
[feature = 'office_educational_institution'],
[feature = 'office_government'],
[feature = 'office_ngo'],
[feature = 'office_political_party'],
[feature = 'office_quango'],
[feature = 'office_religion'],
[feature = 'office_tax'] {
marker-width: 4;
[zoom >= 18] {
marker-width: 6;
}
marker-line-width: 0;
marker-placement: interior;
marker-clip: false;
marker-fill: @public-service;
}
}

// potentially larger businesses
[zoom >= 17] {
[feature = 'office_energy_supplier'],
[feature = 'office_financial'],
[feature = 'office_newspaper'],
[feature = 'office_research'],
[feature = 'office_telecommunication'],
[feature = 'office_water_utility'],
{
marker-width: 4;
[zoom >= 18] {
marker-width: 6;
}
marker-line-width: 0;
marker-placement: interior;
marker-clip: false;
marker-fill: @office;
}
}

// smaller businesses, treated as shops
[zoom >= 18],
[zoom >= 17][way_pixels > 3000] {
[feature = 'office_accountant'],
[feature = 'office_advertising_agency'],
[feature = 'office_architect'],
[feature = 'office_estate_agent'],
[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_travel_agent'],
[feature = 'office_therapist'] {
marker-width: 4;
[zoom >= 18] {
marker-width: 6;
}
marker-line-width: 0;
marker-placement: interior;
marker-clip: false;
marker-fill: @shop-icon;
}
}

// other offices
[zoom >= 18],
[zoom >= 17][way_pixels > 3000] {
[feature = 'office_association'],
[feature = 'office_charity'],
[feature = 'office_company'],
[feature = 'office_forestry'],
[feature = 'office_foundation'],
[feature = 'office_yes'] {
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 @@ -2032,7 +2131,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 @@ -2051,6 +2150,109 @@
}
}

// smaller businesses, treated as shops
[zoom >= 18],
[zoom >= 17][way_pixels > 3000] {
[feature = 'office_accountant'],
[feature = 'office_advertising_agency'],
[feature = 'office_architect'],
[feature = 'office_estate_agent'],
[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: @shop-text;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: rgba(255, 255, 255, 0.6);
text-placement: interior;
}
}

// government and public institutions
[zoom >= 17] {
[feature = 'office_administrative'],
[feature = 'office_adoption_agency'],
[feature = 'office_educational_institution'],
[feature = 'office_employment_agency'],
[feature = 'office_government'],
[feature = 'office_ngo'],
[feature = 'office_political_party'],
[feature = 'office_quango'],
[feature = 'office_religion'],
[feature = 'office_tax'] {
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: @public-service;
text-face-name: @standard-font;
text-halo-radius: @standard-halo-radius;
text-halo-fill: rgba(255, 255, 255, 0.6);
text-placement: interior;
}
}

// potentially larger businesses
[zoom >= 17] {
[feature = 'office_energy_supplier'],
[feature = 'office_financial'],
[feature = 'office_newspaper'],
[feature = 'office_research'],
[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 offices
[zoom >= 18],
[zoom >= 17][way_pixels > 3000] {
[feature = 'office_association'],
[feature = 'office_charity'],
[feature = 'office_company'],
[feature = 'office_forestry'],
[feature = 'office_foundation'],
[feature = 'office_yes'] {
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
39 changes: 39 additions & 0 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,14 @@ Layer:
'prison', 'hunting_stand', 'nightclub', 'veterinary', 'social_facility',
'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace', 'waste_disposal') THEN amenity 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 ('accountant', 'administrative', 'adoption_agency', 'advertising_agency', 'architect',
'association', 'charity', 'company', 'educational_institution', 'employment_agency',
'energy_supplier', 'estate_agent', 'financial', 'forestry', 'foundation',
'government', 'guide', 'insurance', 'it', 'lawyer', 'logistics', 'moving_company',
'newspaper', 'ngo', 'notary', 'physician', 'political_party', 'private_investigator',
'property_management', 'quango', 'religion', 'research', 'surveyor', 'tax', 'tax_advisor',
'telecommunication', 'therapist', 'travel_agent', 'water_utility',
'yes') THEN tags->'office' ELSE NULL END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table',
'fitness_centre', 'fitness_station', 'firepit') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
Expand All @@ -1458,6 +1466,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,
CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'books', 'butcher', 'clothes', 'computer',
'confectionery', 'fashion', 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist',
Expand All @@ -1476,6 +1485,7 @@ Layer:
'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site')
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
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')
OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'obelisk')
Expand Down Expand Up @@ -1531,6 +1541,14 @@ Layer:
'charging_station', 'arts_centre', 'ferry_terminal', 'marketplace') THEN amenity 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 ('accountant', 'administrative', 'adoption_agency', 'advertising_agency', 'architect',
'association', 'charity', 'company', 'educational_institution', 'employment_agency',
'energy_supplier', 'estate_agent', 'financial', 'forestry', 'foundation',
'government', 'guide', 'insurance', 'it', 'lawyer', 'logistics', 'moving_company',
'newspaper', 'ngo', 'notary', 'physician', 'political_party', 'private_investigator',
'property_management', 'quango', 'religion', 'research', 'surveyor', 'tax', 'tax_advisor',
'telecommunication', 'therapist', 'travel_agent', 'water_utility',
'yes') THEN tags->'office' ELSE NULL END,
'leisure_' || CASE WHEN leisure IN ('water_park', 'playground', 'miniature_golf', 'golf_course', 'picnic_table', 'slipway',
'dog_park', 'fitness_centre', 'fitness_station', 'firepit') THEN leisure ELSE NULL END,
'man_made_' || CASE WHEN man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'obelisk') THEN man_made ELSE NULL END,
Expand Down Expand Up @@ -1561,6 +1579,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,
CASE WHEN shop IN ('supermarket', 'bag', 'bakery', 'beauty', 'books', 'butcher', 'clothes', 'computer',
'confectionery', 'fashion', 'convenience', 'department_store', 'doityourself', 'hardware', 'fishmonger', 'florist',
Expand All @@ -1579,6 +1598,7 @@ Layer:
'hotel', 'motel', 'information', 'museum', 'viewpoint', 'picnic_site')
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
OR shop IS NOT NULL
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')
OR man_made IN ('mast', 'water_tower', 'lighthouse', 'windmill', 'cross', 'obelisk')
Expand Down Expand Up @@ -1958,6 +1978,14 @@ Layer:
'perfumery', 'cosmetics', 'variety_store', 'wine', 'outdoor', 'copyshop', 'sports', 'deli', 'tobacco', 'art', 'tea',
'coffee', 'tyres', 'pastry', 'chocolate') 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 ('accountant', 'administrative', 'adoption_agency', 'advertising_agency', 'architect',
'association', 'charity', 'company', 'educational_institution', 'employment_agency',
'energy_supplier', 'estate_agent', 'financial', 'forestry', 'foundation',
'government', 'guide', 'insurance', 'it', 'lawyer', 'logistics', 'moving_company',
'newspaper', 'ngo', 'notary', 'physician', 'political_party', 'private_investigator',
'property_management', 'quango', 'religion', 'research', 'surveyor', 'tax', 'tax_advisor',
'telecommunication', 'therapist', 'travel_agent', 'water_utility',
'yes') THEN tags->'office' ELSE NULL 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') THEN leisure ELSE NULL END,
Expand Down Expand Up @@ -1992,6 +2020,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 @@ -2003,6 +2032,7 @@ Layer:
'museum', 'viewpoint', 'attraction', 'zoo', 'information', 'picnic_site')
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
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', 'water_tower', 'pier', 'breakwater', 'groyne', 'obelisk', 'works')
Expand Down Expand Up @@ -2101,6 +2131,14 @@ Layer:
'variety_store', 'wine', 'outdoor', 'copyshop', 'sports', 'deli', 'tobacco', 'art', 'tea', 'coffee', 'tyres',
'pastry', 'chocolate') 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 ('accountant', 'administrative', 'adoption_agency', 'advertising_agency', 'architect',
'association', 'charity', 'company', 'educational_institution', 'employment_agency',
'energy_supplier', 'estate_agent', 'financial', 'forestry', 'foundation',
'government', 'guide', 'insurance', 'it', 'lawyer', 'logistics', 'moving_company',
'newspaper', 'ngo', 'notary', 'physician', 'political_party', 'private_investigator',
'property_management', 'quango', 'religion', 'research', 'surveyor', 'tax', 'tax_advisor',
'telecommunication', 'therapist', 'travel_agent', 'water_utility',
'yes') THEN tags->'office' ELSE NULL 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') THEN leisure ELSE NULL END,
Expand Down Expand Up @@ -2150,6 +2188,7 @@ Layer:
'museum', 'viewpoint', 'attraction', 'zoo', 'information', 'picnic_site')
OR amenity IS NOT NULL -- skip checking a huge list and use a null check
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