Class: QgsAbstractGeocoderLocatorFilter¶
An abstract base class which implements a locator filter populated from
a QgsGeocoderInterface.
This base class implements the required logic to bridge a class which
implements the QgsGeocoderInterface interface to a
QgsLocatorFilter. It allows easy creation of a locator
filter from a geocoder.
Note
This is a low-level API, designed for use by client applications which do not
utilize the QGIS gui library. Usually the concrete class QgsGeocoderLocatorFilter from
the gui library should be used instead.
Added in version 3.18.
Class Hierarchy¶
Base classes¶
Abstract base class for filters which collect locator results.  | 
|
Subclasses¶
An adapter class which implements a locator filter populated from a   | 
Methods
Returns the WGS84 bounding box attached to the filter.  | 
|
Returns the geocoder attached to the filter.  | 
|
Converts a geocoder result to a locator result.  | 
|
Converts a locator result to a geocoder result.  | 
- class qgis.core.QgsAbstractGeocoderLocatorFilter[source]¶
 Bases:
QgsLocatorFilter- __init__(name: str | None, displayName: str | None, prefix: str | None, geocoder: QgsGeocoderInterface | None, boundingBox: QgsRectangle = QgsRectangle())
 Constructor for QgsAbstractGeocoderLocatorFilter.
The
nameargument specifies a unique name for the filter. This should be an untranslated string identifying the filter.The
displayNameargument must specify a translated, user-friendly name for the filter.The
prefixargument specifies the prefix character(s) for this filter. Prefixing a search with these characters will restrict the locator search to only include results from this filter. Theprefixmust consist of at least three characters.The
geocodermust specify an instance of a class which implements theQgsGeocoderInterfaceinterface. Ownership ofgeocoderis not transferred, and the caller must ensure thatgeocoderexists for the lifetime of this filter.The
boundingBoxargument specifies the geographic bounding box, in WGS84, covered by the filter.- Parameters:
 name (Optional[str])
displayName (Optional[str])
prefix (Optional[str])
geocoder (Optional[QgsGeocoderInterface])
boundingBox (
QgsRectangle= QgsRectangle())
- boundingBox(self) QgsRectangle[source]¶
 Returns the WGS84 bounding box attached to the filter.
- Return type:
 
- geocoder(self) QgsGeocoderInterface | None[source]¶
 Returns the geocoder attached to the filter.
- Return type:
 Optional[QgsGeocoderInterface]
- geocoderResultToLocatorResult(self, result: QgsGeocoderResult) QgsLocatorResult[source]¶
 Converts a geocoder
resultto a locator result.See also
- Parameters:
 result (QgsGeocoderResult)
- Return type:
 
- locatorResultToGeocoderResult(self, result: QgsLocatorResult) QgsGeocoderResult[source]¶
 Converts a locator
resultto a geocoder result.See also
- Parameters:
 result (QgsLocatorResult)
- Return type: