How to Count Total Distance & Total Time While Travelling From One Location To Another [closed]

StackOverflow https://stackoverflow.com/questions/11468469

  •  20-06-2021
  •  | 
  •  

문제

Very much new to this issue,need to fine total travelling distance while going from one location to another and also need to count total time spent to that travel.finding distance using latitude and longitude of two location don't give correct result i think,because lat and lang distance gives us straight line distance even if we have lots of turning points etc...while we are travelling.

How to draw a path on a map using kml file?

i see this issue,good example has been given there i have implemented that also but it's complicated bcs i don't need to draw a routing path i just need to count total distance and total time.

So Hoping for some one will helpme

Thanks in advance Aamirkhan I.

ERROR SOLVED I found my answer i used this google api

http://maps.googleapis.com/maps/api/distancematrix/json?origins=ahmedabad&destinations=mumbai&mode=car&sensor=false

it gives all info for traveling form one location to another

도움이 되었습니까?

해결책

Find the distance of every part of your path between 2 turn points (by longitudes and latitudes) and sum them up. To find a travell time divide the total distance by planned average speed. It's the only way to solve your problem.

다른 팁

When your travel starts you need to get the current location Latitude and Longitude and where ever you want to end your travel then you need to get that location latitude and longitude then calculate the distance .

Calculating distance

then regarding counting the time When you are getting the current location at that time only you need to get the current time and where you are ending your traveling there you need to get that particular time,then now calculate the time interval between two locations.

Google has an app to do basically this -- Google My Tracks. You can export the data from the app into Google Maps or a KML file.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top