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).

add a comment |
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).

2
You should show an example request so we can see what is going on. A minimal verifiable example would be perfect. Besides, the distance "as the crow flies" between every 20m GPS waypoint on a road will be different from the distance between the first and last waypoint, and different from the actual length of the road between those two waypoints.
– Toothbrush
Nov 19 '18 at 17:53
add a comment |
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).

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).


edited Nov 20 '18 at 15:27
asked Nov 19 '18 at 17:40


camillo
11
11
2
You should show an example request so we can see what is going on. A minimal verifiable example would be perfect. Besides, the distance "as the crow flies" between every 20m GPS waypoint on a road will be different from the distance between the first and last waypoint, and different from the actual length of the road between those two waypoints.
– Toothbrush
Nov 19 '18 at 17:53
add a comment |
2
You should show an example request so we can see what is going on. A minimal verifiable example would be perfect. Besides, the distance "as the crow flies" between every 20m GPS waypoint on a road will be different from the distance between the first and last waypoint, and different from the actual length of the road between those two waypoints.
– Toothbrush
Nov 19 '18 at 17:53
2
2
You should show an example request so we can see what is going on. A minimal verifiable example would be perfect. Besides, the distance "as the crow flies" between every 20m GPS waypoint on a road will be different from the distance between the first and last waypoint, and different from the actual length of the road between those two waypoints.
– Toothbrush
Nov 19 '18 at 17:53
You should show an example request so we can see what is going on. A minimal verifiable example would be perfect. Besides, the distance "as the crow flies" between every 20m GPS waypoint on a road will be different from the distance between the first and last waypoint, and different from the actual length of the road between those two waypoints.
– Toothbrush
Nov 19 '18 at 17:53
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379991%2fhere-api-calculateroute-distance%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 20 '18 at 3:18
DevBab
5265
5265
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53379991%2fhere-api-calculateroute-distance%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
2
You should show an example request so we can see what is going on. A minimal verifiable example would be perfect. Besides, the distance "as the crow flies" between every 20m GPS waypoint on a road will be different from the distance between the first and last waypoint, and different from the actual length of the road between those two waypoints.
– Toothbrush
Nov 19 '18 at 17:53