16#ifndef QGSVECTORTILEUTILS_H
17#define QGSVECTORTILEUTILS_H
78 static double scaleToZoom(
double mapScale,
double z0Scale = 559082264.0287178 );
86 static int scaleToZoomLevel(
double mapScale,
int sourceMinZoom,
int sourceMaxZoom,
double z0Scale = 559082264.0287178 );
104 static QMap<QString, QString> parseStyleSourceUrl(
const QString &styleUrl,
const QgsHttpHeaders &headers =
QgsHttpHeaders(),
const QString &authCfg = QString() );
107 static QVariantList parseStyleSourceContentUrl(
const QString &sourceUrl,
const QgsHttpHeaders &headers =
QgsHttpHeaders(),
const QString &authCfg = QString() );
Container of fields for a vector layer.
Context for a MapBox GL style conversion operation.
Perform transforms between map coordinates and device coordinates.
A rectangle specified with double values.
Defines a matrix of tiles for a single zoom level: it is defined by its size (width *.
A range of tiles in a tile matrix.
Stores coordinates of a tile in a tile matrix set.
Represents a vector layer which manages a vector based dataset.
Implements a map layer that is dedicated to rendering of vector tiles.
Utility functions for working with vector tiles.
static QgsVectorLayer * makeVectorLayerForTile(QgsVectorTileLayer *mvt, QgsTileXYZ tileID, const QString &layerName)
Returns a temporary vector layer for given sub-layer of tile in vector tile layer.
static bool checkXYZUrlTemplate(const QString &url)
Checks whether the URL template string is correct (contains {x}, {y} / {-y}, {z} placeholders).
static QString formatXYZUrlTemplate(const QString &url, QgsTileXYZ tile, const QgsTileMatrix &tileMatrix)
Returns formatted tile URL string replacing {x}, {y}, {z} placeholders (or {-y} instead of {y}...
static void sortTilesByDistanceFromCenter(QVector< QgsTileXYZ > &tiles, QPointF center)
Orders tile requests according to the distance from view center (given in tile matrix coords).
friend class TestQgsVectorTileUtils
static QPolygon tilePolygon(QgsTileXYZ id, const QgsCoordinateTransform &ct, const QgsTileMatrix &tm, const QgsMapToPixel &mtp)
Returns polygon (made by four corners of the tile) in screen coordinates.
static double scaleToZoom(double mapScale, double z0Scale=559082264.0287178)
Finds zoom level given map scale denominator.
static int scaleToZoomLevel(double mapScale, int sourceMinZoom, int sourceMaxZoom, double z0Scale=559082264.0287178)
Finds the best fitting zoom level given a map scale denominator and allowed zoom level range.
static void updateUriSources(QString &uri SIP_INOUT, bool forceUpdate=false)
Parses the style URL to update the source URLs in the uri.
static QgsFields makeQgisFields(const QSet< QString > &flds)
Returns QgsFields instance based on the set of field names.
static void loadSprites(const QVariantMap &styleDefinition, QgsMapBoxGlStyleConversionContext &context, const QString &styleUrl=QString())
Downloads the sprite image and sets it to the conversion context.