Skip to content

Commit

Permalink
after review
Browse files Browse the repository at this point in the history
  • Loading branch information
ghtmtt committed May 15, 2019
1 parent 4ca3935 commit b3a8d8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 2 additions & 3 deletions python/plugins/processing/algs/help/qgis.yaml
Expand Up @@ -56,10 +56,9 @@ qgis:checkvalidity: >
qgis:climbalongline: >
This algorithm calculates the total climb and descent along line geometries.

It works only if the line layer already has Z values on the vertex. If it does not, consider using the Drape (set z-value from
raster) algorithm.
It works only if the geometries have Z values. If it does not, and you have a DEM, you can use the Drape (set z-value from raster) algorithm to add Z values.

The output layer is a copy of the input layer with some additional fields that represent the total climb, total descent, the minimum elevation and the maximum elevation.
The output layer is a copy of the input layer with additional fields that contain the total climb, total descent, the minimum elevation and the maximum elevation for each line geometry. If the input layer contains fields with the same names as these added fields, they will be overwritten.

qgis:clip: >
This algorithm clips a vector layer using the polygons of an additional polygons layer. Only the parts of the features in the input layer that falls within the polygons of the clipping layer will be added to the resulting layer.
Expand Down
5 changes: 4 additions & 1 deletion python/plugins/processing/algs/qgis/Climb.py
Expand Up @@ -135,7 +135,7 @@ def processAlgorithm(self, parameters, context, feedback):
hasZ = QgsWkbTypes.hasZ(source.wkbType())

if not hasZ:
feedback.reportError(self.tr('The layer has not Z values. Please use the Drape algorithm with a DEM layer to extact the Z value.'))
feedback.reportError(self.tr('The layer does not have Z values. If you have a DEM, use the Drape algorithm to extract Z values.'))
return

thefields = QgsFields()
Expand Down Expand Up @@ -195,6 +195,9 @@ def processAlgorithm(self, parameters, context, feedback):
zval = 0
for v in part.vertices():
zval = v.z()
if math.isnan(zval):
feedback.pushInfo("Missing Z value")
continue
if first:
prevz = zval
minelev = zval
Expand Down

0 comments on commit b3a8d8f

Please sign in to comment.