Skip to content

StopSeqCoord-Request

Liefert die Koordinaten einer Haltestellensequenz (z. B. für die Visualisierung eines Linienverlaufs zwischen zwei Stationen).

Endpoint

  • Pfad: XML_STOPSEQCOORD_REQUEST
  • Methode: GET

Parameter (Auszug)

ParameterTypBeschreibung
fromStopIdstringStart-Haltestelle
toStopIdstringZiel-Haltestelle
lineIdstringLinien-ID/Variante (optional)
formatstringKoordinatenformat, z. B. WGS84

Beispiel-Request

GET /XML_STOPSEQCOORD_REQUEST?fromStopId=de:05513:1001&toStopId=de:05513:1010&format=WGS84

Antwort (Beispiel)

json
{
  "coords": [
    { "lat": 51.4513, "lon": 7.0128 },
    { "lat": 51.4520, "lon": 7.0180 }
  ]
}

JavaScript-Beispiel (Leaflet)

js
async function drawSegment(map, fromStopId, toStopId) {
  const base = 'https://server:port/virtuellesVerzeichnis/XML_STOPSEQCOORD_REQUEST'
  const usp = new URLSearchParams({ fromStopId, toStopId, format: 'WGS84' })
  const res = await fetch(`${base}?${usp}`)
  const data = await res.json()
  const latlngs = data.coords.map(c => [c.lat, c.lon])
  L.polyline(latlngs, { color: 'blue' }).addTo(map)
}

title: StopSeqCoord-Request (Koordinaten einer Haltestellensequenz) outline: deep

StopSeqCoord-Request

Gibt die Koordinaten (Polylinie) einer vorgegebenen Haltestellen-Sequenz zurück. Nützlich zur Kartenvisualisierung.

Endpoint

  • Pfad: XML_STOPSEQCOORD_REQUEST
  • Methode: GET

Parameter (Auszug)

ParameterTypBeschreibung
stopIdsstringKommagetrennte Liste von Stop-IDs in Reihenfolge
formatstringWGS84 (Standard) oder anderes unterstütztes Format

Beispiel-Request

GET /XML_STOPSEQCOORD_REQUEST?stopIds=de:05513:1001,de:05513:1020&format=WGS84

Antwort (Beispiel)

json
{
  "polyline": [
    { "lat": 51.4513, "lon": 7.0128 },
    { "lat": 51.4550, "lon": 7.0800 }
  ]
}

JavaScript-Beispiel

js
async function getStopSeqPolyline(stopIds, format = 'WGS84') {
  const base = 'https://server:port/virtuellesVerzeichnis/XML_STOPSEQCOORD_REQUEST'
  const usp = new URLSearchParams({ stopIds: stopIds.join(','), format })
  const res = await fetch(`${base}?${usp}`)
  if (!res.ok) throw new Error('HTTP ' + res.status)
  return res.json()
}