link to google maps for footway arrivals if coordinate is known

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@134 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-09-05 15:32:09 +00:00
parent f266d841a4
commit f3fc78f8fa
2 changed files with 27 additions and 7 deletions

View file

@ -370,9 +370,9 @@ public final class VbbProvider implements NetworkProvider
+ "<strong>(.*?)</strong>" // arrival
+ "|" //
+ "(\\d+) Min\\.[\n\\s]?" // footway
+ "Fussweg\n?" //
+ ".*?(?:<a href=\"/Fahrinfo.*?input=(\\d+)\">\n?" // arrivalId
+ "<strong>(.*?)</strong>|<a href=\"/Stadtplan.*?\">(\\w.*?)</a>|<strong>(.*?)</strong>).*?" // arrival
+ "Fussweg.*?" //
+ "(?:<a href=\"/Fahrinfo.*?input=(\\d+)\">\n" // arrivalId
+ "<strong>(.*?)</strong>|<a href=\"/Stadtplan.*?WGS84,(\\d+),(\\d+)&.*?\">([^<]*)</a>|<strong>([^<]*)</strong>).*?" // arrival
+ ").*?", Pattern.DOTALL);
public GetConnectionDetailsResult getConnectionDetails(final String uri) throws IOException
@ -453,17 +453,22 @@ public final class VbbProvider implements NetworkProvider
{
final int arrivalId = mDetFine.group(12) != null ? Integer.parseInt(mDetFine.group(12)) : 0;
final String arrival = ParserUtils.resolveEntities(selectNotNull(mDetFine.group(13), mDetFine.group(14), mDetFine.group(15)));
final String arrival = ParserUtils.resolveEntities(selectNotNull(mDetFine.group(13), mDetFine.group(16), mDetFine.group(17)));
final double arrivalLon = mDetFine.group(14) != null ? latLonToDouble(Integer.parseInt(mDetFine.group(14))) : 0;
final double arrivalLat = mDetFine.group(15) != null ? latLonToDouble(Integer.parseInt(mDetFine.group(15))) : 0;
if (parts.size() > 0 && parts.get(parts.size() - 1) instanceof Connection.Footway)
{
final Connection.Footway lastFootway = (Connection.Footway) parts.remove(parts.size() - 1);
parts.add(new Connection.Footway(lastFootway.min + Integer.parseInt(min), lastFootway.departureId, lastFootway.departure,
arrivalId, arrival));
arrivalId, arrival, arrivalLat, arrivalLon));
}
else
{
parts.add(new Connection.Footway(Integer.parseInt(min), departureId, departure, arrivalId, arrival));
parts.add(new Connection.Footway(Integer.parseInt(min), departureId, departure, arrivalId, arrival, arrivalLat,
arrivalLon));
}
lastArrival = arrival;