Class HeadlessTileRenderer
Renders a prepared HeadlessCompositeScene as XYZ Web-Mercator raster tiles (see XyzTileGrid).
public sealed class HeadlessTileRenderer
- Inheritance
-
HeadlessTileRenderer
- Inherited Members
Remarks
Prepare the scene with HonorScaleVisibility on, so each zoom level shows only what is visible at its scale, and EnableSeamWrap off, because this renderer draws the data on either side of the antimeridian itself, and KeepAreaSymbolsInView off, so a surface across several tiles keeps one symbol rather than one per tile.
Tiles are rendered in blocks (TileBlock) and cut apart. The renderer maps world to pixels with one continuous transform and does not clip geometry to the viewport, and it keeps point symbols and text whose anchor lies up to PointCullMarginPx pixels outside it. So a feature crossing a tile edge draws identically on both sides, whether the two tiles share a block or not.
Each zoom level is evaluated at one scale denominator, measured at ReferenceLatitude, rather than at each tile's own latitude. Measuring per tile would switch SCAMIN at row boundaries and cut features off along tile edges.
The renderer is immutable; Render(TileBlock) may be called concurrently.
Constructors
HeadlessTileRenderer(HeadlessCompositeScene, HeadlessTileOptions?)
Creates a tile renderer over a prepared scene.
public HeadlessTileRenderer(HeadlessCompositeScene scene, HeadlessTileOptions? options = null)
Parameters
sceneHeadlessCompositeSceneThe prepared scene.
optionsHeadlessTileOptionsTile options; defaults when null.
Properties
TilePixelSize
The edge length of each tile image, in pixels.
public int TilePixelSize { get; }
Property Value
Methods
PlanBlocks(int, IReadOnlyList<int>, int, int, int)
Splits the tiles of one zoom level into blocks of at most
blockSize × blockSize tiles, aligned
to multiples of blockSize so neighbouring runs share
block boundaries.
public static IReadOnlyList<TileBlock> PlanBlocks(int zoom, IReadOnlyList<int> columns, int firstRow, int lastRow, int blockSize)
Parameters
zoomintThe zoom level.
columnsIReadOnlyList<int>The tile columns to cover, ascending (see Columns(int, double, double)).
firstRowintThe first tile row to cover.
lastRowintThe last tile row to cover.
blockSizeintThe block edge length, in tiles.
Returns
- IReadOnlyList<TileBlock>
The blocks, row-major.
Render(TileBlock)
Renders a block of tiles and cuts it into one image per tile.
public IReadOnlyList<HeadlessTile> Render(TileBlock block)
Parameters
blockTileBlockThe block to render. It must lie inside the grid.
Returns
- IReadOnlyList<HeadlessTile>
The tiles, row-major. The caller disposes them.
ScaleDenominator(int)
The scale denominator zoom is rendered at:
ScaleDenominator(int, double) at the reference latitude.
public double ScaleDenominator(int zoom)
Parameters
zoomintThe zoom level.