18#ifndef QGSALGORITHMXYZTILES_H
19#define QGSALGORITHMXYZTILES_H
31int tile2tms(
const int y,
const int zoom );
32int lon2tileX(
const double lon,
const int z );
33int lat2tileY(
const double lat,
const int z );
34double tileX2lon(
const int x,
const int z );
35double tileY2lat(
const int y,
const int z );
36void extent2TileXY(
const QgsRectangle extent,
const int zoom,
int &xMin,
int &yMin,
int &xMax,
int &yMax );
40 Tile(
const int x,
const int y,
const int z )
58 void addTile(
const int row,
const int col, Tile tileToAdd )
60 tiles.insert( QPair<int, int>( row, col ), tileToAdd );
73 const Tile first = tiles.first();
74 const Tile last = tiles.last();
75 return QgsRectangle( tileX2lon( first.x, first.z ), tileY2lat( last.y + 1, last.z ),
76 tileX2lon( last.x + 1, last.z ), tileY2lat( first.y, first.z ) );
79 QMap< QPair<int, int>, Tile > tiles;
83QList< MetaTile > getMetatiles(
const QgsRectangle extent,
const int zoom,
const int tileSize = 4 );
94 QString
group()
const override;
95 QString
groupId()
const override;
103 void createCommonParameters();
113 QColor mBackgroundColor;
117 bool mAntialias =
true;
118 int mJpgQuality = 75;
119 int mMetaTileSize = 4;
120 int mThreadsNumber = 1;
121 int mTileWidth = 256;
122 int mTileHeight = 256;
124 QList< QgsMapLayer * > mLayers;
131 long long mTotalTiles = 0;
132 long long mProcessedTiles = 0;
134 QPointer<QEventLoop> mEventLoop;
135 QList< MetaTile > mMetaTiles;
136 QMap< QgsMapRendererSequentialJob *, MetaTile > mRendererJobs;
143class QgsXyzTilesDirectoryAlgorithm :
public QgsXyzTilesBaseAlgorithm
148 QgsXyzTilesDirectoryAlgorithm() =
default;
149 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
override;
150 QString name()
const override;
151 QString displayName()
const override;
152 QStringList tags()
const override;
153 QString shortHelpString()
const override;
154 QgsXyzTilesDirectoryAlgorithm *createInstance() const override
SIP_FACTORY;
157 QVariantMap processAlgorithm( const QVariantMap ¶meters,
171class QgsXyzTilesMbtilesAlgorithm : public QgsXyzTilesBaseAlgorithm
176 QgsXyzTilesMbtilesAlgorithm() =
default;
177 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
override;
178 QString name()
const override;
179 QString displayName()
const override;
180 QStringList tags()
const override;
181 QString shortHelpString()
const override;
182 QgsXyzTilesMbtilesAlgorithm *createInstance() const override
SIP_FACTORY;
185 QVariantMap processAlgorithm( const QVariantMap ¶meters,
QFlags< ProcessingAlgorithmFlag > ProcessingAlgorithmFlags
Flags indicating how and when an algorithm operates and should be exposed to users.
This class represents a coordinate reference system (CRS).
Contains information about the context in which a coordinate transform is executed.
Job implementation that renders everything sequentially in one thread.
Utility class for reading and writing MBTiles files (which are SQLite3 databases).
Abstract base class for processing algorithms.
virtual QString group() const
Returns the name of the group this algorithm belongs to.
virtual bool prepareAlgorithm(const QVariantMap ¶meters, QgsProcessingContext &context, QgsProcessingFeedback *feedback)
Prepares the algorithm to run using the specified parameters.
virtual QString groupId() const
Returns the unique ID of the group this algorithm belongs to.
virtual Qgis::ProcessingAlgorithmFlags flags() const
Returns the flags indicating how and when the algorithm operates and should be exposed to users.
Contains information about the context in which a processing algorithm is executed.
Base class for providing feedback from a processing algorithm.
A rectangle specified with double values.