QGIS API Documentation 3.28.0-Firenze (ed3ad0430f)
Public Types | Public Member Functions | List of all members
QgsGeocoderInterface Class Referenceabstract

Interface for geocoders. More...

#include <qgsgeocoder.h>

Inheritance diagram for QgsGeocoderInterface:
Inheritance graph
[legend]

Public Types

enum class  Flag { GeocodesStrings = 1 << 0 , GeocodesFeatures = 1 << 1 }
 Capability flags for the geocoder. More...
 

Public Member Functions

virtual ~QgsGeocoderInterface ()=default
 
virtual QgsFields appendedFields () const
 Returns a set of newly created fields which will be appended to existing features during the geocode operation. More...
 
virtual Flags flags () const =0
 Returns the geocoder's capability flags. More...
 
virtual QList< QgsGeocoderResultgeocodeFeature (const QgsFeature &feature, const QgsGeocoderContext &context, QgsFeedback *feedback=nullptr) const
 Geocodes a feature. More...
 
virtual QList< QgsGeocoderResultgeocodeString (const QString &string, const QgsGeocoderContext &context, QgsFeedback *feedback=nullptr) const
 Geocodes a string. More...
 
virtual QgsWkbTypes::Type wkbType () const
 Returns the WKB type of geometries returned by the geocoder. More...
 

Detailed Description

Interface for geocoders.

QgsGeocoderInterface implementations are able to take either a QgsFeature or a free-form string and calculate the corresponding geometry of the feature.

Since
QGIS 3.18

Definition at line 36 of file qgsgeocoder.h.

Member Enumeration Documentation

◆ Flag

enum class QgsGeocoderInterface::Flag
strong

Capability flags for the geocoder.

Enumerator
GeocodesStrings 

Can geocode string input values.

GeocodesFeatures 

Can geocode QgsFeature input values.

Definition at line 42 of file qgsgeocoder.h.

Constructor & Destructor Documentation

◆ ~QgsGeocoderInterface()

virtual QgsGeocoderInterface::~QgsGeocoderInterface ( )
virtualdefault

Member Function Documentation

◆ appendedFields()

QgsFields QgsGeocoderInterface::appendedFields ( ) const
virtual

Returns a set of newly created fields which will be appended to existing features during the geocode operation.

These fields will include any extra content returned by the geocoder, such as fields for accuracy of the match or correct attribute values.

Reimplemented in QgsGoogleMapsGeocoder, and QgsNominatimGeocoder.

Definition at line 25 of file qgsgeocoder.cpp.

◆ flags()

virtual Flags QgsGeocoderInterface::flags ( ) const
pure virtual

Returns the geocoder's capability flags.

Implemented in QgsGoogleMapsGeocoder, and QgsNominatimGeocoder.

◆ geocodeFeature()

QList< QgsGeocoderResult > QgsGeocoderInterface::geocodeFeature ( const QgsFeature feature,
const QgsGeocoderContext context,
QgsFeedback feedback = nullptr 
) const
virtual

Geocodes a feature.

If implemented by the geocoder (i.e. flags() returns the QgsGeocoderInterface::Flag::GeocodesFeatures flag), a list of matching results will be returned.

The optional feedback argument can be used to provider cancellation support.

Definition at line 18 of file qgsgeocoder.cpp.

◆ geocodeString()

QList< QgsGeocoderResult > QgsGeocoderInterface::geocodeString ( const QString &  string,
const QgsGeocoderContext context,
QgsFeedback feedback = nullptr 
) const
virtual

Geocodes a string.

If implemented by the geocoder (i.e. flags() returns the QgsGeocoderInterface::Flag::GeocodesStrings flag), a list of matching results will be returned.

The optional feedback argument can be used to provider cancellation support.

Reimplemented in QgsGoogleMapsGeocoder, and QgsNominatimGeocoder.

Definition at line 29 of file qgsgeocoder.cpp.

◆ wkbType()

QgsWkbTypes::Type QgsGeocoderInterface::wkbType ( ) const
virtual

Returns the WKB type of geometries returned by the geocoder.

If this is not known in advance then QgsWkbTypes::Unknown should be returned (e.g. in the case that a geocoder may return different geometry types depending on the quality of the match).

Reimplemented in QgsGoogleMapsGeocoder, and QgsNominatimGeocoder.

Definition at line 27 of file qgsgeocoder.cpp.


The documentation for this class was generated from the following files: