Class: QgsGeocoderInterface¶
- class qgis.core.QgsGeocoderInterface¶
Bases:
sip.wrapper
Interface for geocoders.
QgsGeocoderInterface
implementations are able to take either aQgsFeature
or a free-form string and calculate the corresponding geometry of the feature.Added in version 3.18:
Enums
Bases:
enum.IntEnum
Methods
Returns a set of newly created fields which will be appended to existing features during the geocode operation.
Returns the geocoder's capability flags.
Geocodes a
feature
.Geocodes a
string
.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 valuesGeocodesFeatures
: Can geocodeQgsFeature
input values
- GeocodesFeatures = 2¶
- GeocodesStrings = 1¶
- class Flags¶
- class Flags(Union[QgsGeocoderInterface.Flags, QgsGeocoderInterface.Flag])
- class Flags(QgsGeocoderInterface.Flags)
Bases:
sip.wrapper
- 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:
- flags(self) QgsGeocoderInterface.Flags ¶
Returns the geocoder’s capability flags.
- Return type:
- 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:
feature (QgsFeature)
context (QgsGeocoderContext)
feedback (
QgsFeedback
= None)
- 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:
string (str)
context (QgsGeocoderContext)
feedback (
QgsFeedback
= None)
- Return type:
List[QgsGeocoderResult]
- wkbType(self) Qgis.WkbType ¶
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: