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

Improve maki_list.py to check for missing icons #110

Merged
merged 3 commits into from
Nov 10, 2023

Conversation

Caerbannog
Copy link
Contributor

Compare local file when possible to check modified iconset (and avoid Github rate limits).
Fetch openmaptiles POIs schema and compare it too.

Output :

116 names in our iconset
14 classes in OpenMapTiles
276 subclasses in OpenMapTiles
212 names in Maki

10 names in OpenMapTiles unused by our iconset:
['amenity', 'barrier', 'highway', 'historic', 'landuse', 'leisure', 'office', 'sport', 'tourism', 'waterway']

112 names in our iconset missing in OpenMapTiles:
['airfield', 'airport', 'alcohol_shop', 'america_football', 'amusement_park', 'aquarium', 'art_gallery', 'attraction', 'bakery', 'bank', 'bar', 'baseball', 'basketball', 'beer', 'bicycle', 'bicycle_rental', 'bus', 'butcher', 'cafe', 'campsite', 'car', 'castle', 'cemetery', 'cinema', 'circle', 'circle-stroked', 'clothing_store', 'college', 'commercial', 'cricket', 'cross', 'dam', 'danger', 'dentist', 'doctor', 'dog_park', 'drinking-water', 'drinking_water', 'embassy', 'entrance', 'fast_food', 'ferry', 'fire-station', 'fuel', 'garden', 'gift', 'golf', 'grocery', 'hairdresser', 'harbor', 'heart', 'heliport', 'hospital', 'ice_cream', 'industry', 'information', 'laundry', 'library', 'lighthouse', 'lodging', 'marker', 'monument', 'mountain', 'museum', 'music', 'park', 'parking', 'parking_garage', 'pharmacy', 'picnic_site', 'pitch', 'place_of_worship', 'playground', 'police', 'post', 'prison', 'railway_light', 'railway_metro', 'ranger_station', 'religious_christian', 'religious_jewish', 'religious_muslim', 'restaurant', 'roadblock', 'rocket', 'school', 'shelter', 'skiing', 'soccer', 'square', 'square-stroke', 'stadium', 'star', 'star-stroke', 'suitcase', 'sushi', 'swimming', 'telephone', 'tennis', 'theatre', 'toilet', 'town_hall', 'triangle', 'triangle_stroked', 'veterinary', 'volcano', 'warehouse', 'waste_basket', 'water', 'wetland', 'wheelchair', 'zoo']

108 names in Maki unused by our iconset:
['american_football', 'animal_shelter', 'arrow', 'bank_JP', 'barrier', 'bbq', 'beach', 'bicycle_share', 'blood_bank', 'bowling_alley', 'bridge', 'building_alt1', 'car_rental', 'car_repair', 'casino', 'castle_JP', 'caution', 'cemetery_JP', 'charging_station', 'circle_stroked', 'city', 'college_JP', 'communications_tower', 'confectionery', 'construction', 'convenience', 'defibrillator', 'diamond', 'elevator', 'emergency_phone', 'entrance_alt1', 'farm', 'fence', 'ferry_JP', 'fire_station', 'fire_station_JP', 'fitness_centre', 'florist', 'furniture', 'gaming', 'garden_centre', 'gate', 'globe', 'hardware', 'highway_rest_area', 'historic', 'home', 'horse_riding', 'hospital_JP', 'hot_spring', 'jewelry_store', 'karaoke', 'landmark', 'landmark_JP', 'landuse', 'lift_gate', 'lighthouse_JP', 'logging', 'marker_stroked', 'mobile_phone', 'monument_JP', 'natural', 'observation_tower', 'optician', 'paint', 'park_alt1', 'parking_paid', 'police_JP', 'post_JP', 'racetrack', 'racetrack_boat', 'racetrack_cycling', 'racetrack_horse', 'rail', 'rail_light', 'rail_metro', 'recycling', 'religious_buddhist', 'religious_shinto', 'residential_community', 'restaurant_bbq', 'restaurant_noodle', 'restaurant_pizza', 'restaurant_seafood', 'restaurant_sushi', 'road_accident', 'school_JP', 'scooter', 'shoe', 'skateboard', 'slaughterhouse', 'slipway', 'snowmobile', 'square_stroked', 'star_stroked', 'table_tennis', 'teahouse', 'terminal', 'toll', 'town', 'tunnel', 'viewpoint', 'village', 'volleyball', 'watch', 'waterfall', 'watermill', 'windmill']

12 names in our iconset missing in Maki:
['america_football', 'bicycle_rental', 'butcher', 'circle-stroked', 'drinking-water', 'fire-station', 'railway', 'railway_light', 'railway_metro', 'square-stroke', 'star-stroke', 'sushi']

Another PR will try to fix some of these issues.

Compare local file when possible to check modified iconset (and avoid Github rate limits).
Fetch openmaptiles POIs schema and compare it too.
Copy link
Member

@pathmapper pathmapper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea!

sources_list.py Outdated
maki_names = [x.replace('.svg', '') for x in maki_names]

omt_unused = set(omt_poi_class).difference(iconset_names)
omt_missing = set(iconset_names).difference(omt_poi_class)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
omt_missing = set(iconset_names).difference(omt_poi_class)
omt_missing = set(iconset_names).difference(omt_poi_class).difference(omt_poi_subclass)

subclass could be used for styling as well, so they are not missing in OMT.

Also there are some values which are both class and subclass, e.g. bar -> https://github.com/openmaptiles/openmaptiles/blob/dfd20c647c1a20e45e5ac869d3769289db17979b/layers/poi/poi.yaml#L71

What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I had just scratched the surface of the problem, so I pushed the script in this state as a base for future experimentations.

OSM Liberty style uses icons very basically: it's just "icon-image": "{class}_11".
In the future the subclass could be used, yes. But how?

  • specify an icon for each subclass (or maybe for each class-subclass pair)
    => are there some features with an empty subclass? if so, do we need a fallback?
    => will we accept to duplicate lots of icons? or can we create aliases in sprite.json?
  • for each subclass (or class-subclass pair), create rules in the style that select an icon

...what are your thoughts?

Additional reflections:

  • Other OMT layers might have point features worthy of icons (aero things for instance)
  • We don't use any of the _15 sprites!

@pathmapper
Copy link
Member

I thought I had just scratched the surface of the problem, so I pushed the script in this state as a base for future experimentations.

OK, cool, no worries. But I wouldn't merge it like it is currently, because this could lead to confusion (although I find it helpful).

...what are your thoughts?

-> #113 (comment)

Other OMT layers might have point features worthy of icons (aero things for instance)

-> #114

We don't use any of the _15 sprites!

-> #115

@Caerbannog
Copy link
Contributor Author

I have applied your suggestion, then fixed merge conflicts (the name of _15 files had changed).

The source file is now poi.yaml instead of mapping.yaml. I didn't spend enough time understanding how OpenMapTiles work last time. And I still didn't spend enough time this time.

The script output is now the following.
It's more consistent with https://openmaptiles.org/schema/#poi but not as precise as I would have wished.
Ideally the matching approach should be changed to check class AND subclass simultaneously.

omt_poi_class=dict_keys(['shop', 'town_hall', 'golf', 'fast_food', 'park', 'bus', 'railway', 'aerialway', 'entrance', 'campsite', 'laundry', 'grocery', 'library', 'college', 'lodging', 'ice_cream', 'post', 'cafe', 'school', 'alcohol_shop', 'bar', 'harbor', 'car', 'hospital', 'cemetery', 'attraction', 'beer', 'music', 'stadium', 'art_gallery', 'clothing_store', 'swimming', 'castle', 'atm'])
omt_poi_subclass=['accessories', 'antiques', 'beauty', 'bed', 'boutique', 'camera', 'carpet', 'charity', 'chemist', 'coffee', 'computer', 'convenience', 'copyshop', 'cosmetics', 'garden_centre', 'doityourself', 'erotic', 'electronics', 'fabric', 'florist', 'frozen_food', 'furniture', 'video_games', 'video', 'general', 'gift', 'hardware', 'hearing_aids', 'hifi', 'ice_cream', 'interior_decoration', 'jewelry', 'kiosk', 'locksmith', 'lamps', 'mall', 'massage', 'motorcycle', 'mobile_phone', 'newsagent', 'optician', 'outdoor', 'paint', 'perfumery', 'perfume', 'pet', 'photo', 'second_hand', 'shoes', 'sports', 'stationery', 'tailor', 'tattoo', 'ticket', 'tobacco', 'toys', 'travel_agency', 'watches', 'weapons', 'wholesale', 'townhall', 'public_building', 'courthouse', 'community_centre', 'golf', 'golf_course', 'miniature_golf', 'fast_food', 'food_court', 'park', 'bbq', 'bus_stop', 'bus_station', 'station', 'halt', 'tram_stop', 'subway', 'station', 'subway_entrance', 'train_station_entrance', 'camp_site', 'caravan_site', 'laundry', 'dry_cleaning', 'supermarket', 'deli', 'delicatessen', 'department_store', 'greengrocer', 'marketplace', 'books', 'library', 'university', 'college', 'hotel', 'motel', 'bed_and_breakfast', 'guest_house', 'hostel', 'chalet', 'alpine_hut', 'dormitory', 'chocolate', 'confectionery', 'post_box', 'post_office', 'parcel_locker', 'cafe', 'school', 'kindergarten', 'alcohol', 'beverages', 'wine', 'bar', 'nightclub', 'marina', 'dock', 'car', 'car_repair', 'car_parts', 'taxi', 'hospital', 'nursing_home', 'clinic', 'grave_yard', 'cemetery', 'attraction', 'viewpoint', 'biergarten', 'pub', 'music', 'musical_instrument', 'american_football', 'stadium', 'soccer', 'art', 'artwork', 'gallery', 'arts_centre', 'bag', 'clothes', 'swimming_area', 'swimming', 'castle', 'ruins', 'atm']

118 names in our iconset
34 classes in OpenMapTiles
146 subclasses in OpenMapTiles
212 names in Maki

1 classes in OpenMapTiles unused by our iconset:
['atm']

122 subclasses in OpenMapTiles unused by our iconset:
['accessories', 'alcohol', 'alpine_hut', 'antiques', 'art', 'arts_centre', 'artwork', 'atm', 'bag', 'bbq', 'beauty', 'bed', 'bed_and_breakfast', 'beverages', 'biergarten', 'books', 'boutique', 'bus_station', 'bus_stop', 'camera', 'camp_site', 'car_parts', 'car_repair', 'caravan_site', 'carpet', 'chalet', 'charity', 'chemist', 'chocolate', 'clinic', 'clothes', 'coffee', 'community_centre', 'computer', 'confectionery', 'convenience', 'copyshop', 'cosmetics', 'courthouse', 'deli', 'delicatessen', 'department_store', 'dock', 'doityourself', 'dormitory', 'dry_cleaning', 'electronics', 'erotic', 'fabric', 'food_court', 'frozen_food', 'gallery', 'garden_centre', 'general', 'golf_course', 'grave_yard', 'greengrocer', 'guest_house', 'halt', 'hardware', 'hearing_aids', 'hifi', 'hostel', 'hotel', 'interior_decoration', 'jewelry', 'kindergarten', 'kiosk', 'lamps', 'locksmith', 'mall', 'marina', 'marketplace', 'massage', 'miniature_golf', 'mobile_phone', 'motel', 'motorcycle', 'musical_instrument', 'newsagent', 'nightclub', 'nursing_home', 'optician', 'outdoor', 'paint', 'parcel_locker', 'perfume', 'perfumery', 'pet', 'photo', 'post_box', 'post_office', 'pub', 'public_building', 'ruins', 'second_hand', 'shoes', 'sports', 'station', 'stationery', 'subway', 'subway_entrance', 'supermarket', 'swimming_area', 'tailor', 'tattoo', 'taxi', 'ticket', 'tobacco', 'townhall', 'toys', 'train_station_entrance', 'tram_stop', 'travel_agency', 'university', 'video', 'video_games', 'viewpoint', 'watches', 'weapons', 'wholesale', 'wine']

80 names in our iconset missing in OpenMapTiles:
['airfield', 'airport', 'amusement_park', 'aquarium', 'bakery', 'bank', 'baseball', 'basketball', 'bicycle', 'bicycle_rental', 'building', 'butcher', 'cinema', 'circle', 'circle_stroked', 'commercial', 'cricket', 'cross', 'dam', 'danger', 'dentist', 'doctors', 'dog_park', 'drinking_water', 'embassy', 'ferry', 'fire_station', 'fuel', 'garden', 'hairdresser', 'heart', 'heliport', 'industry', 'information', 'lighthouse', 'marker', 'monument', 'mountain', 'museum', 'parking', 'parking_garage', 'pharmacy', 'picnic_site', 'pitch', 'place_of_worship', 'playground', 'police', 'prison', 'railway_light', 'railway_metro', 'ranger_station', 'religious_christian', 'religious_jewish', 'religious_muslim', 'restaurant', 'roadblock', 'rocket', 'shelter', 'skiing', 'square', 'square_stroked', 'star', 'star_stroked', 'suitcase', 'sushi', 'telephone', 'tennis', 'theatre', 'toilets', 'triangle', 'triangle_stroked', 'veterinary', 'volcano', 'warehouse', 'waste_basket', 'water', 'wetland', 'wetland_bg', 'wheelchair', 'zoo']

103 names in Maki unused by our iconset:
['animal_shelter', 'arrow', 'bank_JP', 'barrier', 'bbq', 'beach', 'bicycle_share', 'blood_bank', 'bowling_alley', 'bridge', 'building_alt1', 'car_rental', 'car_repair', 'casino', 'castle_JP', 'caution', 'cemetery_JP', 'charging_station', 'city', 'college_JP', 'communications_tower', 'confectionery', 'construction', 'convenience', 'defibrillator', 'diamond', 'doctor', 'elevator', 'emergency_phone', 'entrance_alt1', 'farm', 'fence', 'ferry_JP', 'fire_station_JP', 'fitness_centre', 'gaming', 'garden_centre', 'gate', 'globe', 'hardware', 'highway_rest_area', 'historic', 'home', 'horse_riding', 'hospital_JP', 'hot_spring', 'jewelry_store', 'karaoke', 'landmark', 'landmark_JP', 'landuse', 'lift_gate', 'lighthouse_JP', 'logging', 'marker_stroked', 'mobile_phone', 'monument_JP', 'natural', 'observation_tower', 'optician', 'paint', 'park_alt1', 'parking_paid', 'police_JP', 'post_JP', 'racetrack', 'racetrack_boat', 'racetrack_cycling', 'racetrack_horse', 'rail', 'rail_light', 'rail_metro', 'recycling', 'religious_buddhist', 'religious_shinto', 'residential_community', 'restaurant_bbq', 'restaurant_noodle', 'restaurant_pizza', 'restaurant_seafood', 'restaurant_sushi', 'road_accident', 'school_JP', 'scooter', 'shoe', 'skateboard', 'slaughterhouse', 'slipway', 'snowmobile', 'table_tennis', 'teahouse', 'terminal', 'toilet', 'toll', 'town', 'tunnel', 'viewpoint', 'village', 'volleyball', 'watch', 'waterfall', 'watermill', 'windmill']

9 names in our iconset missing in Maki:
['bicycle_rental', 'butcher', 'doctors', 'railway', 'railway_light', 'railway_metro', 'sushi', 'toilets', 'wetland_bg']

Copy link
Member

@pathmapper pathmapper left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@pathmapper pathmapper merged commit f2c798e into maputnik:gh-pages Nov 10, 2023
1 check passed
@Caerbannog Caerbannog deleted the script branch November 16, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants