1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106
|
/************************************************************************
* This file has been generated automatically from *
* *
* src/analysis/processing/qgsalgorithmbatchgeocode.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
class QgsBatchGeocodeAlgorithm : QgsProcessingFeatureBasedAlgorithm
{
%Docstring(signature="appended")
A base class for batch geocoder algorithms, which takes a
:py:class:`QgsGeocoderInterface` object and exposes it as a Processing
algorithm for batch geocoding operations.
Example
-------------------------------------
.. code-block:: python
# create a class which implements the QgsGeocoderInterface interface:
class MyGeocoder(QgsGeocoderInterface):
def geocodeString(self, string, context, feedback):
# calculate and return results...
my_geocoder = MyGeocoder()
# create an algorithm which allows for batch geocoding operations using the custom geocoder interface
# and implement the few required pure virtual methods
class MyGeocoderAlgorithm(QgsBatchGeocodeAlgorithm):
def __init__(self):
super().__init__(my_geocoder)
def displayName(self):
return "My Geocoder"
def name(self):
return "my_geocoder_alg"
def createInstance(self):
return MyGeocoderAlgorithm()
# optionally, the group(), groupId(), tags(), shortHelpString() and other metadata style methods can be overridden and customized:
def tags(self):
return 'geocode,my service,batch'
.. versionadded:: 3.18
%End
%TypeHeaderCode
#include "qgsalgorithmbatchgeocode.h"
%End
public:
QgsBatchGeocodeAlgorithm( QgsGeocoderInterface *geocoder );
%Docstring
Constructor for QgsBatchGeocodeAlgorithm.
The ``geocoder`` must specify an instance of a class which implements
the :py:class:`QgsGeocoderInterface` interface. Ownership of
``geocoder`` is not transferred, and the caller must ensure that
``geocoder`` exists for the lifetime of this algorithm.
%End
virtual void initParameters( const QVariantMap &configuration = QVariantMap() );
virtual QStringList tags() const;
virtual QString group() const;
virtual QString groupId() const;
virtual QList<int> inputLayerTypes() const;
virtual bool supportInPlaceEdit( const QgsMapLayer *layer ) const;
protected:
virtual QString outputName() const;
virtual bool prepareAlgorithm( const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback );
virtual QgsFeatureList processFeature( const QgsFeature &feature, QgsProcessingContext &, QgsProcessingFeedback *feedback );
virtual QgsCoordinateReferenceSystem outputCrs( const QgsCoordinateReferenceSystem &inputCrs ) const;
virtual QgsFields outputFields( const QgsFields &inputFields ) const;
virtual Qgis::WkbType outputWkbType( Qgis::WkbType inputWkbType ) const;
};
/************************************************************************
* This file has been generated automatically from *
* *
* src/analysis/processing/qgsalgorithmbatchgeocode.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.py again *
************************************************************************/
|