16 #ifndef QGSMAPTOOLIDENTIFY_H 17 #define QGSMAPTOOLIDENTIFY_H 55 DefaultQgsSetting = -1,
68 AllLayers = VectorLayer | RasterLayer | MeshLayer
70 Q_DECLARE_FLAGS( LayerType,
Type )
76 IdentifyResult() =
default;
79 : mLayer( layer ), mFeature( feature ), mDerivedAttributes( derivedAttributes ) {}
81 IdentifyResult(
QgsMapLayer *layer,
const QString &label,
const QMap< QString, QString > &attributes,
const QMap< QString, QString > &derivedAttributes )
82 : mLayer( layer ), mLabel( label ), mAttributes( attributes ), mDerivedAttributes( derivedAttributes ) {}
85 : mLayer( layer ), mLabel( label ), mFields( fields ), mFeature( feature ), mDerivedAttributes( derivedAttributes ) {}
115 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
const QList<QgsMapLayer *> &layerList = QList<QgsMapLayer *>(),
IdentifyMode mode = DefaultQgsSetting );
127 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
IdentifyMode mode, LayerType layerType = AllLayers );
130 QList<QgsMapToolIdentify::IdentifyResult> identify(
const QgsGeometry &geometry,
IdentifyMode mode, LayerType layerType );
132 QList<QgsMapToolIdentify::IdentifyResult> identify(
const QgsGeometry &geometry,
IdentifyMode mode,
const QList<QgsMapLayer *> &layerList, LayerType layerType );
145 void identifyProgress(
int,
int );
146 void identifyMessage(
const QString & );
147 void changedRasterResults( QList<QgsMapToolIdentify::IdentifyResult> & );
162 QList<QgsMapToolIdentify::IdentifyResult> identify(
int x,
int y,
IdentifyMode mode,
const QList<QgsMapLayer *> &layerList, LayerType layerType = AllLayers );
167 bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMapLayer *layer,
const QgsPointXY &point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
169 bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsRasterLayer *layer,
QgsPointXY point,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel );
170 bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsVectorLayer *layer,
const QgsPointXY &point );
178 bool identifyMeshLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMeshLayer *layer,
const QgsPointXY &point );
181 QMap< QString, QString > derivedAttributesForPoint(
const QgsPoint &point );
195 void setCanvasPropertiesOverrides(
double searchRadiusMapUnits );
202 void restoreCanvasPropertiesOverrides();
206 bool identifyLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMapLayer *layer,
const QgsGeometry &geometry,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel, QgsMapToolIdentify::LayerType layerType = AllLayers );
207 bool identifyRasterLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsRasterLayer *layer,
const QgsGeometry &geometry,
const QgsRectangle &viewExtent,
double mapUnitsPerPixel );
208 bool identifyVectorLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsVectorLayer *layer,
const QgsGeometry &geometry );
209 bool identifyMeshLayer( QList<QgsMapToolIdentify::IdentifyResult> *results,
QgsMeshLayer *layer,
const QgsGeometry &geometry );
230 QString formatDistance(
double distance )
const;
237 QString formatArea(
double area )
const;
261 void closestPointAttributes(
const QgsAbstractGeometry &geometry,
const QgsPointXY &layerPoint, QMap< QString, QString > &derivedAttributes );
263 QString formatCoordinate(
const QgsPointXY &canvasPoint )
const;
264 QString formatXCoordinate(
const QgsPointXY &canvasPoint )
const;
265 QString formatYCoordinate(
const QgsPointXY &canvasPoint )
const;
270 double mLastMapUnitsPerPixel;
274 int mCoordinatePrecision;
276 double mOverrideCanvasSearchRadius = -1;
279 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.
A general purpose distance and area calculator, capable of performing ellipsoid based calculations...
Represents a mesh layer supporting display of data on structured or unstructured meshes.
Represents a vector layer which manages a vector based data sets.