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 ), tileX2lon( last.x + 1, last.z ), tileY2lat( first.y, first.z ) );
78 QMap<QPair<int, int>, Tile> tiles;
82QList<MetaTile> getMetatiles(
const QgsRectangle extent,
const int zoom,
const int tileSize = 4 );
91 QString
group()
const override;
92 QString
groupId()
const override;
99 void createCommonParameters();
109 QColor mBackgroundColor;
113 bool mAntialias =
true;
114 int mJpgQuality = 75;
115 int mMetaTileSize = 4;
116 int mThreadsNumber = 1;
117 int mTileWidth = 256;
118 int mTileHeight = 256;
120 QList<QgsMapLayer *> mLayers;
127 long long mTotalTiles = 0;
128 long long mProcessedTiles = 0;
130 QPointer<QEventLoop> mEventLoop;
131 QList<MetaTile> mMetaTiles;
132 QMap<QgsMapRendererSequentialJob *, MetaTile> mRendererJobs;
139class QgsXyzTilesDirectoryAlgorithm :
public QgsXyzTilesBaseAlgorithm
142 QgsXyzTilesDirectoryAlgorithm() =
default;
143 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
override;
144 QString name()
const override;
145 QString displayName()
const override;
146 QStringList tags()
const override;
147 QString shortHelpString()
const override;
148 QgsXyzTilesDirectoryAlgorithm *createInstance() const override
SIP_FACTORY;
163class QgsXyzTilesMbtilesAlgorithm : public QgsXyzTilesBaseAlgorithm
166 QgsXyzTilesMbtilesAlgorithm() =
default;
167 void initAlgorithm(
const QVariantMap &configuration = QVariantMap() )
override;
168 QString name()
const override;
169 QString displayName()
const override;
170 QStringList tags()
const override;
171 QString shortHelpString()
const override;
172 QgsXyzTilesMbtilesAlgorithm *createInstance() const override
SIP_FACTORY;
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.