From 744d6ecadbda0e9c8f25746b7dceb3849b1c5ff9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Mon, 18 Dec 2017 12:58:17 +0100 Subject: [PATCH 01/10] Describe branch in README --- README | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README b/README index f3d45a5..45ac5b6 100644 --- a/README +++ b/README @@ -1,2 +1,4 @@ DigitizingTools: a QGIS plugin Subsumes different tools useful during digitizing sessions + +QGIS2 branch is the last stable release of QGIS 2 From 7401ad500fa9865b0a11a71680e200f773ab215b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Fri, 12 Jan 2018 08:40:40 +0100 Subject: [PATCH 02/10] Change .gitignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index c19000b..9fd14ba 100644 --- a/.gitignore +++ b/.gitignore @@ -6,5 +6,5 @@ DigitizingTools.zip help/build/ ui*.py *.pyc -tools/dt_icons_rc.py +dt_icons_rc.py From d2555d5f5a91c0f99fa3daea339bdca50a0c3770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Fri, 12 Jan 2018 08:41:11 +0100 Subject: [PATCH 03/10] Remove Qt5 stuff from Makefile --- Makefile | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/Makefile b/Makefile index fe099af..1650611 100644 --- a/Makefile +++ b/Makefile @@ -64,18 +64,6 @@ compile: $(UI_FILES) $(RESOURCE_FILES) %.qm : %.ts lrelease $< -#compile: $(UI_FILES) $(RESOURCE_FILES) -#compile: $(UI_FILES) -compile3: - -%_rc.py : %.qrc - pyrcc5 -o $*_rc.py -py2 $< - -%.py : %.ui - pyuic5 -o $@ $< - -%.qm : %.ts - lrelease $< # The deploy target only works on unix like operating system where # the Python plugin directory is located at: From 21be4fccc3cf6061c5c5a8fa2d6234557909ffe2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Fri, 12 Jan 2018 08:42:16 +0100 Subject: [PATCH 04/10] [BUG] splitfeature: snap to highlighted snap point for first point in rubberBand if user makes left click --- tools/dtsplitfeaturetool.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/dtsplitfeaturetool.py b/tools/dtsplitfeaturetool.py index 6582add..ad628b1 100644 --- a/tools/dtsplitfeaturetool.py +++ b/tools/dtsplitfeaturetool.py @@ -42,6 +42,7 @@ def __init__(self, canvas, iface): settings.endGroup() self.rubberBandColor = QtGui.QColor(r, g, b, a) self.rubberBandWidth = lw + self.snapPoint = None self.reset() def markSnap(self, thisPoint): @@ -63,6 +64,7 @@ def reset(self): self.canvas.scene().removeItem(self.rubberBand) self.rubberBand = None + self.snapPoint = None self.removeSnapMarker() def canvasMoveEvent(self, event): @@ -82,12 +84,12 @@ def canvasMoveEvent(self, event): self.rubberBand.movePoint(self.rubberBand.numberOfVertices() -1, mapToPixel.toMapCoordinates(thisPoint)) else: - snapPoint = snapMatch.point() - self.markSnap(snapPoint) + self.snapPoint = snapMatch.point() + self.markSnap(self.snapPoint) if self.rubberBand != None: self.rubberBand.movePoint(self.rubberBand.numberOfVertices() -1, - snapPoint) + self.snapPoint) def canvasReleaseEvent(self, event): layer = self.canvas.currentLayer() @@ -106,7 +108,12 @@ def canvasReleaseEvent(self, event): self.rubberBand = QgsRubberBand(self.canvas) self.rubberBand.setColor(self.rubberBandColor) self.rubberBand.setWidth(self.rubberBandWidth) - self.rubberBand.addPoint(mapToPixel.toMapCoordinates(thisPoint)) + + if self.snapPoint == None: + self.rubberBand.addPoint(mapToPixel.toMapCoordinates(thisPoint)) + else: + self.rubberBand.addPoint(self.snapPoint) + self.snapPoint = None #self.startedDigitizing.emit(layer, self.lineFeature, startPoint, self.rubberBand) else: self.rubberBand.addPoint(mapToPixel.toMapCoordinates(thisPoint)) From a1cad69033fe1b1d5b9ea16556f1ff8fbb9bed4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Fri, 12 Jan 2018 09:06:24 +0100 Subject: [PATCH 05/10] [CHANGELOG] update --- CHANGELOG.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index db6c5b4..02611f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,12 +1,13 @@ # Change Log All notable changes to this project since Version 0.8.0 will be documented in this file. -## [Unreleased](https://github.com/bstroebl/DigitizingTools/compare/v0.11.3...develop) +## [0.11.5] ### Changed - Highlight feature being preserved in merge features tool, fixes #24 ### Fixed - Activate split multi part and extract part tools for any layer (not just for multi layers). In case the user tries to save a multi feature the data provider will deal with this. +- If before setting first point in split feature a snap is shown, snap to this point if user clicks left. ## [0.11.3] (https://github.com/bstroebl/DigitizingTools/compare/v0.11.0...v0.11.3) - 2017-09-14 ### Changed since 0.11.0 From 1fa249622e29aa56daa6a50b68201343378fc267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Fri, 12 Jan 2018 09:06:59 +0100 Subject: [PATCH 06/10] [VERSION] 0.11.5 --- metadata.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.txt b/metadata.txt index 36d4f2b..2ebc3b6 100644 --- a/metadata.txt +++ b/metadata.txt @@ -14,7 +14,7 @@ qgisMinimumVersion=2.14 description=Subsumes different tools useful during digitizing sessions about=DigitizingTools is meant to be a compilation of tools missing in basic QGIS, especially when digitizing on existing features. It is a collaborative effort and does not contain CAD like functions meant for construction. category=Vector -version=0.11.4 +version=0.11.5 # end of mandatory metadata From 3ea332777d5cdf67f0f85e9eec6210d7f13d9ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Thu, 17 May 2018 15:55:28 +0200 Subject: [PATCH 07/10] [BUG] Reset snapPoint at each mouse move --- tools/dtsplitfeaturetool.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/dtsplitfeaturetool.py b/tools/dtsplitfeaturetool.py index ad628b1..db8eca0 100644 --- a/tools/dtsplitfeaturetool.py +++ b/tools/dtsplitfeaturetool.py @@ -68,6 +68,7 @@ def reset(self): self.removeSnapMarker() def canvasMoveEvent(self, event): + self.snapPoint = None self.removeSnapMarker() # show snap x = event.pos().x() From 45857ef61100492b721d0a06d4bfeb39e04a55e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Thu, 17 May 2018 15:56:22 +0200 Subject: [PATCH 08/10] [BUG] Remove edit command when splitting is cancelled --- tools/dtsplitfeature.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/dtsplitfeature.py b/tools/dtsplitfeature.py index 17209fd..4de7509 100644 --- a/tools/dtsplitfeature.py +++ b/tools/dtsplitfeature.py @@ -127,6 +127,7 @@ def digitizingFinished(self, splitGeom): takeThisOne = -2 break elif answer == QtGui.QMessageBox.Cancel: + self.editLayer.destroyEditCommand() return None if takeThisOne == -2: From d6bd2e2e5ff22983a35f5ccfcf8bb8eead2baf74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Thu, 17 May 2018 15:57:08 +0200 Subject: [PATCH 09/10] Improve code --- tools/dttools.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tools/dttools.py b/tools/dttools.py index 936c0eb..37a47be 100644 --- a/tools/dttools.py +++ b/tools/dttools.py @@ -129,7 +129,7 @@ def enable(self): self.act.setEnabled(False) layer = self.iface.activeLayer() - if layer <> None: + if layer != None: #Only for vector layers. if layer.type() == QgsMapLayer.VectorLayer: if self.allowedGeometry(layer): @@ -183,7 +183,7 @@ def enable(self): doEnable = False layer = self.iface.activeLayer() - if layer <> None: + if layer != None: if layer.type() == 0: #Only for vector layers. if self.allowedGeometry(layer): doEnable = layer.isEditable() @@ -327,7 +327,7 @@ def enable(self): self.button.setEnabled(False) layer = self.iface.activeLayer() - if layer <> None: + if layer != None: #Only for vector layers. if layer.type() == QgsMapLayer.VectorLayer: @@ -578,7 +578,7 @@ def canvasReleaseEvent(self,event): layer = self.canvas.currentLayer() - if layer <> None: + if layer != None: #the clicked point is our starting point startingPoint = QtCore.QPoint(x,y) found = self.getFeatureForPoint(layer, startingPoint) @@ -605,7 +605,7 @@ def canvasReleaseEvent(self,event): layer = self.canvas.currentLayer() - if layer <> None: + if layer != None: #the clicked point is our starting point startingPoint = QtCore.QPoint(x,y) found = self.getFeatureForPoint(layer, startingPoint, inRing = True) @@ -646,7 +646,7 @@ def canvasReleaseEvent(self,event): self.isPolygonLayer(aLayer): visibleLayers.append(aLayer) else: - if layer <> None: + if layer != None: visibleLayers.append(layer) if len(visibleLayers) > 0: @@ -701,7 +701,7 @@ def canvasReleaseEvent(self,event): layer = self.canvas.currentLayer() - if layer <> None: + if layer != None: #the clicked point is our starting point startingPoint = QtCore.QPoint(x,y) found = self.getFeatureForPoint(layer, startingPoint) @@ -781,7 +781,7 @@ def canvasReleaseEvent(self,event): layer = self.canvas.currentLayer() - if layer <> None: + if layer != None: #the clicked point is our starting point startingPoint = QtCore.QPoint(x,y) @@ -843,7 +843,7 @@ def canvasReleaseEvent(self,event): layer = self.canvas.currentLayer() - if layer <> None: + if layer != None: #the clicked point is our starting point startingPoint = QtCore.QPoint(x,y) From 157c9d1f19d08284ed760268e59e24b81e744fe1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Str=C3=B6bl?= Date: Thu, 17 May 2018 15:57:53 +0200 Subject: [PATCH 10/10] [VERSION] 0.11.6 --- metadata.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/metadata.txt b/metadata.txt index 2ebc3b6..05f802d 100644 --- a/metadata.txt +++ b/metadata.txt @@ -14,7 +14,7 @@ qgisMinimumVersion=2.14 description=Subsumes different tools useful during digitizing sessions about=DigitizingTools is meant to be a compilation of tools missing in basic QGIS, especially when digitizing on existing features. It is a collaborative effort and does not contain CAD like functions meant for construction. category=Vector -version=0.11.5 +version=0.11.6 # end of mandatory metadata