OpendataCH / Transport

Swiss public transport API
http://transport.opendata.ch/
MIT License
241 stars 50 forks source link

Implement bike parameter #104

Closed fabian closed 8 years ago

fabian commented 9 years ago

The documentation says connections can be filtered by connections allowing the transport of bicycles.

This however does not work. An initial attempt to fix this with https://github.com/OpendataCH/Transport/commit/96ef66a67e72595c50c91bc9ca135e3408c7cb38 didn't succeed.

It seems the SBB API requires some initial elements in the connection request ReqC:

<ReqC …>
    <ConReq>
        …
        <FilterList>
            <ConReqAttrFilter mode="1" type="EXC" value="VN:VX" />
        </FilterList>
    </ConReq>
</ReqC>

Sniffed from the iPhone app. VN means "VELOS: Kein Selbstverlad".

fabian commented 8 years ago

Query where bikes should usually be allowed: http://transport.opendata.ch/v1/connections?from=Zug&to=Luzern&bike=1

Query where bikes are usually not allowed: http://transport.opendata.ch/v1/connections?from=Zürich&to=Üetliberg&bike=1

Query where bikes are usually not allowed but without filter: http://transport.opendata.ch/v1/connections?from=Zürich&to=Üetliberg&bike=0