Why is prox parameter value not enforced in 6.2/reversegeocode? - here-api

Why does the 6.2/reversegeocode API call not limit the results according to proximity parameter prox?
Example:
https://reverse.geocoder.api.here.com/6.2/reversegeocode.json
?app_id=my_app_id
&app_code=my_app_code
&maxresults=10
&mode=retrieveAddresses
&prox=53.468052,-113.44846,50
Partial result includes this record:
{
"Relevance":1.0,
"Distance":82.2,
"MatchLevel":"houseNumber",
...
"MatchType":"interpolated",
...
"Address":{
"Label":"125 Lee Ridge Rd NW, Edmonton, AB T6K 0N1, Canada",
...
}
}
So my requested radius is 50m, but the distance to one of the results is 82.2.
Why?

For Geocoder API v6.2 three aspects come into play here:
For performance reasons, distance filter does a simplified (plane triangular) distance calculation only, which for the higher latitude might be deviating from the real distance (spherical calculation)
The returned distance is calculated towards the display point and might differ from the filtering distance which is the nearest of display or navigation point
Reverse Geocoder v6.2 uses a link-based spatial index only,meaning that radius is used to select nearest links within radius and from those
the nearest point-address or otherwise housenumber range interpolated house number is returned.
I would suggest using the new Geocoding & Search API (https://developer.here.com/documentation/geocoding-search-api/dev_guide/topics/endpoint-reverse-geocode-brief.html) Reverse Geocoder, results are a bit more predictable and better understandable:
https://search.hereapi.com/v1/revgeocode?limit=20&in=circle%3A53.468052%2C-113.44846%3Br%3D50&apikey=YOUR_API_KEY

Related

Set current location in a route based on a arbitrary distance

I'm just playing around with Here and this is my escenario for an idea.
Get a routing between 2 points, I know this is doable
Set the start and finish marker, I know this is doable
Get the distance between the 2 points, I know this is doable
Now, if the distance from point 1 and 2 is 3000 meters I want to set a marker ( You are here ) based on a arbitrary distance value, let say I want to add a marker at the 1750 meters point, the market should appears in the half route way.
Is this posible with the actual API?
Thanks in advance!
Yes it is possible to do with HERE javascript API.
Once you get routing response and create H.geo.LineString out of it, you can calculate distance between each two geo points from that line string using H.geo.Point#distance method. This will help to determine between which two points (lat, lng) is your desired arbitrary distance.
After that you need to calculate angle between these two geo points and use it in method H.geo.Point#walk in order to get exact position of the geo point you need.
Here you can find jsfiddle example which places marker on the simple LineString based on desired arbitrary distance.

here-api - calculateroute distance

I am new to here-api and have a question wrt distance as shown in the response to a calculateroute request. Having a sequence of 100 waypoints recorded by GPS device along a road (~ 20m apart) the distance in the summary tag of the response is very different from what I calculate when summing up the distances between waypoints involved. Also bringing the waypoint sequence to a map shows that the summed up value is close to reality. whats going wrong here?
When sending a request like this
https://route.api.here.com/routing/7.2/calculateroute.json
?app_id=<my_app_id>
&app_code=<my_app_code>
&wayPoint0=geo!45.008503,7.555000
&wayPoint1=geo!45.006691,7.554025
&wayPoint2=geo!45.006470,7.554040
&wayPoint3=geo!45.006290,7.554018
&wayPoint4=geo!45.006096,7.553948
&wayPoint5=geo!45.005875,7.553872
&wayPoint6=geo!45.005615,7.553765
&wayPoint7=geo!45.004444,7.553305
&wayPoint8=geo!45.004116,7.553172
&wayPoint9=geo!45.003792,7.553035
&wayPoint10=geo!45.003460,7.552888
&routeattributes=routeId,waypoints,shape
&mode=shortest;car;traffic:disabled&returnelevation=true
I get a response consisting of 11 waypoints and 78 shapepoints. Calculating the distance via waypoints (using Haversine formula) yields a value of ~ 600 meters which looks reasonable and can be verified when exporting the result to kml and put on a map. However the distance tag under the summary section reports a distance of 3000 meters. Also the summed distance over shape points is much too high (2900m).
Most likely your GPS probes are not exactly on the road and calculateroute will compute a complex result.
When having a list of GPS tracks, you should use instead Route Map Extension (RME) that will figure out the correct/most probable route.

Returning distance in miles or kilometers from manhattan distance formula output

I am running a taxicab distance function on a list of coordinates and I would like to convert the outcome integer to a mile or km quantity. For example:
0.0117420 = |40.721319 - 40.712278| + |-73.844311 - -73.841610|
Where 0.0117420 is the output I would like to convert to mi/km. How could I go about this?
This appears to be a situation where you are trying to navigate from (40.721319, -73.844311) to (40.712278, -73.841610) where these are lat / lon pairs, and you want to navigate using a "Manhattan" routing rather than a direct great circle route.
It looks like you are considering these points as opposite corners of a "rectangle" where travel is only allowed along north, south, east and west headings to move from one point to another and where travel along the path always brings the traveler closer to the destination point.
An approximation of this is to find one of the corners of the bounding rectangle for all such paths. There are two of them, one at (40.721319, -73.841610) and the other at (40.712278, -73.844311). So, you can pick one of these and chose that as a waypoint for approximating the length each possible "Manhattan routes" between the two points. If we chose the first, you will need to calculate the distance from the starting point to the waypoint then to the destination point. Such as:
l(0) = (40.721319, -73.844311)
l(1) = (40.721319, -73.841610)
l(2) = (40.712278, -73.841610)
Using the Haversine equations we see the distance from l(0) to l(1) is approximately 0.2276km and the distance from l(1) to l(2) is approximately 1.005km making the entire route about 1.2326km.
This is approximately the length of any "Manhattan route" you pick where the distance is strictly decreasing along the path taken between the two points. There are also some errors due to the curvature of the Earth, but for points this close to each other and so distant from either of the poles, this should be good enough for most applications.

is there a way to set heading for a Point?

I have heading that i get with this computeHeading(from:LatLng, to:LatLng), latlng of one point and distance to second point(in meters) is there a way using these three things to get latlng of second point ?
From google docs Navigation Functions
Given a particular heading, an origin location, and the distance to travel (in meters), you can calculate the destination coordinates using computeOffset().

how to get the direction of a location in google map api

i want to get the Direction of location in lati longi
when i use google map api
then he return me lati long for city (27.19, 78.01) but i need position too
means N E W S how i can get them too like
(27.19 N , 78.01 E).
N for north and E for east. how i can get the flank or direction too.
If the latitude returned by Googles Maps API is a positive number, then it is N. If it is negative, then it is S.
If the longitude is positive, then it is E. If it is negative, then it is W.
One can easily calculate distance between two location with the help of Google Map APIs. Google Map APIs comes with a set of classes which helps in doing such tasks.
class GDirection, helps in getting the travel distance between the two different location.
check following link for its example :-
http://tajendrasengar.blogspot.com/2011/09/distance-between-two-locations-with.html

Resources