Skip to content

Sharedmobility.ch Swisstopo API & Map

Christian Gutknecht edited this page Feb 4, 2026 · 1 revision

This page documents the vehicle type icon mapping used on the sharedmobility.ch map (powered by map.geo.admin.ch).

Overview

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.

Data Flow

  1. Backend-gbfs API (api.sharedmobility.ch/swisstopo) provides GeoJSON with symbol property
  2. geo.admin.ch loads vector style configuration from /rest/services/api/MapServer/ch.bfe.shared-mobility/vectorStyle
  3. Frontend maps symbol value to icon URL based on current zoom level
  4. Icons are loaded from https://data.geo.admin.ch/ch.bfe.shared-mobility/icons/

GBFS to Symbol Mapping and 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 Bike Bike0
bicycle electric / electric_assist E-Bike / E-Bike0 Electric bicycle E-Bike E-Bike0
cargo_bicycle human CargoBike / CargoBike0 Cargo bicycle CargoBike CargoBike0
cargo_bicycle electric / electric_assist E-CargoBike / E-CargoBike0 Electric cargo bicycle E-CargoBike E-CargoBike0
scooter human Scooter / Scooter0 Kick scooter Scooter Scooter0
scooter electric E-Scooter / E-Scooter0 Electric scooter E-Scooter E-Scooter0
moped combustion Moped / Moped0 Combustion moped Moped Moped0
moped electric E-Moped / E-Moped0 Electric moped E-Moped E-Moped0
car combustion / hybrid Car / Car0 Combustion car Car Car0
car electric / electric_assist E-Car / E-Car0 Electric car E-Car E-Car0
- - Taxi / Taxi0 Taxi (not commonly used) Taxi Taxi0
- - E-Taxi / E-Taxi0 Electric taxi (not commonly used) E-Taxi E-Taxi0
other human Other / Other0 Other vehicle type Other Other0
other electric E-Other / E-Other0 Electric other vehicle type E-Other E-Other0

Icon Sizes and Zoom Levels

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)

Icon URL Pattern

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.png
  • https://data.geo.admin.ch/ch.bfe.shared-mobility/icons/E-Bike_40px.png
  • https://data.geo.admin.ch/ch.bfe.shared-mobility/icons/E-Bike_30px.png
  • https://data.geo.admin.ch/ch.bfe.shared-mobility/icons/E-Bike0_50px.png

GeoJSON Example

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"
  }
}

Multi-Vehicle Type Stations

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 (because ECAR has higher priority than ESCOOTER, even with 0 count)
  • Icon displayed: Gray E-Car icon with "0" suffix