Skip to content

TileMatrixSet

Namespace: ThinkGeo.Core

This class represents a collection of ZoomLevels.

public class TileMatrixSet

Inheritance object → TileMatrixSet

Remarks:

This class represents a collection of ZoomLevels. Each ZoomLevel has a different scale and can store Styles that determine how InternalFeatures draw.

Properties

TileWidth

This now equals to TileMatrices[0].TileWidth, suppose all the tile matrices have the same tile width. But you can create a tile matrix set with different tile width for each matrix.

public int TileWidth { get; set; }

Property Value

int

TileHeight

This now equals to TileMatrices[0].TileHeight, suppose all the tile matrices have the same tile height. But you can create a tile matrix set with different tile height for each matrix.

public int TileHeight { get; set; }

Property Value

int

TileMatrices

This property is used to store the collection of TileMatrix.

public Collection<TileMatrix> TileMatrices { get; set; }

Property Value

Collection<TileMatrix>

Projection

The coordinate system the grid is laid out in, or null when it is not stated.

public Projection Projection { get; set; }

Property Value

Projection

Remarks:

A grid states bounds and units; those are half of what a coordinate means. The root (-4500000, 0) - (5500000, 10000000) in metres is a UTM zone, and the same numbers read as web mercator land somewhere else entirely, so a grid that does not say which system it is in cannot be compared with another grid, and data cannot be converted onto it.

Null keeps the behaviour this type has always had: the plane is inferred from the root tile, and a root that matches mercator's square is treated as mercator. Stating it replaces that guess with an answer, which is what lets two grids be told apart when their bounds happen to look alike.

Constructors

TileMatrixSet()

This is the default constructor.

public TileMatrixSet()

Methods

GetSnappedZoomIndex(double)

Returns snapped zoom index for .

public int GetSnappedZoomIndex(double scale)

Parameters

scale double
The scale factor to apply.

Returns

int
The result of the operation.

GetSnappedMatrix(double)

Returns the snapped matrix for the provided scale.

public ValueTuple<int, TileMatrix> GetSnappedMatrix(double scale)

Parameters

scale double
The scale factor to match against the matrix set.

Returns

ValueTuple<int, TileMatrix>
The snapped matrix index and corresponding tile matrix.

GetScales()

Returns scales.

public Collection<double> GetScales()

Returns

Collection<double>
The result of the operation.

CreateTileMatrixSet(int, RectangleShape, GeographyUnit, int)

Return a tile matrix set, which consists of given number (20 by default) of zoom levels. Zoom level 0 covers the entire BoundingBox with a single tile of size TileSize x TileSize.There are a total of 20 zoom levels in this set.At each successive zoom level, the map resolution doubles-so each tile's ground scale is half that of the previous level.

public static TileMatrixSet CreateTileMatrixSet(int tileSize, RectangleShape boundingBox, GeographyUnit boundingBoxUnit, int zoomLevelCount)

Parameters

tileSize int

boundingBox RectangleShape

boundingBoxUnit GeographyUnit

zoomLevelCount int

Returns

TileMatrixSet

CreateTileMatrixSet(int, RectangleShape, Projection, int)

Return a tile matrix set laid out in , which consists of the given number (20 by default) of zoom levels.

public static TileMatrixSet CreateTileMatrixSet(int tileSize, RectangleShape boundingBox, Projection projection, int zoomLevelCount)

Parameters

tileSize int
The width and height, in pixels, of each square tile.

boundingBox RectangleShape
The geographic area every tile matrix in the set covers.

projection Projection
The coordinate system those bounds are in. The unit comes from it, so a set built this way cannot state a unit that disagrees with its system.

zoomLevelCount int
How many zoom levels the set holds.

Returns

TileMatrixSet

CreateTileMatrixSet(int, RectangleShape, GeographyUnit, IEnumerable<double>)

Creates a TileMatrixSet whose zoom levels correspond exactly to the provided .

public static TileMatrixSet CreateTileMatrixSet(int tileSize, RectangleShape boundingBox, GeographyUnit boundingBoxUnit, IEnumerable<double> scales)

Parameters

tileSize int
The width and height, in pixels, of each square tile in the resulting matrix set.

boundingBox RectangleShape
The geographic area that every tile matrix in the set will cover.

boundingBoxUnit GeographyUnit
The unit of measurement for the coordinates in .

scales IEnumerable<double>
An ordered sequence of map scales. One will be created for each scale value. A containing one per scale in .

Returns

TileMatrixSet

CreateTileMatrixSet(int, RectangleShape, Projection, IEnumerable<double>)

Creates a TileMatrixSet laid out in whose zoom levels correspond exactly to the provided .

public static TileMatrixSet CreateTileMatrixSet(int tileSize, RectangleShape boundingBox, Projection projection, IEnumerable<double> scales)

Parameters

tileSize int
The width and height, in pixels, of each square tile.

boundingBox RectangleShape
The geographic area every tile matrix in the set covers.

projection Projection
The coordinate system those bounds are in. The unit comes from it, so a set built this way cannot state a unit that disagrees with its system.

scales IEnumerable<double>
An ordered sequence of map scales, one matrix per scale.

Returns

TileMatrixSet