Skip to content

StopSeqCoord-Request

Liefert die Koordinaten­sequenz (Polylinie) und die Halte einer konkreten Fahrt zwischen zwei Punkten. Parameter sind identisch zu TripStopTimes-Request — Rückgabe ist jedoch auf Geometrie/Halt optimiert, ohne Zeitangaben im Vordergrund.

Endpoint

  • Pfad: XML_STOPSEQCOORD_REQUEST
  • Methode: GET

Obligatorische Parameter

ParameterFormatBeschreibung
line<Teilnetz>:<DIVALiniennummer>:<Ergänzung>:<Richtung>Linien-ID — siehe Line-Input
stopIDHalte-IDAusgangshalt
tripCodeStringFahrt-Schlüssel aus einer Trip-Request-Antwort
dateYYYYMMDDAbfahrtsdatum
timeHHMMAbfahrtszeit am stopID

Optionale Parameter

ParameterWerteBeschreibung
tStOTTypeALL (Default) | NEXT | PREVIOUSFilter auf die Halte-Sequenz
useRealtime1Echtzeit-Anreicherung (falls verfügbar)

Beispiel-Request

GET /XML_STOPSEQCOORD_REQUEST
    ?outputFormat=JSON
    &line=apb:05136:12b:R
    &stopID=de:05911:5494
    &tripCode=20250125-0822-196-01
    &date=20250125
    &time=0822
    &tStOTType=NEXT

Antwort (Beispiel)

json
{
  "stops": [
    { "id": "de:05513:1001", "name": "Essen Hbf", "coord": { "lat": 51.4513, "lon": 7.0128 } },
    { "id": "de:05513:1020", "name": "Essen Kray", "coord": { "lat": 51.4550, "lon": 7.0800 } }
  ],
  "polyline": [[51.4513, 7.0128], [51.4550, 7.0800]]
}

JavaScript-Beispiele

js
async function drawTripSegment(map, tripMeta) {
  const base = 'https://server:port/virtuellesVerzeichnis/XML_STOPSEQCOORD_REQUEST'
  const usp = new URLSearchParams({ outputFormat: 'JSON', tStOTType: 'NEXT', ...tripMeta })
  const res = await fetch(`${base}?${usp}`)
  const data = await res.json()
  L.polyline(data.polyline, { color: 'blue', weight: 4 }).addTo(map)
  for (const s of data.stops) {
    L.circleMarker([s.coord.lat, s.coord.lon], { radius: 4 }).bindTooltip(s.name).addTo(map)
  }
}
js
async function tripAsGeoJson(tripMeta) {
  const base = 'https://server:port/virtuellesVerzeichnis/XML_STOPSEQCOORD_REQUEST'
  const usp = new URLSearchParams({ outputFormat: 'JSON', ...tripMeta })
  const res = await fetch(`${base}?${usp}`)
  const data = await res.json()
  return {
    type: 'Feature',
    geometry: { type: 'LineString', coordinates: data.polyline.map(([lat, lon]) => [lon, lat]) },
    properties: { stops: data.stops.map(s => s.id) }
  }
}

Hinweise

  • Für die Geometrie einer ganzen Linie (nicht einer Fahrt) siehe Geoobject-Request.
  • Für Zeiten je Halt siehe TripStopTimes-Request — gleicher Parametersatz, andere Antwortstruktur.
  • Die polyline liegt in [lat, lon]-Reihenfolge — GeoJSON erwartet [lon, lat].