QGIS/python/core/auto_generated/geocoding/qgsgeocoderresult.sip.in
2024-08-13 20:28:55 +10:00

187 lines
5.6 KiB
Plaintext

/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geocoding/qgsgeocoderresult.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsGeocoderResult
{
%Docstring(signature="appended")
Represents a matching result from a geocoder search.
:py:class:`QgsGeocoderResult` objects may represent valid matches, or an invalid
error result. This can be checked by testing :py:func:`~isValid`. An invalid
result represents that an error was encountered while geocoding, in which case the
error message can be retrieved by calling :py:func:`~error`.
Valid geocoding results will have a :py:func:`~geometry` and :py:func:`~crs`, along with a set
of optional :py:func:`~additionalAttributes` which may contain information such as the
accuracy of the geocoding result.
.. versionadded:: 3.18
%End
%TypeHeaderCode
#include "qgsgeocoderresult.h"
%End
public:
static QgsGeocoderResult errorResult( const QString &errorMessage );
%Docstring
Creates an invalid error result, with the specified ``errorMessage`` string.
%End
QgsGeocoderResult( const QString &identifier, const QgsGeometry &geometry, const QgsCoordinateReferenceSystem &crs );
%Docstring
Constructor for a valid QgsGeocoderResult, with the specified ``geometry`` and ``crs``.
%End
bool isValid() const;
%Docstring
Returns ``True`` if the result is a valid result.
If the result is invalid, the error message can be retrieved by calling :py:func:`~QgsGeocoderResult.error`.
%End
QString error() const;
%Docstring
Returns the error string, if the result is invalid.
%End
QString identifier() const;
%Docstring
Returns the identifier string for the result.
%End
QgsGeometry geometry() const;
%Docstring
Returns the resultant geometry resulting from the geocoding operation.
The coordinate reference system for the geometry can be retrieved
via :py:func:`~QgsGeocoderResult.crs`.
.. seealso:: :py:func:`setGeometry`
.. seealso:: :py:func:`crs`
%End
void setGeometry( const QgsGeometry &geometry );
%Docstring
Sets the resultant ``geometry`` resulting from the geocoding operation.
The coordinate reference system for the geometry should also be set
via :py:func:`~QgsGeocoderResult.setCrs`.
.. seealso:: :py:func:`geometry`
.. seealso:: :py:func:`setCrs`
%End
QgsCoordinateReferenceSystem crs() const;
%Docstring
Returns the coordinate reference system for the calculated :py:func:`~QgsGeocoderResult.geometry`.
.. seealso:: :py:func:`setCrs`
.. seealso:: :py:func:`geometry`
%End
void setCrs( const QgsCoordinateReferenceSystem &crs );
%Docstring
Sets the coordinate reference system for the calculated :py:func:`~QgsGeocoderResult.geometry`.
.. seealso:: :py:func:`crs`
.. seealso:: :py:func:`geometry`
%End
QgsRectangle viewport() const;
%Docstring
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 :py:func:`~QgsGeocoderResult.geometry`, and can be retrieved via the :py:func:`~QgsGeocoderResult.crs` method.
.. seealso:: :py:func:`setViewport`
%End
void setViewport( const QgsRectangle &viewport );
%Docstring
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.
.. seealso:: :py:func:`viewport`
%End
QVariantMap additionalAttributes() const;
%Docstring
Contains additional attributes generated during the geocode,
which may be added to features being geocoded.
.. seealso:: :py:func:`setAdditionalAttributes`
%End
void setAdditionalAttributes( const QVariantMap &attributes );
%Docstring
Setss additional attributes generated during the geocode,
which may be added to features being geocoded.
.. seealso:: :py:func:`additionalAttributes`
%End
QString group() const;
%Docstring
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.
.. seealso:: :py:func:`setGroup`
%End
void setGroup( const QString &group );
%Docstring
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.
.. seealso:: :py:func:`group`
%End
QString description() const;
%Docstring
Returns the optional description for the result.
.. seealso:: :py:func:`setDescription`
%End
void setDescription( const QString &description );
%Docstring
Sets an optional ``description`` for the result.
.. seealso:: :py:func:`description`
%End
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/geocoding/qgsgeocoderresult.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/