Open pathmapper opened 4 years ago
Do you have an idea of how many new maki icons there are compared to the existing sprite?
OSM liberty defines the following categories in its iconset.json
:
['Unsorted',
'Shopping',
'Eating',
'Sport',
'Education',
'Leisure',
'Transport',
'Religion',
'Public Service',
'Nature',
'Health',
'Tourism']
And here's the set difference of icons that are in Maki but not in the osm-liberty iconset
['american-football-11.svg',
'barrier-11.svg',
'bbq-11.svg',
'beach-11.svg',
'bicycle-share-11.svg',
'blood-bank-11.svg',
'bowling-alley-11.svg',
'bridge-11.svg',
'building-alt1-11.svg',
'car-rental-11.svg',
'car-repair-11.svg',
'casino-11.svg',
'charging-station-11.svg',
'city-11.svg',
'communications-tower-11.svg',
'confectionery-11.svg',
'convenience-11.svg',
'defibrillator-11.svg',
'emergency-phone-11.svg',
'entrance-alt1-11.svg',
'farm-11.svg',
'fence-11.svg',
'fitness-centre-11.svg',
'florist-11.svg',
'furniture-11.svg',
'gaming-11.svg',
'garden-centre-11.svg',
'globe-11.svg',
'hardware-11.svg',
'home-11.svg',
'horse-riding-11.svg',
'jewelry-store-11.svg',
'karaoke-11.svg',
'landmark-11.svg',
'landuse-11.svg',
'logging-11.svg',
'marker-stroked-11.svg',
'mobile-phone-11.svg',
'natural-11.svg',
'optician-11.svg',
'paint-11.svg',
'park-alt1-11.svg',
'rail-11.svg',
'rail-light-11.svg',
'rail-metro-11.svg',
'recycling-11.svg',
'religious-buddhist-11.svg',
'residential-community-11.svg',
'restaurant-noodle-11.svg',
'restaurant-pizza-11.svg',
'restaurant-seafood-11.svg',
'scooter-11.svg',
'shoe-11.svg',
'skateboard-11.svg',
'slaughterhouse-11.svg',
'slipway-11.svg',
'snowmobile-11.svg',
'square-stroked-11.svg',
'star-stroked-11.svg',
'table-tennis-11.svg',
'teahouse-11.svg',
'town-11.svg',
'viewpoint-11.svg',
'village-11.svg',
'volleyball-11.svg',
'watch-11.svg',
'waterfall-11.svg',
'watermill-11.svg',
'windmill-11.svg']
Generation code. Could be helpful again in the future:
import requests
current_iconset_url = 'https://raw.githubusercontent.com/maputnik/osm-liberty/gh-pages/iconset.json'
r = requests.get(current_iconset_url)
iconset = r.json()
keys = [list(group['svgs'].keys()) for group in iconset['iconGroups']]
iconset_names = [item for sublist in keys for item in sublist]
maki_url = 'https://api.github.com/repos/mapbox/maki/contents/icons'
r = requests.get(maki_url)
res = r.json()
maki_names = [x['name'] for x in res]
# Maki names are hyphenated; iconset names are both hyphenated and underscored
# I'll take the iconset names and change the underscores to hyphens
iconset_names = [x.replace('_', '-') for x in iconset_names]
diff = set(maki_names).difference(iconset_names)
sorted([x for x in diff if not x.endswith('-15.svg')])
@kylebarron wow, thanks, super helpful!
Used your script to check if there are icon names in our iconset which are not in Maki:
'america-football-11.svg' -> typo (american-football) -> correct typo on our side 'bicycle-rental-11.svg' -> this is Maki bicycle-share -> keep it 'butcher-11.svg' -> this is Maki slaughterhouse -> keep it 'railway-11.svg' -> this is Maki rail -> keep it 'railway-light-11.svg' -> not used -> check if we can use it for a certain class 'railway-metro-11.svg' -> not used -> check if we can use it for a certain class 'square-stroke-11.svg' -> not used -> remove it 'star-stroke-11.svg' -> not used -> remove it
To Do:
Take the actions for these icons described above and document name changes in the Readme: https://github.com/maputnik/osm-liberty#icon-design
Check if we could use currently unused Maki icons for some POIs.
We are using the class
field to select icons, e.g.:
https://github.com/maputnik/osm-liberty/blob/gh-pages/style.json#L1357
From https://openmaptiles.org/schema/#poi
"If there is no more general class for the subclass this field will contain the same value as subclass"
The available classes (and subclasses) are here:
https://github.com/openmaptiles/openmaptiles/blob/master/layers/poi/class.sql
https://github.com/openmaptiles/openmaptiles/blob/master/layers/poi/mapping.yaml
E.g.
Maki -> Class
fitness-centre-11.svg -> sports_centre
volleyball-11.svg -> volleyball
Add the python script provided by @kylebarron to the repository (as .py
file) and document how to use it in the readme: https://github.com/maputnik/osm-liberty#icon-design
@kylebarron interested in working on any of these points?
When OSM POI classes and maki icons have different names for the same thing, where do you rename that? I.e. as shown above, there are OSM class names (or at least OpenMapTiles class names) that are different from Maki's names. We're not going to rename the source vector data, so either provide a crosswalk or rename the Maki icons?
I guess I'm still a little fuzzy on how to work with Maki.
This seems tedious and it's not at the top of my list right now, since my maps won't be POI-focused, though I'd be happy to provide a PR with the script, and I could convert it to be a CLI script.
where do you rename that? ... rename the Maki icons?
Yes, exactly. Download the Maki icon, rename it, upload it here: https://github.com/maputnik/osm-liberty/tree/gh-pages/svgs/svgs_iconset and adapt the https://github.com/maputnik/osm-liberty/blob/gh-pages/iconset.json.
This seems tedious and it's not at the top of my list right now, since my maps won't be POI-focused, though I'd be happy to provide a PR with the script, and I could convert it to be a CLI script.
Sure, as you wish. Every contribution would be helpful and welcome. A CLI script would be awesome.
I'm not sure why it isn't listed as output of the above script, but OpenMapTiles defines class=toilets
, while the Maki icons/OSM Liberty iconset define toilet
(without the s), so those don't show on the map
https://github.com/maputnik/osm-liberty/blob/d4e6b6c5243aca39763ed61f52969f3d0ba8bc85/sprites/osm-liberty.json#L1514-L1527
I'm not sure why it isn't listed as output of the above script
The script is comparing Maki icons and the OSM Liberty iconset. If both are using toilet
that's right that the script doesn't list it, right?
But OpenMapTiles is using toilets
with an s
Yep, this why the icon is not displayed. I was referring to why the output of the script is not listing toilet. The script is not taking OpenMapTiles classes into account.
@pathmapper Thanks to guide me to the appropriate repo 😃
town-hall_11.svg is in osm-liberty repository, but it isn't rendered (i.e. in Maputnik or in Project of the month).
@pyrog nice spot!
Fixed in #89
Thank you again 😃
toilet_11.svg is in osm-liberty repository, but the tile need toilets_11.svg
(i.e. in Maputnik).
Symlink toilets_11.svg
totoilet_11.svg
to fix this ?
drinking_water_11.svg is in osm-liberty repository, but it isn't rendered.
fire_station_11.svg is in osm-liberty repository, but it isn't rendered (i.e. in Maputnik).
doctors_11.svg is in osm-liberty repository, but it isn't rendered (i.e. in Maputnik).
POI defined in [openmaptiles/layers/poi/mapping.yaml] are not (yet) rendered in OSM Liberty : (https://github.com/openmaptiles/openmaptiles/blob/master/layers/poi/mapping.yaml)
# amenity values , see http://taginfo.openstreetmap.org/keys/amenity#values
def_poi_mapping_amenity: &poi_mapping_amenity
- bicycle_parking
- doctors
- ferry_terminal
- fire_station
- motorcycle_parking
- recycling
- toilets
# barrier values , see http://taginfo.openstreetmap.org/keys/barrier#values
def_poi_mapping_barrier: &poi_mapping_barrier
- bollard
- cycle_barrier
- gate
- lift_gate
- sally_port
- stile
- toll_booth
# landuse values , see http://taginfo.openstreetmap.org/keys/landuse#values
def_poi_mapping_landuse: &poi_mapping_landuse
- basin
- brownfield
- reservoir
- winter_sports
# leisure values , see http://taginfo.openstreetmap.org/keys/leisure#values
def_poi_mapping_leisure: &poi_mapping_leisure
- escape_game
- hackerspace
- ice_rink
- sports_centre
- swimming_pool
# sport values , see http://taginfo.openstreetmap.org/keys/sport#values
def_poi_mapping_sport: &poi_mapping_sport
- athletics
- boules
- boxing
- climbing
- climbing_adventure
- cycling
- equestrian
- free_flying
- judo
- multi
- orienteering
- paintball
- running
- sailing
- scuba_diving
- shooting
# tourism values , see http://taginfo.openstreetmap.org/keys/tourism#values
def_poi_mapping_tourism: &poi_mapping_tourism
- theme_park
Is there something blocking this?
Any updates on when the YAML POIs which aren't in OSM Liberty will be added?
Is there something blocking this?
No.
Any updates on when the YAML POIs which aren't in OSM Liberty will be added?
Someone has to sort things out and add the missing icons, PRs welcome.
Contributions also for POI subclass welcome, see https://github.com/maputnik/osm-liberty/pull/119 for an example.
There are some POIs without an icon, e.g.:
There are some new Maki icons, so it would be good to check if there are any new icons we could use for missing ones:
OpenMapTiles POI layer: https://github.com/openmaptiles/openmaptiles/tree/master/layers/poi
Maki icons: https://labs.mapbox.com/maki-icons/
Currently used iconset: https://github.com/maputnik/osm-liberty/blob/gh-pages/iconset.json
SVGs for the used iconset: https://github.com/maputnik/osm-liberty/tree/gh-pages/svgs/svgs_iconset
How to add new icons to the sprites used for the style: https://github.com/maputnik/osm-liberty#icon-design