From 754ccefabc5c5fb9ba4472b182f1f05cd2a0ebb2 Mon Sep 17 00:00:00 2001 From: Anita Graser Date: Wed, 10 Aug 2016 09:22:50 +0200 Subject: [PATCH] fixed failure to insert only one point Previously, if pointsNumber was 1, it wouldn't insert a new point in the middle. --- python/plugins/processing/algs/qgis/DensifyGeometries.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/python/plugins/processing/algs/qgis/DensifyGeometries.py b/python/plugins/processing/algs/qgis/DensifyGeometries.py index b0c89b15f34..34e6ba98628 100644 --- a/python/plugins/processing/algs/qgis/DensifyGeometries.py +++ b/python/plugins/processing/algs/qgis/DensifyGeometries.py @@ -112,10 +112,7 @@ class DensifyGeometries(GeoAlgorithm): def densify(self, polyline, pointsNumber): output = [] - if pointsNumber != 1: - multiplier = 1.0 / float(pointsNumber + 1) - else: - multiplier = 1 + multiplier = 1.0 / float(pointsNumber + 1) for i in xrange(len(polyline) - 1): p1 = polyline[i] p2 = polyline[i + 1]