QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgsalgorithmwritevectortiles.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsalgorithmwritevectortiles.h
3  ---------------------
4  Date : April 2020
5  Copyright : (C) 2020 by Martin Dobias
6  Email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSWRITEVECTORTILESALGORITHM_H
17 #define QGSWRITEVECTORTILESALGORITHM_H
18 
19 
20 #define SIP_NO_FILE
21 
22 #include "qgsprocessingalgorithm.h"
23 
25 
27 
28 
29 class QgsWriteVectorTilesBaseAlgorithm : public QgsProcessingAlgorithm
30 {
31  public:
32 
33  QString group() const override;
34  QString groupId() const override;
35  QString shortHelpString() const override;
36 
37  protected:
38  QVariantMap processAlgorithm( const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback ) override;
39 
40  void addBaseParameters();
41 
42  virtual void prepareWriter( QgsVectorTileWriter &writer, const QVariantMap &parameters, QgsProcessingContext &context, QVariantMap &outputs ) = 0;
43 
44 };
45 
46 
47 class QgsWriteVectorTilesXyzAlgorithm : public QgsWriteVectorTilesBaseAlgorithm
48 {
49  public:
50 
51  QString name() const override;
52  QString displayName() const override;
53 
54  protected:
55  QgsProcessingAlgorithm *createInstance() const override;
56  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
57 
58  void prepareWriter( QgsVectorTileWriter &writer, const QVariantMap &parameters, QgsProcessingContext &context, QVariantMap &outputs ) override;
59 };
60 
61 
62 class QgsWriteVectorTilesMbtilesAlgorithm : public QgsWriteVectorTilesBaseAlgorithm
63 {
64  public:
65 
66  QString name() const override;
67  QString displayName() const override;
68 
69  protected:
70  QgsProcessingAlgorithm *createInstance() const override;
71  void initAlgorithm( const QVariantMap &configuration = QVariantMap() ) override;
72 
73  void prepareWriter( QgsVectorTileWriter &writer, const QVariantMap &parameters, QgsProcessingContext &context, QVariantMap &outputs ) override;
74 };
75 
76 
78 
79 #endif // QGSWRITEVECTORTILESALGORITHM_H
QgsProcessingFeedback
Definition: qgsprocessingfeedback.h:37
QgsProcessingAlgorithm::groupId
virtual QString groupId() const
Returns the unique ID of the group this algorithm belongs to.
Definition: qgsprocessingalgorithm.h:231
QgsProcessingAlgorithm::processAlgorithm
virtual QVariantMap processAlgorithm(const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback) SIP_THROW(QgsProcessingException)=0
Runs the algorithm using the specified parameters.
QgsProcessingContext
Definition: qgsprocessingcontext.h:43
qgsprocessingalgorithm.h
QgsProcessingAlgorithm::shortHelpString
virtual QString shortHelpString() const
Returns a localised short helper string for the algorithm.
Definition: qgsprocessingalgorithm.cpp:63
QgsProcessingAlgorithm
Definition: qgsprocessingalgorithm.h:51
QgsVectorTileWriter
Definition: qgsvectortilewriter.h:72
QgsProcessingAlgorithm::group
virtual QString group() const
Returns the name of the group this algorithm belongs to.
Definition: qgsprocessingalgorithm.h:222