Skip to content

Commit

Permalink
Implementing sorted multi-profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
mauroalberti committed Jul 31, 2018
1 parent a50f7e1 commit 4686b02
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name=qProf
description=Calculates height and slope profiles from DEM and GPX files, and plots geological attitudes and traces on profiles.
about=qProf is a plugin for the generation of topographic and geological profiles. Topography can be extracted from DEM or GPX files. Geological data, such as stratification attitude and geological traces, can be projected on the profile. Intersections between geological outcrops or faults can be determined.
category=Raster
version=0.4.0
version=0.4.1
qgisMinimumVersion=3.0
icon=icons/qprof.png
author=Mauro Alberti, Marco Zanieri
Expand All @@ -15,6 +15,7 @@ repository=https://github.com/mauroalberti/qProf
experimental=False
deprecated=False
changelog=
0.4.1 : - implemented sorting of profiles in multiprofile case based on field value
0.4.0 : - ported to QGIS 3
0.3.4 : - substitution of geosurf with gsf and other minor internal libraries; implementation of multiple topographic profiles
0.3.3 : - removed minor bug related to profile line definition
Expand Down
9 changes: 7 additions & 2 deletions qProf_QWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,11 @@ def line_layer_params(dialog):

return line_layer, multiple_profiles, order_field_ndx

#multiple_profiles = self.qrbtLineIsMultiProfile.isChecked()
def sort_profile(profile_lines, order_ids):

zipped_profs = zip(order_ids, profile_lines)
return map(lambda v: v[1], sorted(zipped_profs, key=lambda v: v[0]))

current_line_layers = loaded_line_layers()

if len(current_line_layers) == 0:
Expand Down Expand Up @@ -537,7 +541,8 @@ def line_layer_params(dialog):

processed_lines = []
if multiple_profiles:
for orig_line in profile_orig_lines:
sorted_profiles = sort_profile(profile_orig_lines, mergeorder_ids)
for orig_line in sorted_profiles:
processed_lines.append(merge_line(orig_line))
else:
processed_lines.append(merge_lines(profile_orig_lines, mergeorder_ids))
Expand Down

0 comments on commit 4686b02

Please sign in to comment.