mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-12 17:48:48 +00:00
VRS: New platform parsing rule for Aachen. Parse position also in 'via stops'.
This commit is contained in:
parent
bff85253d1
commit
154085da1d
2 changed files with 17 additions and 3 deletions
|
@ -158,6 +158,8 @@ public class VrsProvider extends AbstractNetworkProvider
|
||||||
add(Pattern.compile("(.*) \\(Bussteig (.*)\\)"));
|
add(Pattern.compile("(.*) \\(Bussteig (.*)\\)"));
|
||||||
// Venloer Str./Gürtel (Gleis 1)
|
// Venloer Str./Gürtel (Gleis 1)
|
||||||
add(Pattern.compile("(.*) \\(Gleis (.*)\\)"));
|
add(Pattern.compile("(.*) \\(Gleis (.*)\\)"));
|
||||||
|
// Aachen alle Buslinien
|
||||||
|
add(Pattern.compile("(.*) \\(H\\.(\\d+).*\\)"));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
protected static final Pattern nrwTarifPattern = Pattern.compile("([\\d]+,\\d\\d)");
|
protected static final Pattern nrwTarifPattern = Pattern.compile("([\\d]+,\\d\\d)");
|
||||||
|
@ -818,7 +820,9 @@ public class VrsProvider extends AbstractNetworkProvider
|
||||||
for (int k = 0; k < vias.length(); k++)
|
for (int k = 0; k < vias.length(); k++)
|
||||||
{
|
{
|
||||||
final JSONObject viaJsonObject = vias.getJSONObject(k);
|
final JSONObject viaJsonObject = vias.getJSONObject(k);
|
||||||
Location viaLocation = parseLocationAndPosition(viaJsonObject).location;
|
LocationWithPosition viaLocationWithPosition = parseLocationAndPosition(viaJsonObject);
|
||||||
|
Location viaLocation = viaLocationWithPosition.location;
|
||||||
|
Position viaPosition = viaLocationWithPosition.position;
|
||||||
Date arrivalPlanned = null;
|
Date arrivalPlanned = null;
|
||||||
Date arrivalPredicted = null;
|
Date arrivalPredicted = null;
|
||||||
if (viaJsonObject.has("arrivalScheduled"))
|
if (viaJsonObject.has("arrivalScheduled"))
|
||||||
|
@ -830,8 +834,8 @@ public class VrsProvider extends AbstractNetworkProvider
|
||||||
{
|
{
|
||||||
arrivalPlanned = parseDateTime(viaJsonObject.getString("arrival"));
|
arrivalPlanned = parseDateTime(viaJsonObject.getString("arrival"));
|
||||||
}
|
}
|
||||||
final Stop intermediateStop = new Stop(viaLocation, false /* arrival */, arrivalPlanned, arrivalPredicted,
|
final Stop intermediateStop = new Stop(viaLocation, false /* arrival */, arrivalPlanned, arrivalPredicted, viaPosition,
|
||||||
null /* plannedPosition */, null /* predictedPosition */);
|
viaPosition);
|
||||||
intermediateStops.add(intermediateStop);
|
intermediateStops.add(intermediateStop);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -460,6 +460,16 @@ public class VrsProviderLiveTest extends AbstractProviderLiveTest
|
||||||
assertTrue(result.trips.size() > 0);
|
assertTrue(result.trips.size() > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testTripAachenEschweilerBus() throws Exception
|
||||||
|
{
|
||||||
|
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "10004"), null, new Location(LocationType.STATION, "10003"),
|
||||||
|
new Date(), true, EnumSet.of(Product.BUS), WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||||
|
print(result);
|
||||||
|
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||||
|
assertTrue(result.trips.size() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
private void manyRandomTrips(int latFrom, int latTo, int lonFrom, int lonTo) throws Exception
|
private void manyRandomTrips(int latFrom, int latTo, int lonFrom, int lonTo) throws Exception
|
||||||
{
|
{
|
||||||
Random rand = new Random(new Date().getTime());
|
Random rand = new Random(new Date().getTime());
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue