This project provides a set of tools for processing geospatial data in the form of shapefiles (.shp) containing simple polygons. The primary functionalities include triangulation, shortest path calculation, and visualization of geospatial data.
- Plot the entire shapefile.
- Find and plot the shortest path between two points.
- Showcase user-chosen triangulations.
- Showcase 'sleeve' paths between two points.
- Exit.
The repository is organized as follows:
Geospatial-Triangulation-ShortestPath/
├── __init__.py
├── unit_tests/
│ ├── __init__.py
│ ├── test_bst.py
│ ├── test_dcel.py
│ ├── test_dual_graph.py
│ ├── test_simple_funnel.py
│ └── test_triangulation.py
├── src/
│ ├── __init__.py
│ ├── bst.py
│ ├── dcel.py
│ ├── dual_graph.py
│ ├── simple_funnel.py
│ └── triangulation.py
├── data/
│ └── shapefiles/
│ ├── ...
│ └── README.txt
├── main.py
├── conda_requirements.txt
├── pip_requirements.txt
└── README.md
bst.py: A minimal implementation of a Binary Search Tree (BST) that stores half-edges, designed for use by the triangulation algorithm.dcel.py: Implements a Doubly Connected Edge List (DCEL) supporting necessary operations and functions.dual_graph.py: Implements the Dual Graph counterpart of a DCEL, supporting only triangulated DCELs.simple_funnel.py: Implements a pathfinding algorithm for a list of connected triangles ('sleeve' path fromdual_graph.py).triangulation.py: Contains the implementation of the triangulation of a polygon, along with necessary functions and geometric operations.
test_bst.py: Unit tests for thebst.pymodule.test_dcel.py: Unit tests for thedcel.pymodule.test_dual_graph.py: Unit tests for thedual_graph.pymodule.test_simple_funnel.py: Unit tests for thesimple_funnel.pymodule.test_triangulation.py: Unit tests for thetriangulation.pymodule.
Many different .shp files. Refer to the shapefiles/README.txt
To install the required dependencies using pip, run:
pip install -r requirements.txtTo install the required dependecies using conda, run:
conda create --name new_geo_env --file conda_requirements.txtTo run the project:
python -m mainThere is a known bug in the simple_funnel.py module, which may produce incorrect results in certain cases.
For more information, please refer to the comments in the module's source code (this is due to the incorrect
idea from link)