Skip to main content

BestNearestPath

Offline Navigation Library for Python.

BestNearestPath is an open-source Python library designed for offline route planning and interactive map visualization using OpenStreetMap (OSM) data. The library provides a simple and intuitive API for calculating optimal routes between geographic coordinates while displaying the result through a local interactive web interface.

Unlike cloud-based navigation services, BestNearestPath performs all routing operations locally, making it suitable for offline environments, research projects, educational purposes, GIS applications, and custom navigation systems.


Features

  • 🚗 Offline route planning
  • ⭐ Shortest path calculation using the A* algorithm
  • 📍 Coordinate-based routing (Latitude, Longitude)
  • 🗺 Interactive web map visualization
  • 📌 Start and destination markers
  • 🔍 Local place searching
  • 💾 SQLite-based place database
  • 🌐 Local Streamlit web interface
  • ⚡ Lightweight and easy-to-use Python API
  • 🔒 No external routing service required

Example

from BestNearestPath import APIReadyNavigator

nav = APIReadyNavigator()

nav.show_route(
    start=(33.98508654513751, 51.424067616462715),
    destination=(33.98031584036005, 51.411316394805915)
)

WEB UI: Source Selection Using Search


Current Capabilities

The current version supports:

  • Loading OpenStreetMap road network graphs
  • Finding the nearest road node from geographic coordinates
  • Computing optimal routes using the A* algorithm
  • Interactive map visualization
  • Local place searching
  • Offline navigation without Internet access (after map preparation)

Use Cases

BestNearestPath can be used for:

  • Navigation applications
  • Geographic Information Systems (GIS)
  • University projects
  • Research and academic studies
  • Smart city solutions
  • Logistics and delivery systems
  • Autonomous robotics
  • Offline navigation software
  • Route analysis and visualization

Installation

pip install BestNearestPath

Web User Interface (Web UI)

The project provides a user-friendly web interface designed to simplify interaction with the path-finding and navigation system. The Web UI allows users to search for locations, define source and destination points, and visualize the calculated route through an intuitive graphical environment.

The interface consists of several main sections, including the main dashboard, location search, source selection, destination selection, and route visualization.


Main Web Interface

The main interface serves as the entry point of the application and provides access to the core features of the navigation system.

Through this page, users can start the navigation process, access location search functionality, and interact with the available mapping tools. The design focuses on simplicity, accessibility, and providing a smooth user experience.

By Run th code Below:

from BestNearestPath import APIReadyNavigator

nav = APIReadyNavigator()
nav.launch_web()

you will see a page opend in your browser & it like this:

WEB UI: First Page


The location search module enables users to quickly find desired places by entering a search query.

The system processes the provided query and returns relevant location results. After selecting a suitable result, the selected location information is used for further navigation operations.

This feature eliminates the need for manual map navigation and provides a faster and more accurate way to locate specific points.

WEB UI: Search


The system provides the ability to define the starting point of a route through the search functionality.

Users can search for a specific location, select the desired result, and assign it as the source point for navigation. The selected location is automatically processed and prepared for route calculation.

This approach improves accuracy and simplifies the process of selecting the starting position.

WEB UI: Source Selection Using Search


Destination Selection Using Mouse Marker

In addition to search-based selection, the system supports direct destination selection through an interactive map marker.

Users can select any point on the map by moving the mouse cursor and clicking on the desired location. The corresponding geographic coordinates are extracted automatically and used as the destination point for path calculation.

This functionality is especially useful for selecting locations that may not have a specific address or searchable name.

WEB UI: Source Selection Using Search


Route Finding and Visualization

After defining the source and destination points, the system performs the path-finding process and displays the calculated route on the map.

The generated route is visualized in a clear graphical format, allowing users to easily understand the navigation path between the selected locations.

The system processes geographic information and applies path-finding algorithms to determine an appropriate route between the source and destination points.

WEB UI: Source Selection Using Search

License and Attributions

This project is licensed under the MIT License.

All third-party libraries retain their original licenses and attributions.


Dependencies

BestNearestPath is built using several excellent open-source libraries, including:

  • NetworkX
  • OSMnx
  • Folium
  • Streamlit
  • streamlit-folium
  • RapidFuzz
  • Pandas

We gratefully acknowledge the authors and maintainers of these projects.

Map data is provided by:

© OpenStreetMap contributors https://www.openstreetmap.org/copyright

Metadata

Release files for BestNearestPath 1.2.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for BestNearestPath 1.2.9
File Size Uploaded
bestnearestpath-1.2.9.tar.gz 3.6 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for BestNearestPath 1.2.9
File Interpreter ABI Platform
bestnearestpath-1.2.9-py3-none-any.whl Python 3 none any Details

Total release size: 3.6 MB

Release files / bestnearestpath-1.2.9.tar.gz

Download URL bestnearestpath-1.2.9.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
44f38ce9cc9a38d63df6857cb19007dd56f2660e87f8be4cfcb6966ac83ca18a
BLAKE2b-256 checksum
How to use checksums
c0e7d41d18ec604bbdf70100f8674c421bc3a84b924e9e57976126427762b547
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release files / bestnearestpath-1.2.9-py3-none-any.whl

Download URL bestnearestpath-1.2.9-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4565ea55c904182c74eb8c0cb71204148d1b3375e1e190a26befcb8bbc9e72ad
BLAKE2b-256 checksum
How to use checksums
a5a0a26ed8b7db86e302ac2194928519091bbd65e7a4215fa9d0f20e3d35e99e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.9

Release history Release notifications | RSS feed

This release

1.2.9 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page