Subgroup: Map

Class: QgsMapToolIdentify

class qgis.gui.QgsMapToolIdentify

Bases: qgis._gui.QgsMapTool

Map tool for identifying features in layers

after selecting a point, performs the identification: - for raster layers shows value of underlying pixel - for vector layers shows feature attributes within search radius (allows editing values when vector layer is in editing mode)

Methods

action Return associated action with map tool or NULL if no action is associated
activate
blockSignals
button Return associated button with map tool or NULL if no button is associated
canvas returns pointer to the tool’s map canvas
canvasDoubleClickEvent Mouse double-click event for overriding.
canvasMoveEvent
canvasPressEvent
canvasReleaseEvent
childEvent
children
clean convenient method to clean members
connectNotify
customEvent
deactivate
deleteLater
disconnect
disconnectNotify
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
event
eventFilter
findChild findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject
findChildren findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject]
flags
formatChanged
gestureEvent gesture event for overriding. Default implementation does nothing.
identify Performs the identification.
identifyLayer Call the right method depending on layer type
identifyMenu return a pointer to the identify menu which will be used in layer selection mode
identifyRasterLayer
identifyVectorLayer
inherits
installEventFilter
isSignalConnected
isWidgetType
isWindowType
keyPressEvent Key event for overriding.
keyReleaseEvent Key event for overriding.
killTimer
metaObject
moveToThread
objectName
parent
property
pyqtConfigure Each keyword argument is either the name of a Qt property or a Qt signal.
receivers
removeEventFilter
searchRadiusMM Get search radius in mm.
searchRadiusMU Get search radius in map units for given context.
sender
senderSignalIndex
setAction Use this to associate a QAction to this maptool.
setButton Use this to associate a button to this maptool.
setCursor Set a user defined cursor
setObjectName
setParent
setProperty
signalsBlocked
startTimer
thread
timerEvent
toCanvasCoordinates
toLayerCoordinates
toMapCoordinates
toMapCoordinatesV2
toolName Emit map tool changed with the old tool
tr
wheelEvent Mouse wheel event for overriding.

Attributes

ActiveLayer
AllLayers
AllowZoomRect
DefaultQgsSetting
EditTool
LayerSelection
RasterLayer
TopDownAll
TopDownStopAtFirst
Transient
VectorLayer
activated signal emitted once the map tool is activated [signal]
changedRasterResults changedRasterResults(self, Iterable[QgsMapToolIdentify.IdentifyResult]) [signal]
deactivated signal emitted once the map tool is deactivated [signal]
destroyed destroyed(self, QObject = None) [signal]
identifyMessage identifyMessage(self, str) [signal]
identifyProgress identifyProgress(self, int, int) [signal]
messageDiscarded emit signal to clear previous message [signal]
messageEmitted emit a message [signal]
objectNameChanged objectNameChanged(self, str) [signal]
staticMetaObject
ActiveLayer = 0
AllLayers = 3
DefaultQgsSetting = -1
class IdentifyMode

Bases: int

class IdentifyResult

Bases: sip.wrapper

Constructor for IdentifyResult

QgsMapToolIdentify.IdentifyResult(layer: QgsMapLayer, feature: QgsFeature, derivedAttributes: Dict[str, str])

QgsMapToolIdentify.IdentifyResult(layer: QgsMapLayer, label: str, attributes: Dict[str, str], derivedAttributes: Dict[str, str])

QgsMapToolIdentify.IdentifyResult(layer: QgsMapLayer, label: str, fields: QgsFields, feature: QgsFeature, derivedAttributes: Dict[str, str])

QgsMapToolIdentify.IdentifyResult(QgsMapToolIdentify.IdentifyResult)

mAttributes
mDerivedAttributes
mFeature
mFields
mLabel
mLayer
mParams
LayerSelection = 3
class LayerType

Bases: sip.wrapper

QgsMapToolIdentify.LayerType(Union[QgsMapToolIdentify.LayerType, QgsMapToolIdentify.Type]) QgsMapToolIdentify.LayerType(QgsMapToolIdentify.LayerType)

RasterLayer = 2
TopDownAll = 2
TopDownStopAtFirst = 1
class Type

Bases: int

VectorLayer = 1
activate(self)
canvasMoveEvent(self, e: QgsMapMouseEvent)
canvasPressEvent(self, e: QgsMapMouseEvent)
canvasReleaseEvent(self, e: QgsMapMouseEvent)
changedRasterResults

changedRasterResults(self, Iterable[QgsMapToolIdentify.IdentifyResult]) [signal]

childEvent()
connectNotify()
customEvent()
deactivate(self)
disconnectNotify()
flags(self) → QgsMapTool.Flags
formatChanged(self, layer: QgsRasterLayer)
identify(self, x: int, y: int, layerList: Iterable[QgsMapLayer] = [], mode: QgsMapToolIdentify.IdentifyMode = QgsMapToolIdentify.DefaultQgsSetting) → List[QgsMapToolIdentify.IdentifyResult]

Performs the identification.

Parameters:
  • x – x coordinates of mouseEvent
  • y – y coordinates of mouseEvent
  • layerList – Performs the identification within the given list of layers. Default value is an empty list, i.e. uses all the layers.
  • mode – Identification mode. Can use Qgis default settings or a defined mode. Default mode is DefaultQgsSetting.
Returns:

a list of IdentifyResult*

identify(self, x: int, y: int, mode: QgsMapToolIdentify.IdentifyMode, layerType: Union[QgsMapToolIdentify.LayerType, QgsMapToolIdentify.Type] = QgsMapToolIdentify.AllLayers) -> List[QgsMapToolIdentify.IdentifyResult] Performs the identification. To avoid being forced to specify IdentifyMode with a list of layers this has been made private and two publics methods are offered

Parameters:
  • x – x coordinates of mouseEvent
  • y – y coordinates of mouseEvent
  • mode – Identification mode. Can use Qgis default settings or a defined mode.
  • layerType – Only performs identification in a certain type of layers (raster, vector). Default value is AllLayers.
Returns:

a list of IdentifyResult*

identify(self, x: int, y: int, mode: QgsMapToolIdentify.IdentifyMode, layerList: Iterable[QgsMapLayer], layerType: Union[QgsMapToolIdentify.LayerType, QgsMapToolIdentify.Type] = QgsMapToolIdentify.AllLayers) -> List[QgsMapToolIdentify.IdentifyResult] Performs the identification. To avoid being forced to specify IdentifyMode with a list of layers this has been made private and two publics methods are offered

Parameters:
  • x – x coordinates of mouseEvent
  • y – y coordinates of mouseEvent
  • mode – Identification mode. Can use Qgis default settings or a defined mode.
  • layerList – Performs the identification within the given list of layers.
  • layerType – Only performs identification in a certain type of layers (raster, vector).
Returns:

a list of IdentifyResult*

identifyLayer(self, results: Iterable[QgsMapToolIdentify.IdentifyResult], layer: QgsMapLayer, point: QgsPointXY, viewExtent: QgsRectangle, mapUnitsPerPixel: float, layerType: Union[QgsMapToolIdentify.LayerType, QgsMapToolIdentify.Type] = QgsMapToolIdentify.AllLayers) → bool

Call the right method depending on layer type

identifyMenu(self) → QgsIdentifyMenu

return a pointer to the identify menu which will be used in layer selection mode this menu can also be customized

identifyMessage

identifyMessage(self, str) [signal]

identifyProgress

identifyProgress(self, int, int) [signal]

identifyRasterLayer(self, results: Iterable[QgsMapToolIdentify.IdentifyResult], layer: QgsRasterLayer, point: QgsPointXY, viewExtent: QgsRectangle, mapUnitsPerPixel: float) → bool
identifyVectorLayer(self, results: Iterable[QgsMapToolIdentify.IdentifyResult], layer: QgsVectorLayer, point: QgsPointXY) → bool
isSignalConnected()
receivers()
sender()
senderSignalIndex()
timerEvent()
toCanvasCoordinates()
toLayerCoordinates()
toMapCoordinates()
toMapCoordinatesV2()