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();
111 QColor mBackgroundColor;
115 bool mAntialias =
true;
116 int mJpgQuality = 75;
117 int mMetaTileSize = 4;
118 int mThreadsNumber = 1;
119 int mTileWidth = 256;
120 int mTileHeight = 256;
122 QList< QgsMapLayer * > mLayers;
129 long long mTotalTiles = 0;
130 long long mProcessedTiles = 0;
132 QEventLoop *mEventLoop;
133 QList< MetaTile > mMetaTiles;
134 QMap< QgsMapRendererSequentialJob *, MetaTile > mRendererJobs;
141class QgsXyzTilesDirectoryAlgorithm :
public QgsXyzTilesBaseAlgorithm
146 QgsXyzTilesDirectoryAlgorithm() =
default;
147 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
override;
148 QString name()
const override;
149 QString displayName()
const override;
150 QStringList tags()
const override;
151 QString shortHelpString()
const override;
152 QgsXyzTilesDirectoryAlgorithm *createInstance() const override
SIP_FACTORY;
155 QVariantMap processAlgorithm( const QVariantMap ¶meters,
169class QgsXyzTilesMbtilesAlgorithm : public QgsXyzTilesBaseAlgorithm
174 QgsXyzTilesMbtilesAlgorithm() =
default;
175 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
override;
176 QString name()
const override;
177 QString displayName()
const override;
178 QStringList tags()
const override;
179 QString shortHelpString()
const override;
180 QgsXyzTilesMbtilesAlgorithm *createInstance() const override
SIP_FACTORY;
183 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.