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

Missing POI icons #64

Open
pathmapper opened this issue Dec 1, 2019 · 16 comments · Fixed by #89
Open

Missing POI icons #64

pathmapper opened this issue Dec 1, 2019 · 16 comments · Fixed by #89

Comments

@pathmapper
Copy link
Member

pathmapper commented Dec 1, 2019

There are some POIs without an icon, e.g.:

grafik

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

@kylebarron
Copy link
Contributor

Do you have an idea of how many new maki icons there are compared to the existing sprite?

@kylebarron
Copy link
Contributor

kylebarron commented Dec 13, 2019

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')])

@pathmapper
Copy link
Member Author

@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:

  1. Take the actions for these icons described above and document name changes in the Readme:
    https://github.com/maputnik/osm-liberty#icon-design

  2. 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

  3. 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?

@kylebarron
Copy link
Contributor

kylebarron commented Dec 15, 2019

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.

@pathmapper
Copy link
Member Author

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.

@kylebarron
Copy link
Contributor

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

"toilet_11": {
"height": 17,
"pixelRatio": 1,
"width": 17,
"x": 320,
"y": 106
},
"toilet_15": {
"height": 21,
"pixelRatio": 1,
"width": 21,
"x": 63,
"y": 169
},

@pathmapper
Copy link
Member Author

pathmapper commented Jan 8, 2020

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?

@kylebarron
Copy link
Contributor

But OpenMapTiles is using toilets with an s
image

@pathmapper
Copy link
Member Author

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.

@pyrog
Copy link

pyrog commented Oct 31, 2020

@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).

@pathmapper
Copy link
Member Author

@pyrog nice spot!

Fixed in #89

@pyrog
Copy link

pyrog commented Oct 31, 2020

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 to toilet_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

@gitcatrat
Copy link

Is there something blocking this?

@StephenAtty
Copy link

Any updates on when the YAML POIs which aren't in OSM Liberty will be added?

@pathmapper
Copy link
Member Author

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.

Caerbannog added a commit to liberty-rider/osm-liberty that referenced this issue Oct 13, 2023
Replace dashes with underscores everywhere to match the OpenMapTiles schema.
Fix other name inconsistencies with OpenMapTiles (american_football, doctors, toilets).
Inonsistency: stroke vs stroked. Apply the Maki naming (stroked).

Inspired by issue maputnik#64.
@pathmapper
Copy link
Member Author

Contributions also for POI subclass welcome, see #119 for an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants