Go package to access traffic data from Skanetrafiken.
- Open API -- Wrapper for the public Open API
- Geo -- Functions to convert between RT90 and WGS84
- Appengine -- A simple API Fasade, running on Google Appengine, that serves mostly GeoJSON instead of the original structures.
The Skanetrafiken Open API is documented at http://labs.skanetrafiken.se/api.asp.
It provides access to the following traffic-related resources:
- Search stations by name, e.g. "Malmö", "Eslöv".
- Get line departures (i.e. timetable) for a given Station.
- Get suggested journeys from A to B at any given time.
- Get list of stations near a given geographical point.
- Get geographical journey path for a given journey.
Method names follow the names used in the documentation, "/querypage.asp" is QueryPage() etc.
First, create an API instance:
api := openapi.NewOpenAPI()
Then, make a query:
stations, err := api.QueryStation("Malmö")
if err != nil {
return
}
And then, print the results:
for _, station := range stations.StartPoints {
fmt.Printf("%s, %d\n", station.Name, station.Id)
}