Skip to content

This project calculates distance matrices between multiple addresses using Open Route API and Google Maps API. It leverages the requests library in Python to make API calls and retrieve travel distances/times between location pairs. Perfect for route optimization, delivery planning, or analyzing geographic relationships between multiple locations.

Notifications You must be signed in to change notification settings

cycle-sync-ai/distance-matrix-between-addresses

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Distance Matrix Calculator using Google Maps API

Overview

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.

Features

  • 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

Prerequisites

  • Python 3.x
  • requests library
  • Google Maps API key

Installation

  1. Clone this repository
  2. Install required dependencies:
pip install requests

Configuration

  1. Obtain Open Route API from open route service and a Google Maps API key from Google Cloud Console
  2. Set up your API key as an environment variable or in the ipynb file

Usage

# 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

Features

  • Supports multiple origin and destination points
  • Returns both distance and duration
  • Handles API rate limiting
  • Error handling for invalid addresses

Output Format

The tool returns a matrix containing:

  • Distance in meters
  • Travel time in minutes
  • Status of each request

Limitations

  • 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

Contributing

Feel free to submit issues and pull requests.

Author

Discord Email

About

This project calculates distance matrices between multiple addresses using Open Route API and Google Maps API. It leverages the requests library in Python to make API calls and retrieve travel distances/times between location pairs. Perfect for route optimization, delivery planning, or analyzing geographic relationships between multiple locations.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published