mauroalberti / qProf

Python plugin for QGIS, to create topographic and geological profiles
GNU General Public License v3.0
25 stars 3 forks source link

qProf sampling intervals varies wildly #18

Open fgfletcher opened 4 months ago

fgfletcher commented 4 months ago

QGIS 3.34.3, qProf 0.5.1, Mac OSX 10.13/6 (High Sierra) Project: EPSG:3614 NAD83(NSRS2007) / New Hampshire (ftUS) Using a DEM with 5.5' x 5.5' pixels Using a line shape file containing a single ~ 36,000' long RR track {i.e., gentle curves and slopes} Setting "line densify distance" = 22 {i.e., 4 DEM pixels} to reduce # of points I get reasonable statistics:

Statistics for profile # 1 Length: 35697.751784624925 Topographic elevations

The graph looks OK

However, when I export as .csv and look at the data, the spacing varies wildly. I'm calculating the Euclidian distance between adjacent points, i.e., sqrt(∆X^2+∆Y^2). Summing all those distances matches the reported length, so the math is OK the spacing begins with 11.92, 22.00, 10.65, 22.00, 22.00, 4.73, 22.00, 22.00, 16.16, 22.00, by midways I'm seeing 22.00, 2.25, 22.00, 0.90, 20.83, 18.03, 14.51, 18.82, 22.00, 7.75,
the last spaces are 11.28, 12.28, 13.03, 13.53, 13.79, 13.80, 13.58, 13.10, 12.40, 11.46

In another test, I used the same line, made new layers with the line shifted West 20' and another shifted East 20'. This produced 3 layers, each containing lines of identical length and shape except for the sideways shift. running qProf with the same settings on the shifted lines

the line shifted +20' results in 3014 points along 35,715.8', with point spacing averaging 11.85' beginning: 11.92, 22.00, 10.65, 22.00, 22.00, 4.73, 22.00, 22.00, 16.16, 22.00, ending: 0.18, 13.80, 0.26, 13.58, 0.36, 13.10, 0.50, 12.40, 0.69, 11.46

the line shifted -20' results in 2995 points along 35,679.6', with point spacing averaging 11.91' beginning: 11.92, 22.00, 10.65, 22.00, 22.00, 4.73, 22.00, 22.00, 16.16, 22.00,
ending: 12.28, 0.04, 13.01, 13.46, 13.65, 13.58, 13.26, 12.67, 11.80, 11.11

These length differences match QGIS' "Identify results" values, but are rather unexpected given that the 3 lines are identical except for the shifting. I thought that, perhaps, the 3d distances were being used, but my 2D Euclidian distances exactly match, so that can't be the issue.

I was hoping to be able to classify the RR bed as being above adjacent terrain below adjacent terrrain on a slope by comparing the elevations 20' to the left and right of the centerline.

But the wild variability in the point spacing defeated my goal.

I am attaching the 3 layers so you can test them yourself.

Cordially, Garth Fletcher layers.zip