Skip to content

Commit

Permalink
Correct lock name rendering
Browse files Browse the repository at this point in the history
* Remove unreferenced lock code from amenity-points.mss
* Don't render waterway=lock_gate names
* Don't render lock=yes name
  • Loading branch information
matthijsmelissen committed Mar 9, 2015
1 parent 3d39b8a commit db76c08
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 30 deletions.
11 changes: 0 additions & 11 deletions amenity-points.mss
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,6 @@
marker-clip: false;
}

[feature = 'waterway_lock'],
[feature = 'lock_yes'] {
[zoom >= 15] {
marker-fill: #969494;
marker-width: 9;
marker-line-width: 0;
marker-placement: interior;
marker-clip: false;
}
}

[feature = 'man_made_mast'][zoom >= 17] {
marker-file: url('symbols/communications.16.svg');
marker-fill: #555;
Expand Down
6 changes: 3 additions & 3 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"extent": "-20037508,-20037508,20037508,20037508",
"table": "(SELECT \n way, waterway, lock, name, intermittent,\n CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel,\n 'no' AS bridge\n FROM planet_osm_line\n WHERE waterway IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')\n AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct'))\n ORDER BY z_order\n) AS water_lines",
"table": "(SELECT \n way, waterway, name, intermittent,\n CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel,\n 'no' AS bridge\n FROM planet_osm_line\n WHERE waterway IN ('river', 'canal', 'derelict_canal', 'stream', 'drain', 'ditch', 'wadi')\n AND (bridge IS NULL OR bridge NOT IN ('yes', 'aqueduct'))\n ORDER BY z_order\n) AS water_lines",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand Down Expand Up @@ -1741,7 +1741,7 @@
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"extent": "-20037508,-20037508,20037508,20037508",
"table": "(SELECT way, NULL as way_pixels, COALESCE('man_made_' || man_made, 'waterway_' || waterway) AS feature, access, NULL as ele, name, ref, NULL AS way_area,\n CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building\n FROM planet_osm_line\n WHERE man_made IN ('pier', 'breakwater', 'groyne')\n OR waterway IN ('dam', 'weir', 'lock_gate')\n) AS text_line",
"table": "(SELECT way, NULL as way_pixels, COALESCE('man_made_' || man_made, 'waterway_' || waterway) AS feature, access, NULL as ele, name, ref, NULL AS way_area,\n CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building\n FROM planet_osm_line\n WHERE man_made IN ('pier', 'breakwater', 'groyne')\n OR waterway IN ('dam', 'weir')\n) AS text_line",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand All @@ -1765,7 +1765,7 @@
"srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over",
"Datasource": {
"extent": "-20037508,-20037508,20037508,20037508",
"table": "(SELECT\n way,\n NULL as way_pixels,\n COALESCE(\n 'aeroway_' || aeroway,\n 'shop_' || CASE WHEN shop IN ('supermarket', 'bakery', 'butcher', 'clothes', 'fashion', 'convenience', 'department_store', 'doityourself', 'florist', 'hairdresser', 'car', 'car_repair', 'bicycle', 'mall') THEN shop WHEN NOT shop IS NULL THEN 'other' ELSE NULL END,\n 'amenity_' || amenity,\n 'leisure_' || leisure,\n 'landuse_' || landuse,\n 'man_made_' || man_made,\n 'natural_' || \"natural\",\n 'place_' || place,\n 'tourism_' || tourism,\n 'military_' || military,\n 'waterway_' || waterway,\n 'historic_' || historic,\n 'highway_' || highway,\n 'power_' || power,\n 'boundary_' || boundary\n ) AS feature,\n access,\n (CASE WHEN \"natural\" IN ('peak', 'volcano', 'saddle') OR tourism = 'alpine_hut' OR amenity = 'shelter' THEN CASE WHEN ele IS NOT NULL THEN CASE WHEN name IS NOT NULL THEN CONCAT(name, E'\\n', ele) ELSE ele END ELSE name END ELSE name END) AS name,\n ref,\n NULL AS way_area,\n CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building\n FROM planet_osm_point\n WHERE amenity IS NOT NULL\n OR shop IN ('accessories', 'alcohol', 'antique', 'antiques', 'appliance', 'art', 'baby_goods', 'bag', 'bags', 'bakery', 'bathroom_furnishing', 'beauty', 'bed', 'betting', 'beverages', 'bicycle', 'boat', 'bookmaker', 'books', 'boutique', 'builder', 'building_materials', 'butcher', 'camera', 'car', 'car_parts', 'car_repair', 'car_service', 'carpet', 'charity', 'cheese', 'chemist', 'chocolate', 'clothes', 'coffee', 'communication', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'craft', 'curtain', 'dairy', 'deli', 'delicatessen', 'department_store', 'discount', 'dive', 'doityourself', 'dry_cleaning', 'e-cigarette', 'electrical', 'electronics', 'energy', 'erotic', 'estate_agent', 'fabric', 'farm', 'fashion', 'fish', 'fishing', 'fishmonger', 'flooring', 'florist', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'furniture', 'gallery', 'gambling', 'games', 'garden_centre', 'gas', 'general', 'gift', 'glaziery', 'greengrocer', 'grocery', 'hairdresser', 'hardware', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hifi', 'hobby', 'household', 'houseware', 'hunting', 'ice_cream', 'insurance', 'interior_decoration', 'jewellery', 'jewelry', 'kiosk', 'kitchen', 'laundry', 'leather', 'lighting', 'locksmith', 'lottery', 'mall', 'market', 'massage', 'medical', 'medical_supply', 'mobile_phone', 'money_lender', 'motorcycle', 'motorcycle_repair', 'music', 'musical_instrument', 'newsagent', 'office_supplies', 'optician', 'organic', 'outdoor', 'paint', 'pastry', 'pawnbroker', 'perfumery', 'pet', 'pets', 'pharmacy', 'phone', 'photo', 'photo_studio', 'photography', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'seafood', 'second_hand', 'sewing', 'shoe_repair', 'shoes', 'shopping_centre', 'solarium', 'souvenir', 'sports', 'stationery', 'supermarket', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'toys', 'trade', 'travel_agency', 'tyres', 'vacuum_cleaner', 'variety_store', 'video', 'video_games', 'watches', 'wholesale', 'wine', 'winery', 'yes')\n OR leisure IS NOT NULL\n OR landuse IS NOT NULL\n OR tourism IS NOT NULL\n OR \"natural\" IS NOT NULL\n OR man_made IN ('lighthouse', 'windmill')\n OR place = 'island'\n OR place = 'islet'\n OR military IS NOT NULL\n OR aeroway IS NOT NULL\n OR waterway IN ('dam', 'weir', 'lock_gate')\n OR historic IN ('memorial', 'archaeological_site')\n OR power IS NOT NULL\n OR highway IN ('bus_stop', 'services', 'rest_area')\n OR boundary = 'national_park'\n ) AS text",
"table": "(SELECT\n way,\n NULL as way_pixels,\n COALESCE(\n 'aeroway_' || aeroway,\n 'shop_' || CASE WHEN shop IN ('supermarket', 'bakery', 'butcher', 'clothes', 'fashion', 'convenience', 'department_store', 'doityourself', 'florist', 'hairdresser', 'car', 'car_repair', 'bicycle', 'mall') THEN shop WHEN NOT shop IS NULL THEN 'other' ELSE NULL END,\n 'amenity_' || amenity,\n 'leisure_' || leisure,\n 'landuse_' || landuse,\n 'man_made_' || man_made,\n 'natural_' || \"natural\",\n 'place_' || place,\n 'tourism_' || tourism,\n 'military_' || military,\n 'waterway_' || waterway,\n 'historic_' || historic,\n 'highway_' || highway,\n 'power_' || power,\n 'boundary_' || boundary\n ) AS feature,\n access,\n (CASE WHEN \"natural\" IN ('peak', 'volcano', 'saddle') OR tourism = 'alpine_hut' OR amenity = 'shelter' THEN CASE WHEN ele IS NOT NULL THEN CASE WHEN name IS NOT NULL THEN CONCAT(name, E'\\n', ele) ELSE ele END ELSE name END ELSE name END) AS name,\n ref,\n NULL AS way_area,\n CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building\n FROM planet_osm_point\n WHERE amenity IS NOT NULL\n OR shop IN ('accessories', 'alcohol', 'antique', 'antiques', 'appliance', 'art', 'baby_goods', 'bag', 'bags', 'bakery', 'bathroom_furnishing', 'beauty', 'bed', 'betting', 'beverages', 'bicycle', 'boat', 'bookmaker', 'books', 'boutique', 'builder', 'building_materials', 'butcher', 'camera', 'car', 'car_parts', 'car_repair', 'car_service', 'carpet', 'charity', 'cheese', 'chemist', 'chocolate', 'clothes', 'coffee', 'communication', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'craft', 'curtain', 'dairy', 'deli', 'delicatessen', 'department_store', 'discount', 'dive', 'doityourself', 'dry_cleaning', 'e-cigarette', 'electrical', 'electronics', 'energy', 'erotic', 'estate_agent', 'fabric', 'farm', 'fashion', 'fish', 'fishing', 'fishmonger', 'flooring', 'florist', 'food', 'frame', 'frozen_food', 'funeral_directors', 'furnace', 'furniture', 'gallery', 'gambling', 'games', 'garden_centre', 'gas', 'general', 'gift', 'glaziery', 'greengrocer', 'grocery', 'hairdresser', 'hardware', 'health', 'health_food', 'hearing_aids', 'herbalist', 'hifi', 'hobby', 'household', 'houseware', 'hunting', 'ice_cream', 'insurance', 'interior_decoration', 'jewellery', 'jewelry', 'kiosk', 'kitchen', 'laundry', 'leather', 'lighting', 'locksmith', 'lottery', 'mall', 'market', 'massage', 'medical', 'medical_supply', 'mobile_phone', 'money_lender', 'motorcycle', 'motorcycle_repair', 'music', 'musical_instrument', 'newsagent', 'office_supplies', 'optician', 'organic', 'outdoor', 'paint', 'pastry', 'pawnbroker', 'perfumery', 'pet', 'pets', 'pharmacy', 'phone', 'photo', 'photo_studio', 'photography', 'pottery', 'printing', 'radiotechnics', 'real_estate', 'religion', 'rental', 'salon', 'scuba_diving', 'seafood', 'second_hand', 'sewing', 'shoe_repair', 'shoes', 'shopping_centre', 'solarium', 'souvenir', 'sports', 'stationery', 'supermarket', 'tailor', 'tanning', 'tattoo', 'tea', 'ticket', 'tiles', 'tobacco', 'toys', 'trade', 'travel_agency', 'tyres', 'vacuum_cleaner', 'variety_store', 'video', 'video_games', 'watches', 'wholesale', 'wine', 'winery', 'yes')\n OR leisure IS NOT NULL\n OR landuse IS NOT NULL\n OR tourism IS NOT NULL\n OR \"natural\" IS NOT NULL\n OR man_made IN ('lighthouse', 'windmill')\n OR place = 'island'\n OR place = 'islet'\n OR military IS NOT NULL\n OR aeroway IS NOT NULL\n OR waterway IN ('dam', 'weir')\n OR historic IN ('memorial', 'archaeological_site')\n OR power IS NOT NULL\n OR highway IN ('bus_stop', 'services', 'rest_area')\n OR boundary = 'national_park'\n ) AS text",
"geometry_field": "way",
"type": "postgis",
"key_field": "",
Expand Down
6 changes: 3 additions & 3 deletions project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Layer:
<<: *osm2pgsql
table: |-
(SELECT
way, waterway, lock, name, intermittent,
way, waterway, name, intermittent,
CASE WHEN tunnel IN ('yes', 'culvert') THEN 'yes' ELSE 'no' END AS int_tunnel,
'no' AS bridge
FROM planet_osm_line
Expand Down Expand Up @@ -1696,7 +1696,7 @@ Layer:
CASE WHEN building = 'no' OR building IS NULL THEN 'no' ELSE 'yes' END AS is_building
FROM planet_osm_line
WHERE man_made IN ('pier', 'breakwater', 'groyne')
OR waterway IN ('dam', 'weir', 'lock_gate')
OR waterway IN ('dam', 'weir')
) AS text_line
advanced: {}
- id: "text-point"
Expand Down Expand Up @@ -1744,7 +1744,7 @@ Layer:
OR place = 'islet'
OR military IS NOT NULL
OR aeroway IS NOT NULL
OR waterway IN ('dam', 'weir', 'lock_gate')
OR waterway IN ('dam', 'weir')
OR historic IN ('memorial', 'archaeological_site')
OR power IS NOT NULL
OR highway IN ('bus_stop', 'services', 'rest_area')
Expand Down
3 changes: 1 addition & 2 deletions water-features.mss
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@

.text {
[feature = 'waterway_dam'],
[feature = 'waterway_weir'],
[feature = 'waterway_lock_gate'] {
[feature = 'waterway_weir'] {
#text-poly[zoom >= 15],
#text-line[zoom >= 15],
#text-point[zoom >= 17] {
Expand Down
11 changes: 0 additions & 11 deletions water.mss
Original file line number Diff line number Diff line change
Expand Up @@ -208,17 +208,6 @@
}

#water-lines-text {
[lock = 'yes'][zoom >= 17] {
text-name: "[name]";
text-face-name: @oblique-fonts;
text-halo-radius: 1;
text-halo-fill: rgba(255,255,255,0.6);
text-size: 10;
text-fill: @water-text;
text-placement: point;
text-wrap-width: 20;
}

[lock != 'yes'] {
[waterway = 'river'][zoom >= 13] {
text-name: "[name]";
Expand Down

0 comments on commit db76c08

Please sign in to comment.