This tool calculates distance matrices between multiple addresses using the Google Maps Distance Matrix API. It provides an efficient way to get distances and travel times between multiple origins and destinations.
- Calculate distances between multiple addresses
- Get travel times between locations
- Support for different travel modes
- Easy-to-use interface with Python
- Handles batch processing of multiple addresses
- Python 3.x
requests
library- Google Maps API key
- Clone this repository
- Install required dependencies:
pip install requests
- Obtain Open Route API from open route service and a Google Maps API key from Google Cloud Console
- Set up your API key as an environment variable or in the ipynb file
# Example usage
import requests
# Input your addresses
origin_address = "Origin Address"
destination_address = "destination address"
# Run the distance matrix calculation
# The script will return distance and duration between addresses
- Supports multiple origin and destination points
- Returns both distance and duration
- Handles API rate limiting
- Error handling for invalid addresses
The tool returns a matrix containing:
- Distance in meters
- Travel time in minutes
- Status of each request
- Subject to Open Route API and Google Maps API usage limits and pricing
- Requires active internet connection
- API key must have Distance Matrix API enabled
Feel free to submit issues and pull requests.