Repository navigation
Sharedmobility.ch Swisstopo API & Map
This page documents the vehicle type icon mapping used on the sharedmobility.ch map (powered by map.geo.admin.ch).
The api.sharedmobility.ch/swisstopo API provides GeoJSON data with a symbol property that maps to vehicle type icons. The actual icon images are hosted on data.geo.admin.ch and rendered on the map based on zoom level.
-
Backend-gbfs API (
api.sharedmobility.ch/swisstopo) provides GeoJSON withsymbolproperty -
geo.admin.ch loads vector style configuration from
/rest/services/api/MapServer/ch.bfe.shared-mobility/vectorStyle -
Frontend maps
symbolvalue to icon URL based on current zoom level -
Icons are loaded from
https://data.geo.admin.ch/ch.bfe.shared-mobility/icons/
The Backend-gbfs API maps GBFS form_factor and propulsion_type to internal vehicle types. Each symbol has two states: with vehicles available (colored icon) and without vehicles (gray icon with "0" suffix).
| GBFS form_factor | GBFS propulsion_type | Symbol | Description | Icon URLs |
|---|---|---|---|---|
bicycle |
human |
Bike / Bike0
|
Regular bicycle |
|
bicycle |
electric / electric_assist
|
E-Bike / E-Bike0
|
Electric bicycle |
|
cargo_bicycle |
human |
CargoBike / CargoBike0
|
Cargo bicycle |
|
cargo_bicycle |
electric / electric_assist
|
E-CargoBike / E-CargoBike0
|
Electric cargo bicycle |
|
scooter |
human |
Scooter / Scooter0
|
Kick scooter |
|
scooter |
electric |
E-Scooter / E-Scooter0
|
Electric scooter |
|
moped |
combustion |
Moped / Moped0
|
Combustion moped |
|
moped |
electric |
E-Moped / E-Moped0
|
Electric moped |
|
car |
combustion / hybrid
|
Car / Car0
|
Combustion car |
|
car |
electric / electric_assist
|
E-Car / E-Car0
|
Electric car |
|
| - | - |
Taxi / Taxi0
|
Taxi (not commonly used) |
|
| - | - |
E-Taxi / E-Taxi0
|
Electric taxi (not commonly used) |
|
other |
human |
Other / Other0
|
Other vehicle type |
|
other |
electric |
E-Other / E-Other0
|
Electric other vehicle type |
|
Each symbol has 3 icon sizes for different zoom levels:
| Icon Size | Resolution Range | Use Case |
|---|---|---|
| 50px | 0 - 20 | High zoom level (close view, most detail) |
| 40px | 20 - 250 | Medium zoom level |
| 30px | 250+ | Low zoom level (far view, overview) |
All icons follow this URL pattern:
https://data.geo.admin.ch/ch.bfe.shared-mobility/icons/{Symbol}_{Size}.png
Examples:
https://data.geo.admin.ch/ch.bfe.shared-mobility/icons/E-Bike_50px.pnghttps://data.geo.admin.ch/ch.bfe.shared-mobility/icons/E-Bike_40px.pnghttps://data.geo.admin.ch/ch.bfe.shared-mobility/icons/E-Bike_30px.pnghttps://data.geo.admin.ch/ch.bfe.shared-mobility/icons/E-Bike0_50px.png
Example GeoJSON feature from api.sharedmobility.ch/swisstopo:
{
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [7.4474, 46.9479]
},
"properties": {
"symbol": "E-Bike",
"provider_id": "publibike",
"name": "Bern Bahnhof",
"count": 12,
"address": "Bahnhofplatz, Bern"
}
}For stations with multiple vehicle types, the Backend-gbfs API selects the symbol based on enum priority. The priority is determined by the Kotlin enum declaration order in the source code, where the last enum value has the highest priority.
VehicleType Priority (lowest to highest):
| Priority | VehicleType |
|---|---|
| 1 (lowest) | OTHER |
| 2 | SCOOTER |
| 3 | ESCOOTER |
| 4 | BIKE |
| 5 | EBIKE |
| 6 | CARGOBIKE |
| 7 | ECARGOBIKE |
| 8 | MOPED |
| 9 | EMOPED |
| 10 | CAR |
| 11 (highest) | ECAR |
Implementation: The code uses maxOf { it } on the VehicleType enum, selecting the enum with the highest ordinal value.
Example:
- Station has: 5 E-Scooters + 0 E-Cars
- Symbol selected:
E-Car0(becauseECARhas higher priority thanESCOOTER, even with 0 count) - Icon displayed: Gray E-Car icon with "0" suffix