Skip to content

h3-js test to determine potential drivers for a passenger based on lat and lng

License

Notifications You must be signed in to change notification settings

Nik-9649/h3-js-driver-matcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

H3-Based Driver-Passenger Matcher

This project uses the H3-js library to determine which drivers are within a certain proximity to a passenger based on their latitude and longitude. It leverages Uber's H3 geospatial indexing system to efficiently calculate and categorize drivers as potential or non-potential based on their distance from the passenger.

Table of Contents

Installation

  1. Clone the Repository:

    git clone https://github.com/Nik-9649/h3-js-driver-matcher.git
    cd h3-js-driver-matcher
  2. Install Dependencies:

    Ensure you have Node.js installed, then install the required packages:

    yarn install

Usage

To use this tool, simply define the passenger's and drivers' locations, and the script will categorize the drivers as either potential or non-potential based on their proximity to the passenger.

Running the Script

You can run the script using Node.js:

node index.js

or

yarn dev

Configuration

  • Resolution: The H3 resolution level used for indexing. Higher resolutions provide more granularity but may require more computation.
  • kDistance: The radius of interest for potential drivers, defined in terms of H3 hexagons (1 = adjacent hexagons).

Both of these settings can be adjusted in the script:

const resolution = 9; // Define the H3 resolution
const kDistance = 1; // Define the radius of interest (1 = adjacent hexagons)

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

h3-js test to determine potential drivers for a passenger based on lat and lng

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published