Class: QgsGeocoderContext

Encapsulates the context of a geocoding operation.

Added in version 3.18.

class qgis.core.QgsGeocoderContext[source]

Bases: object

__init__(transformContext: QgsCoordinateTransformContext)

Constructor for QgsGeocoderContext, with the specified transformContext.

Parameters:

transformContext (QgsCoordinateTransformContext)

__init__(a0: QgsGeocoderContext)
Parameters:

a0 (QgsGeocoderContext)

areaOfInterest(self) QgsGeometry[source]

Returns the optional area of interest, which can be used to indicate the desired geographic area where geocoding results are desired.

The area of interest can be a polygon geometry, in which case it represents the extent to use for filtering candidate results, or a point geometry, in which case it represents a “target point” for prioritizing closer results.

The coordinate reference system for the area of interest can be retrieved via areaOfInterestCrs().

Return type:

QgsGeometry

areaOfInterestCrs(self) QgsCoordinateReferenceSystem[source]

Returns the coordinate reference system for the area of interest, which can be used to indicate the desired geographic area where geocoding results are desired.

See also

areaOfInterest()

Return type:

QgsCoordinateReferenceSystem

setAreaOfInterest(self, area: QgsGeometry)[source]

Sets the optional area of interest, which can be used to indicate the desired geographic area where geocoding results are desired.

The area of interest can be a polygon geometry, in which case it represents the extent to use for filtering candidate results, or a point geometry, in which case it represents a “target point” for prioritizing closer results.

The coordinate reference system for the area of interest can be set via setAreaOfInterestCrs().

See also

areaOfInterest()

Parameters:

area (QgsGeometry)

setAreaOfInterestCrs(self, crs: QgsCoordinateReferenceSystem)[source]

Sets the crs for the area of interest, which can be used to indicate the desired geographic area where geocoding results are desired.

Parameters:

crs (QgsCoordinateReferenceSystem)

setTransformContext(self, context: QgsCoordinateTransformContext)[source]

Sets the coordinate transform context, which should be used whenever the geocoder constructs a coordinate transform.

Parameters:

context (QgsCoordinateTransformContext)

transformContext(self) QgsCoordinateTransformContext[source]

Returns the coordinate transform context, which should be used whenever the geocoder constructs a coordinate transform.

Return type:

QgsCoordinateTransformContext