QGIS API Documentation  3.16.0-Hannover (43b64b13f3)
Static Public Member Functions | List of all members
QgsVectorTileUtils Class Reference

Random utility functions for working with vector tiles. More...

#include <qgsvectortileutils.h>

Static Public Member Functions

static bool checkXYZUrlTemplate (const QString &url)
 Checks whether the URL template string is correct (contains {x}, {y} / {-y}, {z} placeholders) More...
 
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} for TMS convention) More...
 
static QgsFields makeQgisFields (QSet< QString > flds)
 Returns QgsFields instance based on the set of field names. More...
 
static QgsVectorLayermakeVectorLayerForTile (QgsVectorTileLayer *mvt, QgsTileXYZ tileID, const QString &layerName)
 Returns a temporary vector layer for given sub-layer of tile in vector tile layer. More...
 
static double scaleToZoom (double mapScale)
 Finds zoom level (assuming GoogleCRS84Quad tile matrix set) given map scale denominator. More...
 
static int scaleToZoomLevel (double mapScale, int sourceMinZoom, int sourceMaxZoom)
 Finds best fitting zoom level (assuming GoogleCRS84Quad tile matrix set) given map scale denominator and allowed zoom level range. More...
 
static void sortTilesByDistanceFromCenter (QVector< QgsTileXYZ > &tiles, const QPointF &center)
 Orders tile requests according to the distance from view center (given in tile matrix coords) More...
 
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. More...
 
static QVector< QgsTileXYZtilesInRange (const QgsTileRange &range, int zoomLevel)
 Returns a list of tiles in the given tile range. More...
 

Detailed Description

Random utility functions for working with vector tiles.

Since
QGIS 3.14

Definition at line 45 of file qgsvectortileutils.h.

Member Function Documentation

◆ checkXYZUrlTemplate()

bool QgsVectorTileUtils::checkXYZUrlTemplate ( const QString &  url)
static

Checks whether the URL template string is correct (contains {x}, {y} / {-y}, {z} placeholders)

Definition at line 141 of file qgsvectortileutils.cpp.

◆ formatXYZUrlTemplate()

QString QgsVectorTileUtils::formatXYZUrlTemplate ( const QString &  url,
QgsTileXYZ  tile,
const QgsTileMatrix tileMatrix 
)
static

Returns formatted tile URL string replacing {x}, {y}, {z} placeholders (or {-y} instead of {y} for TMS convention)

Definition at line 124 of file qgsvectortileutils.cpp.

◆ makeQgisFields()

QgsFields QgsVectorTileUtils::makeQgisFields ( QSet< QString >  flds)
static

Returns QgsFields instance based on the set of field names.

Definition at line 51 of file qgsvectortileutils.cpp.

◆ makeVectorLayerForTile()

QgsVectorLayer * QgsVectorTileUtils::makeVectorLayerForTile ( QgsVectorTileLayer mvt,
QgsTileXYZ  tileID,
const QString &  layerName 
)
static

Returns a temporary vector layer for given sub-layer of tile in vector tile layer.

Definition at line 83 of file qgsvectortileutils.cpp.

◆ scaleToZoom()

double QgsVectorTileUtils::scaleToZoom ( double  mapScale)
static

Finds zoom level (assuming GoogleCRS84Quad tile matrix set) given map scale denominator.

Since
QGIS 3.16

Definition at line 63 of file qgsvectortileutils.cpp.

◆ scaleToZoomLevel()

int QgsVectorTileUtils::scaleToZoomLevel ( double  mapScale,
int  sourceMinZoom,
int  sourceMaxZoom 
)
static

Finds best fitting zoom level (assuming GoogleCRS84Quad tile matrix set) given map scale denominator and allowed zoom level range.

Definition at line 71 of file qgsvectortileutils.cpp.

◆ sortTilesByDistanceFromCenter()

void QgsVectorTileUtils::sortTilesByDistanceFromCenter ( QVector< QgsTileXYZ > &  tiles,
const QPointF &  center 
)
static

Orders tile requests according to the distance from view center (given in tile matrix coords)

Definition at line 176 of file qgsvectortileutils.cpp.

◆ tilePolygon()

QPolygon QgsVectorTileUtils::tilePolygon ( QgsTileXYZ  id,
const QgsCoordinateTransform ct,
const QgsTileMatrix tm,
const QgsMapToPixel mtp 
)
static

Returns polygon (made by four corners of the tile) in screen coordinates.

Definition at line 36 of file qgsvectortileutils.cpp.

◆ tilesInRange()

QVector< QgsTileXYZ > QgsVectorTileUtils::tilesInRange ( const QgsTileRange range,
int  zoomLevel 
)
static

Returns a list of tiles in the given tile range.

Definition at line 163 of file qgsvectortileutils.cpp.


The documentation for this class was generated from the following files: