Example #1
0
	def __init__(self, canvas):
		QgsMapToolEmitPoint.__init__(self, canvas)

		self.canvas = canvas
		self.action = None

		self.canvas.mapToolSet.connect(self._toolChanged)
    def __init__(self, iface):
        self.iface = iface
        self.canvas = iface.mapCanvas()
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rasterShadow = RasterShadowMapCanvasItem(self.canvas)

        self.firstPoint = None

        self.rubberBandOrigin = QgsRubberBand(
            self.canvas, QgsWkbTypes.PointGeometry)
        self.rubberBandOrigin.setColor(Qt.red)
        self.rubberBandOrigin.setIcon(QgsRubberBand.ICON_CIRCLE)
        self.rubberBandOrigin.setIconSize(7)
        self.rubberBandOrigin.setWidth(2)

        self.rubberBandDisplacement = QgsRubberBand(
            self.canvas, QgsWkbTypes.LineGeometry)
        self.rubberBandDisplacement.setColor(Qt.red)
        self.rubberBandDisplacement.setWidth(1)

        self.rubberBandExtent = QgsRubberBand(
            self.canvas, QgsWkbTypes.LineGeometry)
        self.rubberBandExtent.setColor(Qt.red)
        self.rubberBandExtent.setWidth(2)

        self.isLayerVisible = True

        self.reset()
Example #3
0
 def __init__(self, canvas, layer, column, bindto, radius ):
     QgsMapToolEmitPoint.__init__(self, canvas)
     self.layer = layer
     self.column = column
     self.bindto = bindto
     self.canvas = canvas
     self.bindto = bindto
     self.searchradius = radius
     self.canvasClicked.connect(self.findFeature)
     self.canvas.setMapTool(self)
     self.band = QgsRubberBand(self.canvas)
     self.band.setColor(Qt.blue)
     self.band.setWidth(3)
     self.rect = QgsRectangle()
     self.cursor = QCursor(QPixmap(["16 16 3 1",
         "      c None",
         ".     c #32CD32",
         "+     c #32CD32",
         "                ",
         "       +.+      ",
         "      ++.++     ",
         "     +.....+    ",
         "    +.     .+   ",
         "   +.   .   .+  ",
         "  +.    .    .+ ",
         " ++.    .    .++",
         " ... ...+... ...",
         " ++.    .    .++",
         "  +.    .    .+ ",
         "   +.   .   .+  ",
         "   ++.     .+   ",
         "    ++.....+    ",
         "      ++.++     ",
         "       +.+      "]))
Example #4
0
  def __init__(self, canvas):
    self.canvas = canvas
    QgsMapToolEmitPoint.__init__(self, self.canvas)

    self.rubberBand = QgsRubberBand(self.canvas, QGis.Polygon)
    self.rubberBand.setColor(QColor(255, 0, 0, 180))
    self.rubberBand.setWidth(1)
    self.reset()
Example #5
0
 def __init__(self, iface, couleur):
     self.canvas = iface.mapCanvas()
     QgsMapToolEmitPoint.__init__(self, self.canvas)
     self.iface = iface
     self.rb = QgsRubberBand(self.canvas, QgsWkbTypes.PolygonGeometry)
     self.rb.setColor(couleur)
     self.reset()
     return None
 def __init__(self, settings, iface):
     QgsMapToolEmitPoint.__init__(self, iface.mapCanvas())
     self.iface = iface
     self.canvas = iface.mapCanvas()
     self.settings = settings
     self.latlon = LatLon()
     self.capture4326 = False
     self.canvasClicked.connect(self.clicked)
     self.marker = None
    def __init__(self, canvas):
        self.canvas = canvas
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rubberBand = QgsRubberBand(self.canvas, QgsWkbTypes.PolygonGeometry)
        self.rubberBand.setColor(QColor(255, 0, 0, 100))
        self.rubberBand.setWidth(2)

        self.reset()
Example #8
0
    def __init__(self, iface, couleur, largeur):
        self.canvas = iface.mapCanvas()
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.iface = iface
        self.rb = QgsRubberBand(self.canvas, QgsWkbTypes.PolygonGeometry)
        self.rb.setColor(couleur)
        self.rb.setWidth(largeur)
        self.reset()
        return None
Example #9
0
 def __init__(self, canvas, parent):
     self.canvas = canvas
     self.sectionManagerDlg = parent
     self.drillManager = self.sectionManagerDlg.drillManager
     QgsMapToolEmitPoint.__init__(self, self.canvas)
     self.rubberBand = QgsRubberBand(self.canvas, True)
     self.rubberBand.setColor(QtCore.Qt.red)
     self.rubberBand.setWidth(1.5)
     
     self.reset()
Example #10
0
    def __init__(self, canvas):
        self.canvas = canvas
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rubberBand = QgsRubberBand(self.canvas,
                                        QgsWkbTypes.PolygonGeometry)
        self.rubberBand.setColor(QColor(255, 0, 0, 100))
        self.rubberBand.setWidth(2)

        self.reset()
 def __init__(self, canvas, iface, dockwidget, currentMapTool):
     self.canvas = canvas
     self.iface = iface
     self.currentMapTool = currentMapTool
     self.dockwidget = dockwidget
     QgsMapToolEmitPoint.__init__(self, self.canvas)
     self.rubberBand = QgsRubberBand(self.canvas, QGis.Point)
     self.rubberBand.setColor(QColor(255,5,5))
     self.rubberBand.setWidth(1)
     self.reset()
Example #12
0
    def __init__(self, canvas):
        self.canvas = canvas
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rubberband = QgsRubberBand(self.canvas, QGis.Polygon)
        self.rubberband.setColor(Qt.red)
        self.rubberband.setWidth(1)

        self.point = None
        self.points = []
Example #13
0
    def __init__(self, settings, iface):
        QgsMapToolEmitPoint.__init__(self, iface.mapCanvas())
        self.iface = iface
        self.settings = settings
        self.canvas = iface.mapCanvas()

        # Set up a polygon rubber band
        self.rubber = QgsRubberBand(self.canvas)
        self.rubber.setColor(QColor(255, 70, 0, 200))
        self.rubber.setWidth(3)
        self.rubber.setBrushStyle(Qt.NoBrush)
Example #14
0
 def __init__(self, action, snapper):
     "..."
     QgsMapToolEmitPoint.__init__(self, Globs.iface.mapCanvas())
     self.action = action
     self.snapper = snapper
     self.action.setChecked(False)
     self.layer_group = None
     self.layer_waypoints = None
     self.layer_routes = []
     self.pt_start = None
     self.pt_dest = None
     self.routes_edges = []
Example #15
0
    def __init__(self, canvas):
        """
        :param canvas: current map canvas
        :type canvas: QgsMapCanvas
        """
        self.canvas = canvas
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.crsSrc = self.canvas.mapSettings().destinationCrs()
        self.previous_point = None
        self.points = []
        self.reset()
Example #16
0
 def __init__(self, canvas):
     self.canvas = canvas
     QgsMapToolEmitPoint.__init__(self, self.canvas)
     self.replaced_tool = canvas.mapTool()
     self.points = []
     self.done = True
     self._line_band = None
     self._poly_band = None
     self._markers = []
     self._info = None
     self._line_color = Qt.black
     self._poly_color = Qt.lightGray
     self._data = {}
Example #17
0
    def __init__(self, iface):
        self.iface = iface
        self.canvas = iface.mapCanvas()
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rb = QgsRubberBand(self.canvas, QgsWkbTypes.PolygonGeometry)
        self.rb.setColor(QColor(255,0,0,50))
        self.rb.setFillColor(QColor(255,0,0,50))
        self.rb.setWidth(1)
        self.drawrubber = False
        self.rubberPointX = 0
        self.rubberPointY = 0
        self.layer = None
    def __init__(self, canvas):
        # call the parent constructor
        QgsMapToolEmitPoint.__init__(self, canvas)
        # store the passed canvas
        self.canvas = canvas

        # flag to know whether the tool is performing a drawing operation 
        self.isDrawing = False

        # create and setup the rubber band to display the line
        self.rubberBand = QgsRubberBand( self.canvas, False )    # False = not a polygon = a line
        self.rubberBand.setColor( Qt.red )
        self.rubberBand.setWidth( 1 )
    def __init__(self, iface):
        self.iface = iface
        self.canvas = iface.mapCanvas()
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rasterShadow = RasterShadowMapCanvasItem(self.canvas)

        self.rubberBandExtent = QgsRubberBand(
            self.canvas, QgsWkbTypes.LineGeometry)
        self.rubberBandExtent.setColor(Qt.red)
        self.rubberBandExtent.setWidth(1)

        self.reset()
Example #20
0
    def __init__(self, iface):
        self.iface = iface
        self.canvas = iface.mapCanvas()
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rasterShadow = RasterShadowMapCanvasItem(self.canvas)

        self.rubberBandExtent = QgsRubberBand(self.canvas,
                                              QgsWkbTypes.LineGeometry)
        self.rubberBandExtent.setColor(Qt.red)
        self.rubberBandExtent.setWidth(1)

        self.reset()
Example #21
0
    def __init__(self, canvas):
        """
        :param canvas: current map canvas
        :type canvas: QgsMapCanvas
        """

        self.canvas = canvas
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rubberBand = QgsRubberBand(self.canvas, True)
        # self.rubberBand.setFillColor(QColor(DEFAULT_COLOR))
        self.rubberBand.setStrokeColor(QColor(DEFAULT_COLOR))
        self.rubberBand.setWidth(2)
        self.reset()
    def __init__(self, canvas):
        # call the parent constructor
        QgsMapToolEmitPoint.__init__(self, canvas)
        # store the passed canvas
        self.canvas = canvas

        # flag to know whether the tool is performing a drawing operation
        self.isDrawing = False

        # create and setup the rubber band to display the line
        self.rubberBand = QgsRubberBand(
            self.canvas, False)  # False = not a polygon = a line
        self.rubberBand.setColor(Qt.red)
        self.rubberBand.setWidth(1)
Example #23
0
 def __init__(self, iface):
     """ initialize rubberband line drawing
         :param iface: interface to QGIS
     """
     self.iface = iface
     self.layer = None
     self.canvas = self.iface.mapCanvas()
     QgsMapToolEmitPoint.__init__(self, self.canvas)
     self.rubberBand = QgsRubberBand(self.canvas)
     self.rubberBand.setColor(Qt.red)
     self.rubberBand.setWidth(1)
     self.startPoint = None
     self.endPoint = None
     self.reset()
Example #24
0
    def __init__(self, canvas, button='None', icon=None):
        """
        :param canvas: current map canvas
        :type: QgsMapCanvas

        :param button: name of 'Map!' button pressed.
        :type button: str
        """

        QgsMapToolEmitPoint.__init__(self, canvas)
        self.canvas = canvas
        self.button = button
        # self.cursor = QCursor(QPixmap(os.path.join(ICON_DIR, 'icon_locate.png')).scaledToWidth(48), 24, 24)
        self.cursor = QCursor(QPixmap(RESOURCE_PREFIX + icon).scaledToWidth(48), 24, 24)
Example #25
0
    def __init__(self, canvas, iface, turn_off_snap, smooth=False):
        '''
        canvas - link to the QgsCanvas of the application
        iface - link to the Qgis Interface
        turn_off_snap - flag sets snapping to the nearest color
        smooth - flag sets smoothing of the traced path
        '''

        self.iface = iface

        # list of Anchors for current line
        self.anchors = []

        # for keeping track of mouse event for rubber band updating
        self.last_mouse_event_pos = None

        self.tracing_mode = TracingModes.PATH

        self.turn_off_snap = turn_off_snap
        self.smooth_line = smooth

        # possible variants: gray_diff, as_is, color_diff (using v from hsv)
        self.grid_conversion = "gray_diff"

        # QApplication.restoreOverrideCursor()
        # QApplication.setOverrideCursor(Qt.CrossCursor)
        QgsMapToolEmitPoint.__init__(self, canvas)

        self.rlayer = None
        self.grid_changed = None
        self.snap_tolerance = None  # snap to color
        self.snap2_tolerance = None  # snap to itself
        self.vlayer = None
        self.grid = None
        self.sample = None

        self.tracking_is_active = False

        # False = not a polygon
        self.rubber_band = QgsRubberBand(self.canvas(), False)
        self.markers = []
        self.marker_snap = QgsVertexMarker(self.canvas())
        self.marker_snap.setColor(QColor(255, 0, 255))

        self.find_path_task = None

        self.change_state(WaitingFirstPointState)

        self.last_vlayer = None
Example #26
0
    def __init__(self, canvas, dialog=None):
        QgsMapToolEmitPoint.__init__(self, canvas)

        self.canvas = canvas
        self.dialog = dialog
        if dialog is not None:
            self.dialog.hide()
        self.rubberBand = QgsRubberBand(canvas, True)
        self.rubberBand.setColor(Qt.red)
        self.rubberBand.setFillColor(Qt.red)
        self.rubberBand.setWidth(1)

        self.start_point = None
        self.end_point = None
        self.is_activated = False
Example #27
0
    def __init__(self, iface, chart):
        self.fetcher = None
        self.iface = iface
        self.chart = chart
        self._debug = False
        self.broke_size = 3.0
        QgsMapToolEmitPoint.__init__(self, self.iface.mapCanvas())
        self.rubberBand = QgsRubberBand(self.iface.mapCanvas(), True)
        self.rubberBand.setColor(QColor(255, 0, 0, 100))
        self.rubberBand.setWidth(2)

        self.rubberBand2 = QgsRubberBand(self.iface.mapCanvas(), True)
        self.rubberBand2.setColor(QColor(255, 0, 0, 50))

        self.reset()
    def __init__(self, canvas):
        """
        :param canvas: current map canvas
        :type canvas: QgsMapCanvas
        """
        self.canvas = canvas
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rubberBand = QgsRubberBand(self.canvas, False)
        self.rubberBand.setStrokeColor(QColor(DEFAULT_COLOR))
        self.rubberBand.setWidth(3)

        self.crsSrc = self.canvas.mapSettings().destinationCrs()
        self.previous_point = None
        self.points = []
        self.reset()
Example #29
0
 def __init__(self, canvas):
     self.canvas = canvas
     QgsMapToolEmitPoint.__init__(self, self.canvas)
     # rubberband class gives the user visual feedback of the drawing
     self.rubberBand = QgsRubberBand(self.canvas, True)
     # setting up outline and fill color: both red
     self.rubberBand.setColor(QColor(235, 36, 21))
     # RGB color values, last value indicates transparency (0-255)
     self.rubberBand.setFillColor(QColor(255, 79, 66, 140))
     self.rubberBand.setWidth(3)
     self.points = []
     # a flag indicating when a single polygon is finished
     self.finished = False
     self.poly_bbox = False
     self.double_click_flag = False
     self.reset()
Example #30
0
    def __init__(self, canvas, layer, multi=True):
        self.canvas = canvas
        QgsMapToolEmitPoint.__init__(self, self.canvas)
        self._multi = multi
        self._layer = layer

        # Cursor
        cursor = QCursor()
        cursor.setShape(Qt.CrossCursor)
        self.setCursor(cursor)

        # RubberBand Style
        self.rubberBand = QgsRubberBand(self.canvas, True)
        self.rubberBand.setBrushStyle(Qt.Dense4Pattern)
        self.rubberBand.setColor(QColor(255, 181, 92))
        self.rubberBand.setStrokeColor(QColor(232, 137, 72))
        self.rubberBand.setWidth(0.2)
        self.reset()
    def __init__(self, canvas, txtXCoord, txtYCoord, annotation=None):
        self.canvas = canvas
        self.txtXCoord = txtXCoord
        self.txtYCoord = txtYCoord
        QgsMapToolEmitPoint.__init__(self, self.canvas)
        self.annotation = annotation
        self.mSnapper = QgsMapCanvasSnapper(canvas)
        self.rubberBand = QgsRubberBand(canvas, QGis.Point)
        self.rubberBand.setColor(Qt.red)
        self.rubberBand.setWidth(10)
        self.rubberBandClick = QgsRubberBand(canvas, QGis.Point)
        self.rubberBandClick.setColor(Qt.green)
        self.rubberBandClick.setWidth(3)
        #         lblDoc = QTextDocument(label)
        #         self.annotation.setDocument(lblDoc)
        #         self.annotation.setFrameBackgroundColor(QColor(0,0,0,0))
        #         self.annotation.setFrameSize( QSizeF( 30, 20 ) )

        self.reset()
Example #32
0
 def __init__(self, canvas):
     self.canvas = canvas
     s = QSettings()
     s.beginGroup('qgis')
     color = QColor(int(s.value('default_measure_color_red', 222)),
                    int(s.value('default_measure_color_green', 17)),
                    int(s.value('default_measure_color_blue', 28)))
     s.endGroup()
     QgsMapToolEmitPoint.__init__(self, self.canvas)
     self.rubberBand = QgsRubberBand(self.canvas, QgsWkbTypes.LineGeometry)
     self.rubberBandDraw = QgsRubberBand(self.canvas,
                                         QgsWkbTypes.LineGeometry)
     self.rubberBandDraw.setColor(color)
     self.rubberBandDraw.setWidth(1)
     self.rubberBand.setColor(color)
     self.rubberBand.setWidth(1)
     # self.rubberBand.setLineStyle(Qt.DashLine)
     self.points = []
     self.reset()
Example #33
0
    def __init__(self, canvas, dataBaseProcedureData0, point3d0,
                 procEntityListType0):
        self.canvas = canvas
        QgsMapToolEmitPoint.__init__(self, self.canvas)
        self.mSnapper = QgsMapCanvasSnapper(canvas)
        self.rubberBand = QgsRubberBand(canvas, QGis.Point)
        self.rubberBand.setColor(Qt.red)
        self.rubberBand.setWidth(10)
        self.rubberBandClick = QgsRubberBand(canvas, QGis.Point)
        self.rubberBandClick.setColor(Qt.green)
        self.rubberBandClick.setWidth(3)
        self.obstaclesLayerList = QgisHelper.getSurfaceLayers(
            SurfaceTypes.Obstacles)
        self.demLayerList = QgisHelper.getSurfaceLayers(SurfaceTypes.DEM)
        self.reset()

        self.dataBaseProcedureData_0 = dataBaseProcedureData0
        self.point3d_0 = point3d0
        self.procEntityListType_0 = procEntityListType0
 def __init__(self, canvas):
     self.canvas = canvas
     s = QSettings()
     s.beginGroup('Qgis')
     color = QColor(
         int(s.value('default_measure_color_red')),
         int(s.value('default_measure_color_green')),
         int(s.value('default_measure_color_blue'))
     )
     s.endGroup()
     QgsMapToolEmitPoint.__init__(self, self.canvas)
     self.rubberBand = QgsRubberBand(self.canvas, QGis.Line)
     self.rubberBandDraw = QgsRubberBand(self.canvas, QGis.Line)
     self.rubberBandDraw.setColor(color)
     self.rubberBandDraw.setWidth(1)
     self.rubberBand.setColor(color)
     self.rubberBand.setWidth(1)
     # self.rubberBand.setLineStyle(Qt.DashLine)
     self.points = []
     self.reset()
    def __init__(self, canvas):
        """Constructor for the map tool.

        :param canvas: Canvas that tool will interact with.
        :type canvas: QgsMapCanvas
        """
        self.canvas = canvas
        self.start_point = None
        self.end_point = None
        self.is_emitting_point = False

        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rubber_band = QgsRubberBand(self.canvas, geometryType=QGis.Line)
        self.rubber_band.setColor(QColor(0, 0, 240, 100))
        # Needs QGIS 2.6
        # self.rubber_band.setFillColor(QColor(0, 0, 240, 0))
        self.rubber_band.setWidth(1)

        self.reset()
Example #36
0
    def __init__(self, iface):
        self.iface = iface
        self.canvas = iface.mapCanvas()
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rasterShadow = RasterShadowMapCanvasItem(self.canvas)

        self.rubberBandExtent = QgsRubberBand(self.canvas,
                                              QgsWkbTypes.LineGeometry)
        self.rubberBandExtent.setColor(Qt.red)
        self.rubberBandExtent.setWidth(1)

        # In case of rotation around pressed point (ctrl)
        # Use rubberBand for displaying an horizontal line.
        self.rubberBandDisplacement = QgsRubberBand(self.canvas,
                                                    QgsWkbTypes.LineGeometry)
        self.rubberBandDisplacement.setColor(Qt.red)
        self.rubberBandDisplacement.setWidth(1)

        self.reset()
    def __init__(self, iface):
        self.iface = iface
        self.canvas = iface.mapCanvas()
        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rasterShadow = RasterShadowMapCanvasItem(self.canvas)

        self.rubberBandExtent = QgsRubberBand(
            self.canvas, QgsWkbTypes.LineGeometry)
        self.rubberBandExtent.setColor(Qt.red)
        self.rubberBandExtent.setWidth(1)

        # In case of rotation around pressed point (ctrl)
        # Use rubberBand for displaying an horizontal line.
        self.rubberBandDisplacement = QgsRubberBand(
            self.canvas, QgsWkbTypes.LineGeometry)
        self.rubberBandDisplacement.setColor(Qt.red)
        self.rubberBandDisplacement.setWidth(1)

        self.reset()
Example #38
0
 def __init__(self,
              ui_element: QWidget,
              layers: List[QgsVectorLayer] = [],
              canvas: QgsMapCanvas = None):
     '''
     Parameters
     ----------
     ui_element : QWidget
         clickable UI element, clicking on it will adctivate/deactivate this
         tool
     layers : list, optional
         the layers containing the features that can be picked,
         defaults to not setting any layers
     canvas : QgsMapCanvas, optional
         the map canvas the tool will work on, defaults to the map canvas of
         the QGIS UI
     '''
     MapTool.__init__(self, ui_element, canvas=canvas)
     QgsMapToolEmitPoint.__init__(self, canvas=self.canvas)
     self._layers = layers
Example #39
0
    def __init__(self, canvas):
        """Constructor for the map tool.

        :param canvas: Canvas that tool will interact with.
        :type canvas: QgsMapCanvas
        """
        self.canvas = canvas
        self.start_point = None
        self.end_point = None
        self.is_emitting_point = False

        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rubber_band = QgsRubberBand(self.canvas, geometryType=QGis.Line)
        self.rubber_band.setColor(QColor(0, 0, 240, 100))
        # Needs QGIS 2.6
        # self.rubber_band.setFillColor(QColor(0, 0, 240, 0))
        self.rubber_band.setWidth(1)

        self.reset()
Example #40
0
 def __init__(self, MapExplorer):
     self.mainWindow = MapExplorer
     self.canvas = MapExplorer.mapCanvas
     self.rasterlayer = MapExplorer.layer
     QgsMapToolEmitPoint.__init__(self, self.canvas)
     self.rubberBand = QgsRubberBand(self.canvas, True)
     self.rubberBand.setColor(QColor(255, 0, 0))
     self.rubberBand.setWidth(1)
     self.tmpRubberBand = QgsRubberBand(self.canvas, True)
     self.tmpRubberBand.setColor(QColor(255, 0, 0))
     self.tmpRubberBand.setWidth(1)
     self.categories = []
     self.reset()
     self.methodsDict = {
         "最小距离": self.MinDistance,
         "最大似然": self.MaxLikelihood,
         "马氏距离": self.Mahalanobis,
         "支持向量机": self.SVM,
         "神经网络": self.ANN,
         "随机森林": self.RandomForest,
         "AdaBoost": self.AdaBoost
     }
    def __init__(self, iface, dbm, imageRegistry, apisLayer):
        self.iface = iface
        self.canvas = self.iface.mapCanvas()
        self.dbm = dbm
        self.imageRegistry = imageRegistry
        self.apisLayer = apisLayer

        QgsMapToolEmitPoint.__init__(self, self.canvas)

        self.rubberBand = QgsRubberBand(self.canvas,
                                        QgsWkbTypes.PolygonGeometry)
        self.rubberBand.setColor(QColor(255, 128, 0, 255))
        self.rubberBand.setFillColor(QColor(255, 128, 0, 128))
        self.rubberBand.setWidth(1)

        self.topic = 'image'  # 'image', 'site', 'findspot'

        self.reset()

        self.imageSelectionListDlg = APISImageSelectionList(
            self.iface,
            self.dbm,
            self.imageRegistry,
            self.apisLayer,
            parent=self.iface.mainWindow())
        self.siteSelectionListDlg = APISSiteSelectionList(
            self.iface,
            self.dbm,
            self.imageRegistry,
            self.apisLayer,
            parent=self.iface.mainWindow())
        self.findspotSelectionListDlg = APISFindspotSelectionList(
            self.iface,
            self.dbm,
            self.imageRegistry,
            self.apisLayer,
            parent=self.iface.mainWindow())

        self.worker = None
Example #42
0
 def __init__(self, canvas, layer, column, bindto, radius):
     QgsMapToolEmitPoint.__init__(self, canvas)
     self.layer = layer
     self.column = column
     self.bindto = bindto
     self.canvas = canvas
     self.bindto = bindto
     self.searchradius = radius
     self.canvasClicked.connect(self.findFeature)
     self.canvas.setMapTool(self)
     self.band = QgsRubberBand(self.canvas)
     self.band.setColor(Qt.blue)
     self.band.setWidth(3)
     self.rect = QgsRectangle()
     self.cursor = QCursor(
         QPixmap([
             "16 16 3 1", "      c None", ".     c #32CD32",
             "+     c #32CD32", "                ", "       +.+      ",
             "      ++.++     ", "     +.....+    ", "    +.     .+   ",
             "   +.   .   .+  ", "  +.    .    .+ ", " ++.    .    .++",
             " ... ...+... ...", " ++.    .    .++", "  +.    .    .+ ",
             "   +.   .   .+  ", "   ++.     .+   ", "    ++.....+    ",
             "      ++.++     ", "       +.+      "
         ]))
    def __init__(self, canvas, annotation=None):
        self.canvas = canvas
        #         self.tableView = tableView
        #         self.standardItemModel = standardItemModel
        #         self.txtXCoord = txtXCoord
        #         self.txtYCoord = txtYCoord
        QgsMapToolEmitPoint.__init__(self, self.canvas)
        self.annotation = annotation
        self.mSnapper = QgsMapCanvasSnapper(canvas)
        self.rubberBand = QgsRubberBand(canvas, QGis.Point)
        self.rubberBand.setColor(Qt.red)
        self.rubberBand.setWidth(10)
        self.rubberBandClick = QgsRubberBand(canvas, QGis.Point)
        self.rubberBandClick.setColor(Qt.green)
        self.rubberBandClick.setWidth(3)
        self.obstaclesLayerList = QgisHelper.getSurfaceLayers(
            SurfaceTypes.Obstacles)
        self.demLayerList = QgisHelper.getSurfaceLayers(SurfaceTypes.DEM)
        #         lblDoc = QTextDocument(label)
        #         self.annotation.setDocument(lblDoc)
        #         self.annotation.setFrameBackgroundColor(QColor(0,0,0,0))
        #         self.annotation.setFrameSize( QSizeF( 30, 20 ) )

        self.reset()
Example #44
0
    def __init__(self, canvas):
        QgsMapToolEmitPoint.__init__(self, canvas)

        self.canvas = canvas
        self.cursor = Qt.CrossCursor
 def __init__(self, iface):
     QgsMapToolEmitPoint.__init__(self, iface.mapCanvas())
     self.iface = iface
     self.canvas = iface.mapCanvas()
     self.canvasClicked.connect(self.clicked)
     self.marker = None
Example #46
0
 def __init__(self, canvas):
   self.canvas = canvas
   QgsMapToolEmitPoint.__init__(self, self.canvas)
   self.point = None