{"action":"created","issue":{"url":"https://api.github.com/repos/osmandapp/Osmand/issues/1722","labels_url":"https://api.github.com/repos/osmandapp/Osmand/issues/1722/labels{/name}","comments_url":"https://api.github.com/repos/osmandapp/Osmand/issues/1722/comments","events_url":"https://api.github.com/repos/osmandapp/Osmand/issues/1722/events","html_url":"https://github.com/osmandapp/Osmand/issues/1722","id":107485728,"number":1722,"title":"GPX: Elevation gain/loss is way off.","user":{"login":"mkubik","id":940492,"avatar_url":"https://avatars.githubusercontent.com/u/940492?v=3","gravatar_id":"","url":"https://api.github.com/users/mkubik","html_url":"https://github.com/mkubik","followers_url":"https://api.github.com/users/mkubik/followers","following_url":"https://api.github.com/users/mkubik/following{/other_user}","gists_url":"https://api.github.com/users/mkubik/gists{/gist_id}","starred_url":"https://api.github.com/users/mkubik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkubik/subscriptions","organizations_url":"https://api.github.com/users/mkubik/orgs","repos_url":"https://api.github.com/users/mkubik/repos","events_url":"https://api.github.com/users/mkubik/events{/privacy}","received_events_url":"https://api.github.com/users/mkubik/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-09-21T10:40:11Z","updated_at":"2015-09-21T15:00:16Z","closed_at":null,"body":"The elevation gain / loss values are wrong by factors. The app claims to have e.g. 1209m gain on a 30km tour. But when I import it into Google Earth, it's only about 560m.\r\nCan you elaborate on how this value is calulated in OsmDroid?\r\n"},"comment":{"url":"https://api.github.com/repos/osmandapp/Osmand/issues/comments/142007539","html_url":"https://github.com/osmandapp/Osmand/issues/1722#issuecomment-142007539","issue_url":"https://api.github.com/repos/osmandapp/Osmand/issues/1722","id":142007539,"user":{"login":"mkubik","id":940492,"avatar_url":"https://avatars.githubusercontent.com/u/940492?v=3","gravatar_id":"","url":"https://api.github.com/users/mkubik","html_url":"https://github.com/mkubik","followers_url":"https://api.github.com/users/mkubik/followers","following_url":"https://api.github.com/users/mkubik/following{/other_user}","gists_url":"https://api.github.com/users/mkubik/gists{/gist_id}","starred_url":"https://api.github.com/users/mkubik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mkubik/subscriptions","organizations_url":"https://api.github.com/users/mkubik/orgs","repos_url":"https://api.github.com/users/mkubik/repos","events_url":"https://api.github.com/users/mkubik/events{/privacy}","received_events_url":"https://api.github.com/users/mkubik/received_events","type":"User","site_admin":false},"created_at":"2015-09-21T15:00:16Z","updated_at":"2015-09-21T15:00:16Z","body":"I was thinking on something like this. Funny detail: It seems to be close to what Google Earth reports with a threshold of 13m. \"elevation\" is a simple array of Integers\r\n\r\n                int el1 = 0, el2 = 0, i = 0;\r\n\t\tint start = elevation[0], end = 0, thres = 13, act_thres = 0;\r\n\t\tfor(i = 0; i < elevation.length-1; i++) {\r\n\t\t\tend = elevation[i+1];\r\n\t\t\tif((end - start) > 0) {\r\n\t\t\t\tact_thres = end - start;\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tstart = elevation[i];\r\n\t\t\t}\r\n\r\n\t\t\tif(act_thres >= thres) {\r\n\t\t\t\tstart = elevation[i];\r\n\t\t\t\tel2 += act_thres;\r\n\t\t\t\tact_thres = 0;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\tSystem.out.println(i+ \" Elements. Elevation (smooth): \"+ el2);\r\n"}}