diff --git a/SpatialDecision/icon (1).png b/SpatialDecision/icon (1).png deleted file mode 100755 index f696c003..00000000 Binary files a/SpatialDecision/icon (1).png and /dev/null differ diff --git a/SpatialDecision/spatial_decision.py b/SpatialDecision/spatial_decision.py index 0aa16cfe..9827e498 100644 --- a/SpatialDecision/spatial_decision.py +++ b/SpatialDecision/spatial_decision.py @@ -35,7 +35,19 @@ import xlrd except ImportError, e: from .external import xlrd as xl - print('local imported') + +#change sys path to networkx package if not installed +import sys +import inspect +try: + import networkx as nx +except ImportError, e: + cmd_subfolder = os.path.realpath(os.path.abspath(os.path.join(os.path.split(inspect.getfile(inspect.currentframe()))[0],"external"))) + if cmd_subfolder not in sys.path: + sys.path.insert(0, cmd_subfolder) + # now can import complex package placed in the external folder + # import networkx as nx + is_debug = False try: diff --git a/SpatialDecision/spatial_decision_dockwidget.py b/SpatialDecision/spatial_decision_dockwidget.py index c1eac5cb..a09e14f3 100644 --- a/SpatialDecision/spatial_decision_dockwidget.py +++ b/SpatialDecision/spatial_decision_dockwidget.py @@ -27,6 +27,7 @@ from qgis.gui import * import processing +# matplotlib for the charts from matplotlib.backends.backend_qt4agg import FigureCanvasQTAgg as FigureCanvas from matplotlib.figure import Figure @@ -145,23 +146,6 @@ def closeEvent(self, event): self.closingPlugin.emit() event.accept() - def enterPoi(self): - # remember currently selected tool - self.userTool = self.canvas.mapTool() - # activate coordinate capture tool - self.canvas.setMapTool(self.emitPoint) - - def getPoint(self, mapPoint, mouseButton): - # change tool so you don't get more than one POI - self.canvas.unsetMapTool(self.emitPoint) - self.canvas.setMapTool(self.userTool) - #Get the click - if mapPoint: - print(mapPoint) - # here do something with the point - - - ####### # Data functions ####### @@ -542,6 +526,22 @@ def updateNumberFeatures(self): count = layer.featureCount() self.featureCounterEdit.setText(str(count)) + # get the point when the user clicks on the canvas + def enterPoi(self): + # remember currently selected tool + self.userTool = self.canvas.mapTool() + # activate coordinate capture tool + self.canvas.setMapTool(self.emitPoint) + + def getPoint(self, mapPoint, mouseButton): + # change tool so you don't get more than one POI + self.canvas.unsetMapTool(self.emitPoint) + self.canvas.setMapTool(self.userTool) + #Get the click + if mapPoint: + print(mapPoint) + # here do something with the point + # selecting a file for saving def selectFile(self): last_dir = uf.getLastDir("SDSS")