An offline Python navigation library for shortest-path routing and interactive map visualization using OpenStreetMap data
Project description
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)
)
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:
Location Search
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.
Source Selection Using 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.
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.
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.
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bestnearestpath-1.2.9.tar.gz.
File metadata
- Download URL: bestnearestpath-1.2.9.tar.gz
- Upload date:
- Size: 3.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44f38ce9cc9a38d63df6857cb19007dd56f2660e87f8be4cfcb6966ac83ca18a
|
|
| MD5 |
bcf1abea968b9af60c4a500ab6f23584
|
|
| BLAKE2b-256 |
c0e7d41d18ec604bbdf70100f8674c421bc3a84b924e9e57976126427762b547
|
File details
Details for the file bestnearestpath-1.2.9-py3-none-any.whl.
File metadata
- Download URL: bestnearestpath-1.2.9-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4565ea55c904182c74eb8c0cb71204148d1b3375e1e190a26befcb8bbc9e72ad
|
|
| MD5 |
d495b79704e63770fec8d6834451a27c
|
|
| BLAKE2b-256 |
a5a0a26ed8b7db86e302ac2194928519091bbd65e7a4215fa9d0f20e3d35e99e
|