mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 08:49:58 +00:00
Work around weirdly formatted positions in San Francisco.
This commit is contained in:
parent
65870ff563
commit
f1aa4c166b
1 changed files with 18 additions and 0 deletions
|
@ -23,6 +23,7 @@ import java.util.Map;
|
|||
import javax.annotation.Nullable;
|
||||
|
||||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Position;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.Style;
|
||||
|
||||
|
@ -53,6 +54,23 @@ public class SfProvider extends AbstractEfaProvider
|
|||
return super.normalizeLocationName(name).replace("$XINT$", "&");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Position parsePosition(final String position)
|
||||
{
|
||||
if (position == null)
|
||||
return null;
|
||||
|
||||
final int i = position.lastIndexOf("##");
|
||||
if (i < 0)
|
||||
return position.length() < 16 ? super.parsePosition(position) : null;
|
||||
|
||||
final String name = position.substring(i + 2).trim();
|
||||
if (name.isEmpty())
|
||||
return null;
|
||||
|
||||
return new Position(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Line parseLine(final @Nullable String id, final @Nullable String network, final @Nullable String mot, final @Nullable String symbol,
|
||||
final @Nullable String name, final @Nullable String longName, final @Nullable String trainType, final @Nullable String trainNum,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue