diff --git a/enabler/src/de/schildbach/pte/AbstractHafasProvider.java b/enabler/src/de/schildbach/pte/AbstractHafasProvider.java index fe00871b..5a06d7d1 100644 --- a/enabler/src/de/schildbach/pte/AbstractHafasProvider.java +++ b/enabler/src/de/schildbach/pte/AbstractHafasProvider.java @@ -1241,6 +1241,8 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider { return "{\"type\":\"S\",\"extId\":" + JSONObject.quote(location.id) + "}"; else if (location.type == LocationType.ADDRESS && location.hasId()) return "{\"type\":\"A\",\"lid\":" + JSONObject.quote(location.id) + "}"; + else if (location.type == LocationType.POI && location.hasId()) + return "{\"type\":\"P\",\"lid\":" + JSONObject.quote(location.id) + "}"; else throw new IllegalArgumentException("cannot handle: " + location); } @@ -1332,7 +1334,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider { placeAndName[1], products)); } else if ("P".equals(type)) { final String[] placeAndName = splitPOI(loc.getString("name")); - final String id = normalizeStationId(loc.getString("extId")); + final String id = loc.getString("lid"); locations.add(new Location(LocationType.POI, id, crd.getInt("y"), crd.getInt("x"), placeAndName[0], placeAndName[1])); } else if ("A".equals(type)) { diff --git a/enabler/test/de/schildbach/pte/live/ShProviderLiveTest.java b/enabler/test/de/schildbach/pte/live/ShProviderLiveTest.java index 0b3678ce..4541768b 100644 --- a/enabler/test/de/schildbach/pte/live/ShProviderLiveTest.java +++ b/enabler/test/de/schildbach/pte/live/ShProviderLiveTest.java @@ -123,6 +123,15 @@ public class ShProviderLiveTest extends AbstractProviderLiveTest { print(result); } + @Test + public void tripKielPoi() throws Exception { + final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "3490015"), null, + new Location(LocationType.POI, + "A=4@O=Kiel, Hiroshimapark@X=10131697@Y=54324466@U=104@L=970001375@B=1@V=14.9,@p=1397713274@"), + new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL); + print(result); + } + @Test public void trip_errorTooClose() throws Exception { final Location station = new Location(LocationType.STATION, "003665026");