Intelligent and comprehensive swath analysis
- 💎 Intelligent: objectively identify irregular boundries using elevation, slope, TPI, or other raster analyses.
- 🌌 Comprehensive: cuvilinear and circular swath analyses, reclassification of swath data, cross-swath, slice and histogram, etc.
- 👭 Compatible: work seamlessly with GIS software.
- ⚓ Dependencies: numpy, matplotlib, gdal, scipy and shapely.
Read the documentation at: https://pyosp.readthedocs.io/en/latest/index.html
Introduction, methodology, and case studies: https://doi.org/10.1016/j.geomorph.2021.107778
Applications (starting from scratch):
- Topographic analysis of Teton Range, Wyoming
- Terrace correlation along the Licking River, Kentucky
- Circular swath analysis of Olympus Mons, Mars
We recommend to use the conda package manager to install pyosp. It will provide pre-built binaries for all dependencies of pyosp. If you have the miniconda (recommend; only containing python and the conda package manager), or anaconda distribution (a python distribution with many installed libraries for data science) installed, then simply execute the following command:
conda install -c conda-forge pyosp
Although it is not required, installing the library in a clean environment represents good practice and helps avoid potential dependency conflicts. We also recommends install all dependencies with pyosp through conda-forge channel
conda create -n env_pyosp
conda activate env_pyosp
conda config --env --add channels conda-forge
conda config --env --set channel_priority strict
conda install python=3 pyosp
git clone https://github.com/pyosp-devs/pyosp.git
cd pyosp
conda install --file requirements.txt
python setup.py install
You can verify installation by entering a python shell and typing:
import pyosp
print(pyosp.__version__)
Here is a simple example of using pyosp to perform swath analysis on a synthetic mountain case. The cross-width of mountain is around 90m, and flat ground has elevation of zero.
Original, elevation, slope and tpi based swath calculation.
import pyosp
baseline = pyosp.datasets.get_path("homo_baseline.shp") # the path to baseline shapefile
raster = pyosp.datasets.get_path("homo_mount.tif") # the path to raster file
orig = pyosp.Orig_curv(baseline, raster, width=100,
line_stepsize=3, cross_stepsize=None)
elev = pyosp.Elev_curv(baseline, raster, width=100,
min_elev=0.01,
line_stepsize=3, cross_stepsize=None)
slope = pyosp.Slope_curv(baseline, raster, width=100,
min_slope=1,
line_stepsize=3, cross_stepsize=None)
tpi = pyosp.Tpi_curv(baseline, raster, width=100,
tpi_radius=50, min_tpi=0,
line_stepsize=3, cross_stepsize=None)
We can plot with matplotlib, or open in GIS software.
Plot, for example, elevation based swath profile.
elev.profile_plot()
For more example and usage, please refer to our documentation.
If you use PyOSP for your work, please cite as:
Y. Zhu, J.M. Dortch, M.A. Massey, et al., An Intelligent Swath Tool to Characterize complex Topographic Features: Theory and Application in the Teton Range, Licking River, and Olympus Mons, Geomorphology (2021), https://doi.org/10.1016/j.geomorph.2021.107778
Any contributions you make are greatly appreciated.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazingfeature
) - Commit your changes (
git commit -m 'add some amazingfeature'
) - Push to the branch (
git push origin feature/amazingfeature
) - Open a pull request
- If you think pyosp is useful, consider giving it a star.
- If something is not working, create an issue
- If you need to get in touch for other reasons, send us an email
This work is supported by Kentucky Geological Survey.