Skip to content

Commit

Permalink
final updates
Browse files Browse the repository at this point in the history
based on student questions
  • Loading branch information
jorgegil committed Jan 11, 2016
1 parent cfacc9a commit 44c3196
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 18 deletions.
Binary file removed SpatialDecision/icon (1).png
Binary file not shown.
14 changes: 13 additions & 1 deletion SpatialDecision/spatial_decision.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
34 changes: 17 additions & 17 deletions SpatialDecision/spatial_decision_dockwidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
#######
Expand Down Expand Up @@ -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")
Expand Down

0 comments on commit 44c3196

Please sign in to comment.