TopoToolbox is a Python library that provides a set of functions and classes that support the analysis of relief and flow pathways in digital elevation models (DEMs). The major aim of TopoToolbox is to offer helpful analytical GIS utilities in a non-GIS environment in order to support the simultaneous application of GIS-specific and other quantitative methods.
The documentation is located at https://topotoolbox.github.io/pytopotoolbox/.
This python library is based on the TopoToolbox for Matlab and uses the API provided by libtopotoolbox to compute efficiently.
To get started head to pytopotoolbox/tutorial. If you need more examples see pytopotoolbox/examples or reference the API documentation pytopotoolbox/api.
The example files are also available as Jupyter Notebook files in the ./examples folder. Feel free to download and play around with them to gain a better understanding of the functionality of the TopoToolbox.
For any operating system, install the following:
- Python
- pip
- Git (only when building the package yourself)
-
Installing from .whl file
Make sure to choose the appropriate file for your OS. For Linux, the file name should contain something like:
linux_x86_64
pip install dist_name.whl
-
Installing directly from the repository:
cd path/to/pytopotoolbox pip install .
-
Generating distribution archives
cd path/to/pytopotoolbox python3 -m pip install --upgrade build python3 -m build
-
Installing from .whl file
Make sure to choose the appropriate file for your OS. For Windows, the file name should contain something like:
win_amd64
.pip install dist_name.whl
-
Installing directly from the repository:
Since there are C/C++ files that need to be compiled in order to build the package, there are a few extra steps to take.
-
Install the Developer Command Prompt for VS 2022.
- Scroll down to 'All Downloads'
- open 'Tools for Visual Studio'
- download 'Build Tools for Visual Studio 2022'
- install it while including the 'Desktop development with C++' workload
-
To ensure the compiler is working with 64-bit architecture, that is necessary for python, open 'x64 Native Tools Command Prompt for VS 2022' instead of the 'Developer Command Prompt' that defaults to 32-bit architecture.
-
In the newly opened terminal, run:
cd path\to\pytopotoolbox pip install .
-
-
Generating distribution archives
Open the 'x64 Native Tools Command Prompt for VS 2022' Terminal and run:
cd path\to\pytopotoolbox py -m pip install --upgrade build py -m build
[work in progress]
To run the tests for this package, run:
cd path/to/pytopotoolbox
pytest
To run the linting locally, use:
cd path/to/pytopotoolbox
flake8 src/topotoolbox
mypy --ignoremissing-imports src/topotoolbox
If you would like to contribute to pytopotoolbox, check out the Contribution Guidelines.
This project is licensed under the GPL-3.0 (GNU) License - see the LICENSE file for details.