QGIS API Documentation  3.17.0-Master (ca637cfeb2)
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
Base class for providing feedback from a processing algorithm.
virtual QString group() const
Returns the name of the group this algorithm belongs to.
virtual QString shortHelpString() const
Returns a localised short helper string for the algorithm.
Abstract base class for processing algorithms.
virtual QVariantMap processAlgorithm(const QVariantMap &parameters, QgsProcessingContext &context, QgsProcessingFeedback *feedback) SIP_THROW(QgsProcessingException)=0
Runs the algorithm using the specified parameters.
virtual QString groupId() const
Returns the unique ID of the group this algorithm belongs to.
Takes care of writing vector tiles.
Contains information about the context in which a processing algorithm is executed.