Skip to content

Commit afa5096

Browse files
authored
add docs for more POI icons. (#126)
* add section on QRank ranking for POIs. * add section on generating custom spritesheets with spreet.
1 parent 60153a3 commit afa5096

File tree

2 files changed

+44
-9
lines changed

2 files changed

+44
-9
lines changed

basemaps/flavors.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ let flavor = {...namedFlavor("light"),buildings:"red"}
6060

6161
## Sprites
6262

63+
### Default Sprites
64+
6365
Each of the five default Flavors has an associated spritesheet. Sprites are necessary for displaying:
6466

6567
* Townspots - circles for cities and named places at low zoom levels.
@@ -77,8 +79,30 @@ make # builds all 5 default flavor spritesheets in dist/
7779
./target/release/spritegen refill.svg flavors/custom.json dist/custom
7880
```
7981

82+
### Custom Sprites
83+
8084
A custom spritesheet (`custom.json`, `custom.png`, `custom@2x.json`, `custom@2x.png`) can be referenced from a [MapLibre JSON style](maplibre):
8185

8286
```js
8387
sprite: "https://example.com/assets/custom"
8488
```
89+
90+
Sprites can be replaced with custom sets by assigning new icons to the same sprite names. Sprite names can be found in [light.json](https://github.com/protomaps/basemaps/blob/main/sprites/flavors/light.json):
91+
92+
```csv
93+
townspot
94+
capital
95+
arrow
96+
generic_shield-1char
97+
...
98+
```
99+
100+
To generate a spritesheet with a sigle icon based on the CC0 [Maki icon set created by Mapbox](https://github.com/mapbox/maki), use the [spreet](https://github.com/flother/spreet) command line tool:
101+
102+
```sh
103+
mv airport.svg icons/aerodrome.svg
104+
spreet icons output
105+
# creates output.json and output.png
106+
spreet --retina icons output@2x
107+
#creates output@2x.json and output@2x.png, used on HiDPI displays
108+
```

basemaps/layers.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -204,11 +204,11 @@ _NOTE: The list of kind values is not comprehensive as some raw OSM tag values a
204204
| `airfield` | |
205205
| `alpine_hut` | |
206206
| `amusement_ride` | |
207-
| `animal` | |
207+
| `animal` | <Icon kind="animal" :sprites="sprites"/> |
208208
| `art` | |
209-
| `artwork` | |
209+
| `artwork` | <Icon kind="artwork" :sprites="sprites"/> |
210210
| `atm` | |
211-
| `attraction` | |
211+
| `attraction` | <Icon kind="attraction" :sprites="sprites"/> |
212212
| `atv` | |
213213
| `baby_hatch` | |
214214
| `bakery` | |
@@ -222,11 +222,12 @@ _NOTE: The list of kind values is not comprehensive as some raw OSM tag values a
222222
| `bicycle_repair_station` | |
223223
| `boat_storage` | |
224224
| `bookmaker` | |
225-
| `books` | |
225+
| `books` | <Icon kind="books" :sprites="sprites"/> |
226+
| `building` | <Icon kind="building" :sprites="sprites"/> |
226227
| `bureau_de_change` | |
227228
| `bus_stop` | |
228229
| `butcher` | |
229-
| `cafe` | |
230+
| `cafe` | <Icon kind="cafe" :sprites="sprites"/> |
230231
| `camp_site` | |
231232
| `car_parts` | |
232233
| `car_rental` | |
@@ -243,13 +244,13 @@ _NOTE: The list of kind values is not comprehensive as some raw OSM tag values a
243244
| `clothes` | |
244245
| `college` | <Icon kind="fire_station" :sprites="sprites"/> |
245246
| `computer` | |
246-
| `convenience` | |
247+
| `convenience` | <Icon kind="convenience" :sprites="sprites"/> |
247248
| `customs` | |
248249
| `dentist` | |
249250
| `district` | |
250251
| `doctors` | |
251252
| `dog_park` | |
252-
| `drinking_water` | |
253+
| `drinking_water` | <Icon kind="drinking_water" :sprites="sprites"/> |
253254
| `emergency_phone` | |
254255
| `fashion` | |
255256
| `firepit` | |
@@ -260,6 +261,7 @@ _NOTE: The list of kind values is not comprehensive as some raw OSM tag values a
260261
| `fuel` | |
261262
| `gambling` | |
262263
| `garden_centre` | |
264+
| `garden` | <Icon kind="garden" :sprites="sprites"/> |
263265
| `gift` | |
264266
| `golf_course` | |
265267
| `golf` | |
@@ -322,12 +324,12 @@ _NOTE: The list of kind values is not comprehensive as some raw OSM tag values a
322324
| `stationery` | |
323325
| `studio` | |
324326
| `summer_toboggan` | |
325-
| `supermarket` | |
327+
| `supermarket` | <Icon kind="supermarket" :sprites="sprites"/> |
326328
| `swimming_area` | |
327329
| `taxi` | |
328330
| `telephone` | |
329331
| `tobacco` | |
330-
| `toilets` | |
332+
| `toilets` | <Icon kind="toilets" :sprites="sprites"/> |
331333
| `townhall` | <Icon kind="townhall" :sprites="sprites"/> |
332334
| `trail_riding_station` | |
333335
| `travel_agency` | |
@@ -342,6 +344,15 @@ _NOTE: The list of kind values is not comprehensive as some raw OSM tag values a
342344
| `wilderness_hut` | |
343345
| `zoo` | <Icon kind="zoo" :sprites="sprites"/> |
344346

347+
348+
### Ranking
349+
350+
Points of interest are sourced from OpenStreetMap, and the `wikidata` tag is joined with the [QRank](https://github.com/brawer/wikidata-qrank) dataset to determine their prominence. The determined QRank is then used to move prominent POIs to lower zoom levels.
351+
352+
For example, the station [Alexanderplatz](https://www.openstreetmap.org/node/3908141014) has Wikidata ID [Q698497](https://www.wikidata.org/wiki/Q698497) and a QRank of 37850. A neighboring station, [Jannowitzbrücke](https://www.openstreetmap.org/node/21487225) has Wikidata ID [Q1647893](https://www.wikidata.org/wiki/Q1647893) and a QRank of 11176. Alexanderplatz station thus appears at a lower zoom level than other stations.
353+
354+
To view or modify the mapping from QRank thresholds to zoom levels, see [Pois.java](https://github.com/protomaps/basemaps/blob/main/tiles/src/main/java/com/protomaps/basemap/layers/Pois.java).
355+
345356
## roads
346357

347358
Linear transportation features designed for movement, including highways, streets,

0 commit comments

Comments
 (0)