dbopendata / db-fahrplan-api

DB Fahrplan API
31 stars 1 forks source link

location.name service doesn't find "Rösrath" #26

Open marians opened 8 years ago

marians commented 8 years ago

When searching my home station using this request

https://open-api.bahn.de/bin/rest.exe/location.name?authKey=xxx&lang=de&input=R%C3%B6srath&format=json

I was surprised to not find it in the results, despite the fact that there exists one station with the exact name Rösrath (ID 008005134) and several with Rösrath as part of the name.

The response returned was


{
"LocationList":{
  "noNamespaceSchemaLocation":"http://open-api.bahn.de/bin/rest.exe/v1.0/xsd?name=hafasRestLocation.xsd",
  "StopLocation":[{
    "name":"Herzogenrath",
    "lon":"6.094488",
    "lat":"50.870917",
    "id":"008002806"
    },{
    "name":"Roedekro st",
    "lon":"9.332753",
    "lat":"55.069689",
    "id":"008601996"
    },{
    "name":"Rödby BF",
    "lon":"11.357466",
    "lat":"54.655718",
    "id":"008601988"
    },{
    "name":"Roedby Faerge",
    "lon":"11.354841",
    "lat":"54.655232",
    "id":"008601989"
    },{
    "name":"Ratisbona",
    "lon":"12.099615",
    "lat":"49.011669",
    "id":"008000309"
    },{
    "name":"Soest",
    "lon":"8.104593",
    "lat":"51.578422",
    "id":"008000076"
    },{
    "name":"Jena-Göschwitz",
    "lon":"11.593540",
    "lat":"50.883943",
    "id":"008010133"
    },{
    "name":"Soroe st",
    "lon":"11.568793",
    "lat":"55.419019",
    "id":"008602350"
    },{
    "name":"Oesterport st",
    "lon":"12.587612",
    "lat":"55.692704",
    "id":"008601878"
    },{
    "name":"BRATISLAVA",
    "lon":"17.097851",
    "lat":"48.154135",
    "id":"005696001"
    },{
    "name":"Bratislava hl.st.",
    "lon":"17.106463",
    "lat":"48.158908",
    "id":"005600207"
    }]
  }
}
marians commented 8 years ago

Got it!

Die Deutsche Bahn stellt [erstmals] über eine offene Schnittstelle für den Zugriff auf ihre Fahrplandaten[bank] zur Verfügung - [zunächst] eingeschränkt auf den SOLL-Fahrplan des Fernverkehrs.

So no regional stations, and no departure boards for now?

highsource commented 8 years ago

Correct. This interface is limited to long-distance trains and stations at the moment.

Check this (non open data) interface:

https://iris.noncd.db.de/wbt/js/index.html?bhf=KROE

J0ANMM commented 7 years ago

Found a similar issue with Berlin, but I don't think this time has to do with regional trains.

https://open-api.bahn.de/bin/rest.exe/location.name?authKey=<KEY>&lang=de&input=Berlin&format=json

Finds:

{
    "name":"Berlin Hbf",
    "lon":"13.369548",
    "lat":"52.525589",
    "id":"008011160"
    }

But not: Berlin Hbf (tief) - id: 8098160

However many routes are actually going through Berlin Hbf (tief). Or am I doing something wrong?