Data reclassification
Data reclassification of swath profile may not be dicusses in the current literature. However, this offered functionality by PyOSP could be of interest to many geomorphologist. For example, in a characterized swath profile, what is the statistics to which having TPI>0? Or, TPI<0?
PyOSP provides post-process of swath data according to elevation, slope, or TPI classification. Below is an example of TPI reclassificationo of elevation-based swath object.
Step 1. Generate an elevation-based swath object
[1]:
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
elev = pyosp.Elev_curv(baseline, raster, width=100,
min_elev=0.01,
line_stepsize=3, cross_stepsize=None)
Processing: [#########################] 71 of 71 lineSteps
Now, let’s plot the corresponding swath profile.
[2]:
elev.profile_plot()
Step 2. Reclassification with swath data (TPI in this case)
In addition to what plotted above, we want to further explore, for example, the swath profile with data points having TPI>0 and TPI<0, respectively. Since TPI = 0 relates to the inflection of slope shape where topography changes from concave-down (TPI > 0) to convex up (TPI < 0). Thus, these two swaths enable the separation of topography via geomorphic processes, with positive and negative TPI representing erosional and depositional areas of the topography, respectively.
[3]:
# radius refers to TPI radius
# swath profile with points having TPI>0
dat = elev.post_tpi(radius=50, min_val=0, swath_plot=True)
[4]:
# swath profile with points having TPI<0
dat = elev.post_tpi(radius=50, max_val=0, swath_plot=True)
Step 3. Reclassification with cross-swath analysis (optional)
Post-processing can also be coupled with cross-swath analysis. For example, we can plot the cross-swath with reclassification of TPI>0.
[5]:
dat = elev.post_tpi(radius=50, min_val=0, swath_plot=True, cross=True)
Step 4. Reclassification with density scatter plot (optional)
[6]:
dat = elev.post_tpi(radius=50, min_val=0, swath_plot=False, cross=False, density_scatter=True)
Step 5. Reclassification with cross-swath and density-scatter (optional)
[7]:
dat = elev.post_tpi(radius=50, min_val=0, swath_plot=False, cross=True, density_scatter=True, cmap="jet", s=10)