mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 16:38:49 +00:00
support postcode
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@369 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
ef73a8bb0d
commit
d4aaecbe7a
2 changed files with 18 additions and 1 deletions
|
@ -148,7 +148,8 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
||||||
type = LocationType.ANY;
|
type = LocationType.ANY;
|
||||||
id = 0;
|
id = 0;
|
||||||
}
|
}
|
||||||
else if ("street".equals(anyType) || "address".equals(anyType) || "singlehouse".equals(anyType) || "buildingname".equals(anyType))
|
else if ("postcode".equals(anyType) || "street".equals(anyType) || "address".equals(anyType) || "singlehouse".equals(anyType)
|
||||||
|
|| "buildingname".equals(anyType))
|
||||||
{
|
{
|
||||||
type = LocationType.ADDRESS;
|
type = LocationType.ADDRESS;
|
||||||
id = 0;
|
id = 0;
|
||||||
|
|
|
@ -16,10 +16,16 @@
|
||||||
*/
|
*/
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import de.schildbach.pte.TflProvider;
|
import de.schildbach.pte.TflProvider;
|
||||||
|
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||||
|
import de.schildbach.pte.dto.Location;
|
||||||
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||||
|
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,6 +34,7 @@ import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
public class TflProviderLiveTest
|
public class TflProviderLiveTest
|
||||||
{
|
{
|
||||||
private final TflProvider provider = new TflProvider();
|
private final TflProvider provider = new TflProvider();
|
||||||
|
private static final String ALL_PRODUCTS = "IRSUTBFC";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void nearbyStation() throws Exception
|
public void nearbyStation() throws Exception
|
||||||
|
@ -44,4 +51,13 @@ public class TflProviderLiveTest
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.departures.size() + " " + result.departures);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void postcodeConnection() throws Exception
|
||||||
|
{
|
||||||
|
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "sw19 8ta"), null, new Location(
|
||||||
|
LocationType.STATION, 1016019, 51655903, -397249, "Watford (Herts), Watford Town Centre"), new Date(), true, ALL_PRODUCTS,
|
||||||
|
WalkSpeed.NORMAL);
|
||||||
|
System.out.println(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue