mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-20 09:19:57 +00:00
accessibility for connections query
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@818 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
62b023506c
commit
dd54582ead
69 changed files with 293 additions and 173 deletions
|
@ -1459,7 +1459,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
|
||||
private String xsltTripRequest2Uri(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final String products, final WalkSpeed walkSpeed)
|
||||
final String products, final WalkSpeed walkSpeed, final Accessibility accessibility)
|
||||
{
|
||||
final DateFormat DATE_FORMAT = new SimpleDateFormat("yyyyMMdd");
|
||||
final DateFormat TIME_FORMAT = new SimpleDateFormat("HHmm");
|
||||
|
@ -1486,6 +1486,11 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
uri.append("&ptOptionsActive=1");
|
||||
uri.append("&changeSpeed=").append(WALKSPEED_MAP.get(walkSpeed));
|
||||
|
||||
if (accessibility == Accessibility.BARRIER_FREE)
|
||||
uri.append("&imparedOptionsActive=1").append("&wheelchair=on").append("&noSolidStairs=on");
|
||||
else if (accessibility == Accessibility.LIMITED)
|
||||
uri.append("&imparedOptionsActive=1").append("&wheelchair=on").append("&lowPlatformVhcl=on").append("&noSolidStairs=on");
|
||||
|
||||
if (products != null)
|
||||
{
|
||||
uri.append("&includedMeans=checkbox");
|
||||
|
@ -1556,9 +1561,9 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
|
||||
public QueryConnectionsResult queryConnections(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final String products, final WalkSpeed walkSpeed) throws IOException
|
||||
final String products, final WalkSpeed walkSpeed, final Accessibility accessibility) throws IOException
|
||||
{
|
||||
final String uri = xsltTripRequest2Uri(from, via, to, date, dep, products, walkSpeed);
|
||||
final String uri = xsltTripRequest2Uri(from, via, to, date, dep, products, walkSpeed, accessibility);
|
||||
|
||||
InputStream is = null;
|
||||
try
|
||||
|
|
|
@ -626,7 +626,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
}
|
||||
|
||||
public QueryConnectionsResult queryConnections(Location from, Location via, Location to, final Date date, final boolean dep,
|
||||
final String products, final WalkSpeed walkSpeed) throws IOException
|
||||
final String products, final WalkSpeed walkSpeed, final Accessibility accessibility) throws IOException
|
||||
{
|
||||
final ResultHeader header = new ResultHeader(SERVER_PRODUCT);
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
|
||||
@Override
|
||||
public QueryConnectionsResult queryConnections(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final String products, final WalkSpeed walkSpeed) throws IOException
|
||||
final String products, final WalkSpeed walkSpeed, final Accessibility accessibility) throws IOException
|
||||
{
|
||||
final String uri = connectionsQueryUri(from, via, to, date, dep, products);
|
||||
final CharSequence page = ParserUtils.scrape(uri);
|
||||
|
|
|
@ -548,7 +548,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
|
||||
@Override
|
||||
public QueryConnectionsResult queryConnections(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
final String products, final WalkSpeed walkSpeed) throws IOException
|
||||
final String products, final WalkSpeed walkSpeed, final Accessibility accessibility) throws IOException
|
||||
{
|
||||
final String uri = connectionsQueryUri(from, via, to, date, dep, products);
|
||||
final CharSequence page = ParserUtils.scrape(uri);
|
||||
|
|
|
@ -45,6 +45,11 @@ public interface NetworkProvider
|
|||
SLOW, NORMAL, FAST
|
||||
}
|
||||
|
||||
public enum Accessibility
|
||||
{
|
||||
NEUTRAL, LIMITED, BARRIER_FREE
|
||||
}
|
||||
|
||||
NetworkId id();
|
||||
|
||||
boolean hasCapabilities(Capability... capabilities);
|
||||
|
@ -101,16 +106,16 @@ public interface NetworkProvider
|
|||
* @param dep
|
||||
* date is departure date? {@code true} for departure, {@code false} for arrival
|
||||
* @param products
|
||||
* TODO
|
||||
* products to take into account
|
||||
* @param walkSpeed
|
||||
* how fast can you walk?
|
||||
* @param products
|
||||
* products to take into account
|
||||
* @param accessibility
|
||||
* how accessible do you need the route to be?
|
||||
* @return result object that can contain alternatives to clear up ambiguousnesses, or contains possible connections
|
||||
* @throws IOException
|
||||
*/
|
||||
QueryConnectionsResult queryConnections(Location from, Location via, Location to, Date date, boolean dep, String products, WalkSpeed walkSpeed)
|
||||
throws IOException;
|
||||
QueryConnectionsResult queryConnections(Location from, Location via, Location to, Date date, boolean dep, String products, WalkSpeed walkSpeed,
|
||||
Accessibility accessibility) throws IOException;
|
||||
|
||||
/**
|
||||
* Query more connections (e.g. earlier or later)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue