Return value of hereAPI router in metres? - here-api

We're currently investigating in the HERE Routing API v8 but can't really determine what the actual result consists of when units is set to metric.
Example result:
"summary": {
"duration": 1670,
"length": 12865,
"baseDuration": 1506
},
"transport": {
"mode": "truck"
}
Would the length be in metres perhaps? And what about the duration? Is that in seconds?

Please find the following parameters along with their units of measurement
duration:
required
integer (Duration)
Duration in seconds.
length :
required
integer (Distance) >= 0
Distance in meters. For more information please refer to the following API Reference

Related

Bug: Here routing isolines API returning same polygon for all distances

For some coordinates, the Here isoline API returns the same polygon for all the time distances, regardless of the range[values] value.
The example is for Burlington GO train station, ON, Canada, and changing the coordinates a few meters causes invalid data.
example:
curl --location -g --request GET 'https://isoline.router.hereapi.com/v8/isolines?transportMode=pedestrian&range[type]=time&range[values]=50,600&destination=43.339900,-79.809388&apikey=XXXXXX'
{
"arrival": {
"time": "2022-08-31T06:28:52+00:00",
"place": {
"type": "place",
"location": {"lat": 43.33981,"lng": -79.80958},
"originalLocation": { "lat": 43.3399,"lng": -79.8093881}
}
},
"isolines": [
{
"range": {"type": "time","value": 50},
"polygons": [{"outer": "BG86o1yC3mmn4E1C2GhI2C1KAhI1CArF4K1KgI1CiIqB2CgEA4G" }
]
},
{
"range": {"type": "time","value": 600},
"polygons": [{"outer": "BG86o1yC3mmn4E1C2GhI2C1KAhI1CArF4K1KgI1CiIqB2CgEA4G"}
]
}
]
}
If I change the coordinates just a few meters, to "lat": 43.3403845, "lng": -79.8089106 then it returns correct isolines.
Is there a best practice when selecting destination coordinates, any extra parameter I should use to make the results more predictable?
I consider this a bug, if you cannot return valid results you should throw an error, not return invalid data to clients.
I think you can get better results if you use the additional parameter "radius" (meters) for the place (lat, lng) that you provided.
This parameter instructs the router to consider all places within the given radius as potential candidates for route calculation. This can be either because it is not important which place is used, or because it is unknown. Radiuses wider than 200 meters are not supported.
For example: destination=43.339900,-79.809388;radius=100.
I hope this information is useful for you.
Regards.

Range Behavior on Isolines

When retrieving reverse isolines based on time with a list of ranges does anyone know the behavior?
For example if range is 50,100,150,200,250,300,350,400 the polygon for 50 is much different then if range is 50,100,150.
Based on the two parameter sets below the range is extremely different for the 30 second revere isoline range. The two calls occurred at the same time.
For https://isoline.route.ls.hereapi.com/routing/7.2/calculateisoline.json?apiKey=xxxx&mode=balanced;car;traffic:default;motorway:-3&rangeType=time&destination=geo!43.805388,-79.525348&range=30,1800.
The polygon is:
"isoline": [{
"range": 30,
"component": [{
"id": 0,
"shape": ["43.8079834,-79.5238495",
"43.8066101,-79.5204163",
"43.8038635,-79.5204163",
"43.8024902,-79.5245361",
"43.8038635,-79.528656",
"43.8066101,-79.5293427",
"43.8079834,-79.5272827",
"43.8079834,-79.5238495"]
}]
}
For https://isoline.route.ls.hereapi.com/routing/7.2/calculateisoline.json?apiKey=xxxx&mode=balanced;car;traffic:default;motorway:-3&rangeType=time&destination=geo!43.805388,-79.525348&range=30.
The polygon is:
"isoline": [{
"range": 30,
"component": [{
"id": 0,
"shape": ["43.8059235,-79.5258236",
"43.8059235,-79.5245361",
"43.8057518,-79.5240211",
"43.8054085,-79.5240211",
"43.8050652,-79.5250511",
"43.8047218,-79.5253944",
"43.8047218,-79.5257378",
"43.8054085,-79.5264244",
"43.8057518,-79.5265102",
"43.8059235,-79.5262527",
"43.8059235,-79.5258236"]
}]
}]
The behaviour is same as single range, just that multiple range allows calculation of many isolines with the same start or destination.
Check this link for your reference.
https://developer.here.com/documentation/isoline-routing-api/dev_guide/topics/use-cases/multi-range-isoline.html

Retrieve LINK_ATTRIBUTE_FC1..5 based on LINK_ID

Assume I have a LINK_ID which I got using the LINK_FC5 layer with search/proximity resource described here.
Note that the search/proximity resource doesn't allow non-geometric layers such as LINK_ATTRIBUTE_FC5 to be specified.
Errorcode: 400, message: Provided layer does not contain geometries.
The documentation suggests using tile resource for getting the non-geometric layers, but that seems quite inefficient. Within one tile there are many LINK_IDs. Hard for me to believe there is no better way to do this. Hence the question:
What is a efficient way to retrieve all attributes from the LINK_ATTRIBUTE_FC5 layer using the LINK_ID?
You need to club to APIs to get the desired attributes for link IDs. So a tile comprises of multiple layers, Each layer contains multiple link IDs. this requires to make association between these resources. You can also refer to example : https://tcs.ext.here.com/examples/v3/pde_get_any_link_info
First API is :
https://s.fleet.ls.hereapi.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=548294575,833539855,550088940,930893121&apiKey=xxx
The response will be like :
"Layers": [
{
"layer": "ROAD_GEOM_FC5",
"level": 13,
"tileXYs": [
{
"x": 8580,
"y": 6376
}
]
},
{
"layer": "ROAD_GEOM_FC1",
"level": 9,
"tileXYs": [
{
"x": 534,
"y": 397
},
{
"x": 536,
"y": 398
}
]
}
From here you will get level, tile x,y and layer,
2nd API will be :
https://s.fleet.ls.hereapi.com/1/tiles.json?apiKey=xx&tilexy=536,398&levels=13&layers=LINK_ATTRIBUTE_FC5

I am getting error while hitting payUmoney api https://secure.payu.in/_payment'

Iam getting error invalid amount . my request parameters are as follows
var data={
key: 'mHnY4ZVe',
salt: ' OseOWqkht7',
service_provider: 'payu_paisa',
hash: hash,
amount:1,
firstName:'ayushi',
lastName:'gupta',
phone:"989601451",
email:"ayushigupta0294#gmail.com",
productInfo:'car',
surl: 'www.google.com',
furl: 'www.facebook.com',
txnid:txnid
};
check whether they accept amount as '1' or '100' for one rupee or they may have a minimum amount limit, try with Rs 10 or above
In PayU documentation the clearly mentioned below line :
Note: specify prices using the lowest currency unit e.g. in lowest currency unit for PLN, so 1000 is equal to 10 PLN. HUF is the exception – multiply this by 100.
Read this
Below is sample request :
{
"notifyUrl": "https://your.eshop.com/notify",
"customerIp": "127.0.0.1",
"merchantPosId": "145227",
"description": "RTV market",
"currencyCode": "PLN",
"totalAmount": "21000",
"products": [
{
"name": "Wireless mouse",
"unitPrice": "15000",
"quantity": "1"
},
{
"name": "HDMI cable",
"unitPrice": "6000",
"quantity": "1"
}
]
}
you have not passed any currency code etc. They have complete documentation. Just read once. Change your request accordingly

HTTP Archive (HAR) TOTAL response size of zero

According to HAR 1.2 specification, the response size is calculated as:
var totalSize = entry.response.headersSize + entry.response.bodySize;
But how could the response size be zero (=1273+(-1273)), for example in the following HAR:
"response": {
"status": 200,
"statusText": "OK",
"content": {
"size": 4916,
"mimeType": "application/x-javascript",
"compression": 6189
},
"headersSize": 1273,
"bodySize": -1273
In the specification, there is no negetive value for bodySize other than -1:
bodySize [number] - Size of the received response body in bytes. Set to zero in case of responses coming from the cache (304). Set to -1 if the info is not available.
This is probably a bug on Chromium. There were similar one, in timings section, in the past: https://code.google.com/p/chromium/issues/detail?id=152201
You may open a issue about this one.

Resources