tiso5316
tiso5316

Reputation: 1

Issue using polyline routing result for POI search along route

I am trying to use the polyline string output of a v8 API route request as input for the compressedRoute parameter of a follow-up browse places request, but get a format error. Here is an example:

query:

https://router.hereapi.com/v8/routes?apiKey=&transportMode=car&origin=52.5308,13.3847&destination=52.5323,13.3789&return=polyline

response contains the compressed polyline:

...
"polyline": "BGwynmkDu39wZvBtF3InfvHrdvHvboGzF0FnGoGvHsOvR8L3NkSnVoGjIsEzFgFvHkDrJwHrJoVvb0ezoBjInV3N_iBzJ_Z",
...

Using this in a places query like:

https://places.sit.ls.hereapi.com/places/v1/browse?apiKey=&compressedRoute=BGwynmkDu39wZvBtF3InfvHrdvHvboGzF0FnGoGvHsOvR8L3NkSnVoGjIsEzFgFvHkDrJwHrJoVvb0ezoBjInV3N_iBzJ_Z;w=500&cat=petrol-station&callback=

results in the following error:

({
    "status": 400,
    "message": "'compressedRoute' parameter is incorrectly formatted: requirement failed: Latitude must be between -90.0 and 90.0, got: 525.30983",
    "incidentId": "38e52b93-6198-479f-a52b-936198579fd8"
});

Are polyline and compressedRoute incompatible or might there be a bug?

Upvotes: 0

Views: 171

Answers (1)

user3505695
user3505695

Reputation:

Regarding documentation on https://developer.here.com/documentation/places/dev_guide/topics/location-contexts.html#location-contexts__here-polyline-encoding the Places API supports "HERE polyline encoding" that is not the same format as "Flexible Polyline encoding" utilized in Routing API v8 https://github.com/heremaps/flexible-polyline also are both above not compatible.


The new Geocoding and Search API v7 is not supporting the parameters like route, compressedRoute at this moment but will be available later in next releases and will support "Flexible Polyline encoding".

Upvotes: 0

Related Questions