mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 19:59:50 +00:00
Migrate Switzerland to binary trips query.
This commit is contained in:
parent
f7acf1f14f
commit
1be4366acb
3 changed files with 26 additions and 6 deletions
|
@ -19,13 +19,17 @@ package de.schildbach.pte;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsContext;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -35,12 +39,9 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.SBB;
|
||||
private static final String API_BASE = "http://fahrplan.sbb.ch/bin/";
|
||||
|
||||
public SbbProvider(final String accessId)
|
||||
public SbbProvider()
|
||||
{
|
||||
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 10);
|
||||
|
||||
setAccessId(accessId);
|
||||
setExtXmlEndpoint(API_BASE + "extxml.exe");
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -142,6 +143,26 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
return Product.ALL;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void appendCustomTripsQueryBinaryUri(final StringBuilder uri)
|
||||
{
|
||||
uri.append("&h2g-direct=11");
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final Collection<Product> products, final WalkSpeed walkSpeed, final Accessibility accessibility, final Set<Option> options)
|
||||
throws IOException
|
||||
{
|
||||
return queryTripsBinary(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext contextObj, final boolean later) throws IOException
|
||||
{
|
||||
return queryMoreTripsBinary(contextObj, later);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected char normalizeType(final String type)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue