Amit Tomar
Amit Tomar

Reputation: 4858

Finding intermediate Lattitude Longitude between two given points

I am provided with this information -

  1. Lat-Long of source
  2. Lat-Long of destination

I need to find the Lat-Long pairs on the path from source to destination. These Lat-Long pairs must differ from each other by some given granularity.

Is there some Google API using which I can get this information ?

Upvotes: 1

Views: 2827

Answers (2)

naren
naren

Reputation: 368

I think what you are looking for is the directions api from google https://developers.google.com/maps/documentation/directions/

You give it the origin and destination and then specify your travelmode (which is car by default but you can also say you are walking or using transit)

Upvotes: 0

Chad Killingsworth
Chad Killingsworth

Reputation: 14411

The Google Maps API Elevation Service does exactly that. Given a path (defined by your source and destination LatLng pair), you also specify the number of samples and it will return elevation for specific LatLng points along that path. Just ignore the elevation information.

The Elevation Web Service is available for use separate from the Google Maps API v3. However make sure that your usage still falls within the terms of service.

To retrieve granular points along a driving path, use the Google Maps API Directions Service to obtain the full driving path and use that path as the input to the Elevation Service.

Upvotes: 2

Related Questions