mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-12 22:28: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 (.*)\\)"));
|
||||
// Venloer Str./Gürtel (Gleis 1)
|
||||
add(Pattern.compile("(.*) \\(Gleis (.*)\\)"));
|
||||
// Aachen alle Buslinien
|
||||
add(Pattern.compile("(.*) \\(H\\.(\\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++)
|
||||
{
|
||||
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 arrivalPredicted = null;
|
||||
if (viaJsonObject.has("arrivalScheduled"))
|
||||
|
@ -830,8 +834,8 @@ public class VrsProvider extends AbstractNetworkProvider
|
|||
{
|
||||
arrivalPlanned = parseDateTime(viaJsonObject.getString("arrival"));
|
||||
}
|
||||
final Stop intermediateStop = new Stop(viaLocation, false /* arrival */, arrivalPlanned, arrivalPredicted,
|
||||
null /* plannedPosition */, null /* predictedPosition */);
|
||||
final Stop intermediateStop = new Stop(viaLocation, false /* arrival */, arrivalPlanned, arrivalPredicted, viaPosition,
|
||||
viaPosition);
|
||||
intermediateStops.add(intermediateStop);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -460,6 +460,16 @@ public class VrsProviderLiveTest extends AbstractProviderLiveTest
|
|||
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
|
||||
{
|
||||
Random rand = new Random(new Date().getTime());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue