Reputation:
Does google's distance matrix api considers "elevation" while showing distance between two latitude-longitude points?
Suppose first person is at upper level at an airport, second person is standing at lower level on same airport in same line, will the distance shown by google's distance matrix api be considering this vertical distance between both persons?
Upvotes: 2
Views: 2502
Reputation: 4875
No, but it sounds like you're considering using this API for something it was not built for.
The Google Distance Matrix API will return route distances, be it driving, walking, bicycling or public transportation. The distance (and duration) in each element in a response Distance Matrix API would be that of the route found by the Google Directions API.
It does not calculate straight-line (or geodesic) distances. You can use the Haversine formula.
While the Directions API does find indoor routes for walking directions, this is only available for directions to/from Google MAps places, those that have a Place ID. An arbitraty position in an arbitrary building level cannot be expressed in a Place ID.
Distances from Google Maps (and APIs) do take elevation into account, e.g. this route is 2.1 Km even though it looks like barely 1.5 Km. on the map.
Besides all that, the elevation differences within a building would be tiny compared to the driving distance between them. If you are looking for distances between people inside buildings, you're better off with straight-line distances corrected with average floor elevation (3-5 m.) factored in.
Upvotes: 4