QGIS API Documentation
3.20.0-Odense (decaadbb31)
|
Represents a matching result from a geocoder search. More...
#include <qgsgeocoderresult.h>
Public Member Functions | |
QgsGeocoderResult (const QString &identifier, const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &crs) | |
Constructor for a valid QgsGeocoderResult, with the specified geometry and crs. More... | |
QVariantMap | additionalAttributes () const |
Contains additional attributes generated during the geocode, which may be added to features being geocoded. More... | |
QgsCoordinateReferenceSystem | crs () const |
Returns the coordinate reference system for the calculated geometry(). More... | |
QString | description () const |
Returns the optional description for the result. More... | |
QString | error () const |
Returns the error string, if the result is invalid. More... | |
QgsGeometry | geometry () const |
Returns the resultant geometry resulting from the geocoding operation. More... | |
QString | group () const |
Returns the optional group value for the result. More... | |
QString | identifier () const |
Returns the identifier string for the result. More... | |
bool | isValid () const |
Returns true if the result is a valid result. More... | |
void | setAdditionalAttributes (const QVariantMap &attributes) |
Setss additional attributes generated during the geocode, which may be added to features being geocoded. More... | |
void | setCrs (const QgsCoordinateReferenceSystem &crs) |
Sets the coordinate reference system for the calculated geometry(). More... | |
void | setDescription (const QString &description) |
Sets an optional description for the result. More... | |
void | setGeometry (const QgsGeometry &geometry) |
Sets the resultant geometry resulting from the geocoding operation. More... | |
void | setGroup (const QString &group) |
Sets the optional group value for the result. More... | |
void | setViewport (const QgsRectangle &viewport) |
Sets the suggested viewport for the result, which reflects a recommended map extent for displaying the result. More... | |
QgsRectangle | viewport () const |
Returns the suggested viewport for the result, which reflects a recommended map extent for displaying the result. More... | |
Static Public Member Functions | |
static QgsGeocoderResult | errorResult (const QString &errorMessage) |
Creates an invalid error result, with the specified errorMessage string. More... | |
Represents a matching result from a geocoder search.
QgsGeocoderResult objects may represent valid matches, or an invalid error result. This can be checked by testing isValid(). An invalid result represents that an error was encountered while geocoding, in which case the error message can be retrieved by calling error().
Valid geocoding results will have a geometry() and crs(), along with a set of optional additionalAttributes() which may contain information such as the accuracy of the geocoding result.
Definition at line 40 of file qgsgeocoderresult.h.
QgsGeocoderResult::QgsGeocoderResult | ( | const QString & | identifier, |
const QgsGeometry & | geometry, | ||
const QgsCoordinateReferenceSystem & | crs | ||
) |
Constructor for a valid QgsGeocoderResult, with the specified geometry and crs.
Definition at line 26 of file qgsgeocoderresult.cpp.
|
inline |
Contains additional attributes generated during the geocode, which may be added to features being geocoded.
Definition at line 142 of file qgsgeocoderresult.h.
|
inline |
Returns the coordinate reference system for the calculated geometry().
Definition at line 100 of file qgsgeocoderresult.h.
QString QgsGeocoderResult::description | ( | ) | const |
Returns the optional description for the result.
Definition at line 43 of file qgsgeocoderresult.cpp.
|
inline |
Returns the error string, if the result is invalid.
Definition at line 65 of file qgsgeocoderresult.h.
|
static |
Creates an invalid error result, with the specified errorMessage string.
Definition at line 18 of file qgsgeocoderresult.cpp.
|
inline |
Returns the resultant geometry resulting from the geocoding operation.
The coordinate reference system for the geometry can be retrieved via crs().
Definition at line 81 of file qgsgeocoderresult.h.
QString QgsGeocoderResult::group | ( | ) | const |
Returns the optional group value for the result.
The group can be used to categorize results into different groups, e.g. by appropriate administrative region.
Definition at line 33 of file qgsgeocoderresult.cpp.
|
inline |
Returns the identifier string for the result.
Definition at line 70 of file qgsgeocoderresult.h.
|
inline |
Returns true
if the result is a valid result.
If the result is invalid, the error message can be retrieved by calling error().
Definition at line 60 of file qgsgeocoderresult.h.
|
inline |
Setss additional attributes generated during the geocode, which may be added to features being geocoded.
Definition at line 150 of file qgsgeocoderresult.h.
|
inline |
Sets the coordinate reference system for the calculated geometry().
Definition at line 108 of file qgsgeocoderresult.h.
void QgsGeocoderResult::setDescription | ( | const QString & | description | ) |
Sets an optional description for the result.
Definition at line 48 of file qgsgeocoderresult.cpp.
|
inline |
Sets the resultant geometry resulting from the geocoding operation.
The coordinate reference system for the geometry should also be set via setCrs().
Definition at line 92 of file qgsgeocoderresult.h.
void QgsGeocoderResult::setGroup | ( | const QString & | group | ) |
Sets the optional group value for the result.
The group can be used to categorize results into different groups, e.g. by appropriate administrative region.
Definition at line 38 of file qgsgeocoderresult.cpp.
|
inline |
Sets the suggested viewport for the result, which reflects a recommended map extent for displaying the result.
This is an optional property, and can be set to a null rectangle if a recommended viewport is not available (or not appropriate).
The viewport CRS must match the CRS of geometry()d.
Definition at line 134 of file qgsgeocoderresult.h.
|
inline |
Returns the suggested viewport for the result, which reflects a recommended map extent for displaying the result.
This is an optional property, and will return a null rectangle if a recommended viewport is not available (or not appropriate).
The viewport CRS will match the CRS of geometry(), and can be retrieved via the crs() method.
Definition at line 121 of file qgsgeocoderresult.h.