Matching engine E.1.1

Swiss ATLAS stops

ATLAS is the official registry of Swiss public transport locations. This page describes how the Swiss integration selects ATLAS platforms and turns them into the engine's source records. None of it is required by the source-neutral matching core.

The integration downloads the current-date traffic-point export from opentransportdata.swiss, keeps the boarding platforms that are Swiss, lie inside Switzerland and have not expired, and writes them to data/raw/stops_ATLAS.csv in the workspace. The same platforms are later used to resolve GTFS stops (E1.2).

The ATLAS selection is cached as its own acquisition stage, so an ATLAS-only change does not reparse the GTFS feed (E5.1).

Filters

flowchart LR A["Downloaded export"] -->|"UIC country 85"| B["Swiss numbers"] B -->|"inside the boundary"| C["In Switzerland"] C -->|"valid today"| D["Current"] D -->|"BOARDING_PLATFORM"| E["Imported platforms"]
# Filter Keeps rows where Counters in atlas_filtering
1 Country uicCountryCode == 85 raw_total, eliminated_by_uic_number, after_uic_number_filter
2 Geography the position lies inside the Swiss boundary polygon eliminated_by_geo, after_geo_filter
3 Validity validTo is today or later eliminated_by_validity, after_validity_filter
4 Type trafficPointElementType == BOARDING_PLATFORM eliminated_by_type, after_type_filter, type_counts

The geography filter exists because some stops carry Swiss UIC numbers but stand abroad. It keeps the stops inside the switzerland.geojson boundary or on its edge; the GTFS stops go through the same test in adapters/geo_utils.py. Acquisition downloads the boundary again on every run and replaces the cached copy only with one that reads as a polygon, so a failed download keeps the last good boundary. The type filter drops BOARDING_AREA records, which describe areas rather than platforms; type_counts records every type that reached the filter, so a newly introduced upstream type stays visible.

The counters are exported in the bundle's atlas_filtering extension and acquisition metadata.

The download must contain sloid, uicCountryCode, wgs84North, wgs84East and validTo; without one of them, atlas.prepare fails with ATLAS CSV lacks required columns: [...]. Other missing columns weaken the result without stopping the run, so they are reported as warnings in atlas_filtering.warnings and the bundle's metadata.warnings:

Missing column Effect
trafficPointElementType The type filter is skipped and every traffic point type is kept
designationOfficial, designation, number, servicePointBusinessOrganisation, servicePointBusinessOrganisationAbbreviationEn, servicePointBusinessOrganisationDescriptionEn The name, platform code, UIC number or operator of every record is empty

The warnings belong to the cached ATLAS selection, so a run that reuses it reports them again.

The ATLAS file

Key columns of data/raw/stops_ATLAS.csv, with a real example:

Column Meaning Example
sloid The platform's SLOID ch:1:sloid:3000:501:33
number The station's UIC number 8503000
designationOfficial The official stop name Zürich HB
designation The platform code 33
wgs84North, wgs84East Position (WGS84) 47.37852, 8.53676
validFrom, validTo Validity period 2024-11-21, 9999-12-31
servicePointBusinessOrganisationAbbreviationEn The operator's abbreviation SBB

Records for the engine

adapters.atlas.atlas_records() turns each row into a SourceStop:

SourceStop field From Example
key atlas: + SLOID atlas:ch:1:sloid:3000:501:33
name designationOfficial Zürich HB
platform_code designation 33
station_ref number 8503000
operator, operator_id, operator_name the business organisation's English abbreviation, identifier and description SBB
references the SLOID (scope stop) and the UIC number (scope station)

A row with a missing SLOID or with non-finite or out-of-range coordinates fails validation; it never becomes a stop at (0, 0). adapters.atlas.atlas_state() then groups platforms that share a UIC number and platform code into duplicate groups. When it imports a bundle, the review application turns the atlas: keys back into SLOIDs.

Where the platforms are used

  1. Stop matching: the records are the source side of E2.
  2. GTFS identity: GTFS stop_ids are resolved to these SLOIDs (E1.2).
  3. Review website: the map, the Routes pages and the GTFS identity map show them, through the imported bundle (A2.6).

Code

File Role
src/osm_public_transport_matcher/adapters/get_atlas_data.py get_atlas_stops(): download and filters
src/osm_public_transport_matcher/adapters/atlas.py Records and duplicate groups