CoordInfo-Request
Fragt Objekte (Haltestellen, POIs, Liniensegmente) in einem räumlichen Bereich oder um Koordinaten herum ab.
Endpoint
- Pfad:
XML_COORDINFO_REQUEST
- Methode: GET
Parameter (Auszug)
Parameter | Typ | Beschreibung |
---|---|---|
coord | string | Mittelpunkt als lat,lon |
radius | number | Radius in Metern |
bbox | string | Bounding Box minLat,minLon,maxLat,maxLon (Alternative zu coord+radius ) |
types | string | Objekttypen, z. B. stop,poi,line |
format | string | Koordinatenformat, z. B. WGS84 |
Beispiel-Requests
GET /XML_COORDINFO_REQUEST?coord=51.4513,7.0128&radius=400&types=stop,poi&format=WGS84
GET /XML_COORDINFO_REQUEST?bbox=51.44,7.00,51.46,7.03&types=line&format=WGS84
Antwort (Beispiel)
json
{
"stops": [{ "id": "de:05513:1001", "name": "Essen Hbf", "coord": { "lat": 51.4513, "lon": 7.0128 } }],
"pois": [ { "name": "Museum", "coord": { "lat": 51.45, "lon": 7.015 } } ]
}
JavaScript-Beispiel
js
async function queryAround(lat, lon, radius = 400, types = 'stop,poi') {
const base = 'https://server:port/virtuellesVerzeichnis/XML_COORDINFO_REQUEST'
const usp = new URLSearchParams({ coord: `${lat},${lon}`, radius: String(radius), types, format: 'WGS84' })
const res = await fetch(`${base}?${usp}`)
if (!res.ok) throw new Error('HTTP ' + res.status)
return res.json()
}
title: CoordInfo-Request (Objekte an Koordinate) outline: deep
CoordInfo-Request
Fragt Objekte und ihre Koordinaten im Umfeld einer Lage (Koordinate) ab: Haltestellen, POIs, ggf. Liniensegmente.
Endpoint
- Pfad:
XML_COORDINFO_REQUEST
- Methode: GET
Parameter (Auszug)
Parameter | Typ | Beschreibung |
---|---|---|
coord | string | lat,lon im WGS84 |
radius | number | Suchradius in Metern |
types | string | z. B. stop,poi |
max | number | Maximale Treffer |
Beispiel-Request
GET /XML_COORDINFO_REQUEST?coord=51.4513,7.0128&radius=400&types=stop,poi&max=50
Antwort (Beispiel)
json
{
"stops": [ { "id": "de:05513:1001", "name": "Essen Hbf", "coord": { "lat": 51.4513, "lon": 7.0128 } } ],
"pois": [ { "name": "Museum", "coord": { "lat": 51.4520, "lon": 7.0100 } } ]
}
JavaScript-Beispiel
js
async function getCoordInfo(lat, lon, { radius = 400, types = 'stop,poi', max = 50 } = {}) {
const base = 'https://server:port/virtuellesVerzeichnis/XML_COORDINFO_REQUEST'
const usp = new URLSearchParams({ coord: `${lat},${lon}`, radius: String(radius), types, max: String(max) })
const res = await fetch(`${base}?${usp}`)
if (!res.ok) throw new Error('HTTP ' + res.status)
return res.json()
}