Class: QgsGeocoderInterface

class qgis.core.QgsGeocoderInterface

Bases: sip.wrapper

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.

New in version 3.18: Enums

Flag

Bases: enum.IntEnum

Methods

appendedFields

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

flags

Returns the geocoder’s capability flags.

geocodeFeature

Geocodes a feature.

geocodeString

Geocodes a string.

wkbType

Returns the WKB type of geometries returned by the geocoder.

class Flag(value)

Bases: enum.IntEnum

Capability flags for the geocoder.

  • GeocodesStrings: Can geocode string input values

  • GeocodesFeatures: Can geocode QgsFeature input values

GeocodesFeatures = 2
GeocodesStrings = 1
class Flags

Bases: sip.wrapper

QgsGeocoderInterface.Flags(Union[QgsGeocoderInterface.Flags, QgsGeocoderInterface.Flag]) QgsGeocoderInterface.Flags(QgsGeocoderInterface.Flags)

appendedFields(self)QgsFields

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.

Return type

QgsFields

flags(self)QgsGeocoderInterface.Flags

Returns the geocoder’s capability flags.

Return type

QgsGeocoderInterface.Flags

geocodeFeature(self, feature: QgsFeature, context: QgsGeocoderContext, feedback: QgsFeedback = None) → List[QgsGeocoderResult]

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.

Parameters
Return type

List[QgsGeocoderResult]

geocodeString(self, string: str, context: QgsGeocoderContext, feedback: QgsFeedback = None) → List[QgsGeocoderResult]

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.

Parameters
Return type

List[QgsGeocoderResult]

wkbType(self)QgsWkbTypes.Type

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).

Return type

QgsWkbTypes.Type