mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-12 00:08:47 +00:00
added zebra check to nearby station scanning
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@224 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
2a18c89a15
commit
00e145dd49
1 changed files with 7 additions and 0 deletions
|
@ -45,11 +45,18 @@ public abstract class AbstractHafasProvider implements NetworkProvider
|
|||
|
||||
final String uri = nearbyStationUri(stationId);
|
||||
final CharSequence page = ParserUtils.scrape(uri);
|
||||
String oldZebra = null;
|
||||
|
||||
final Matcher mCoarse = P_NEARBY_COARSE.matcher(page);
|
||||
|
||||
while (mCoarse.find())
|
||||
{
|
||||
final String zebra = mCoarse.group(1);
|
||||
if (oldZebra != null && zebra.equals(oldZebra))
|
||||
throw new IllegalArgumentException("missed row? last:" + zebra);
|
||||
else
|
||||
oldZebra = zebra;
|
||||
|
||||
final Matcher mFineCoords = P_NEARBY_FINE_COORDS.matcher(mCoarse.group(2));
|
||||
final Matcher mFineLocation = P_NEARBY_FINE_LOCATION.matcher(mCoarse.group(2));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue