16 #ifndef QGSMAPTOOLIDENTIFY_H 17 #define QGSMAPTOOLIDENTIFY_H 53 DefaultQgsSetting = -1,
65 AllLayers = VectorLayer | RasterLayer
67 Q_DECLARE_FLAGS( LayerType,
Type )
73 IdentifyResult() =
default;
76 : mLayer( layer ), mFeature( feature ), mDerivedAttributes( derivedAttributes ) {}
78 IdentifyResult(
QgsMapLayer *layer,
const QString &label,
const QMap< QString, QString > &attributes,
const QMap< QString, QString > &derivedAttributes )
79 : mLayer( layer ), mLabel( label ), mAttributes( attributes ), mDerivedAttributes( derivedAttributes ) {}
82 : mLayer( layer ), mLabel( label ), mFields( fields ), mFeature( feature ), mDerivedAttributes( derivedAttributes ) {}
112 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
const QList<QgsMapLayer *> &layerList = QList<QgsMapLayer *>(),
IdentifyMode mode = DefaultQgsSetting );
123 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
IdentifyMode mode, LayerType layerType = AllLayers );
126 QList<QgsMapToolIdentify::IdentifyResult> identify(
const QgsGeometry &geometry,
IdentifyMode mode, LayerType layerType );
128 QList<QgsMapToolIdentify::IdentifyResult> identify(
const QgsGeometry &geometry,
IdentifyMode mode,
const QList<QgsMapLayer *> &layerList, LayerType layerType );
141 void identifyProgress(
int,
int );
142 void identifyMessage(
const QString & );
143 void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult> & );
157 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
IdentifyMode mode,
const QList<QgsMapLayer *> &layerList, LayerType layerType = AllLayers );
162 bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMapLayer *layer,
const QgsPointXY &point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
164 bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsRasterLayer *layer,
QgsPointXY point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel );
165 bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsVectorLayer *layer,
const QgsPointXY &point );
168 QMap< QString, QString > derivedAttributesForPoint(
const QgsPoint &point );
182 void setCanvasPropertiesOverrides(
double searchRadiusMapUnits );
189 void restoreCanvasPropertiesOverrides();
193 bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMapLayer *layer,
const QgsGeometry &geometry,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
194 bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsRasterLayer *layer,
const QgsGeometry &geometry,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel );
195 bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsVectorLayer *layer,
const QgsGeometry &geometry );
216 QString formatDistance(
double distance )
const;
223 QString formatArea(
double area )
const;
247 void closestPointAttributes(
const QgsAbstractGeometry &geometry,
const QgsPointXY &layerPoint, QMap< QString, QString > &derivedAttributes );
249 QString formatCoordinate(
const QgsPointXY &canvasPoint )
const;
250 QString formatXCoordinate(
const QgsPointXY &canvasPoint )
const;
251 QString formatYCoordinate(
const QgsPointXY &canvasPoint )
const;
256 double mLastMapUnitsPerPixel;
260 int mCoordinatePrecision;
262 double mOverrideCanvasSearchRadius = -1;
265 Q_DECLARE_OPERATORS_FOR_FLAGS( QgsMapToolIdentify::LayerType )
A rectangle specified with double values.
Base class for all map layer types.
This class provides qgis with the ability to render raster datasets onto the mapcanvas.
A class to represent a 2D point.
A QgsMapMouseEvent is the result of a user interaction with the mouse on a QgsMapCanvas.
Container of fields for a vector layer.
A geometry is the spatial representation of a feature.
The feature class encapsulates a single feature including its id, geometry and a list of field/values...
Map canvas is a class for displaying all GIS data types on a canvas.
Utility class for identifying a unique vertex within a geometry.
A class for highlight features on the map.
Abstract base class for all geometries.
Point geometry type, with support for z-dimension and m-values.
DistanceUnit
Units of distance.
Represents a vector layer which manages a vector based data sets.