Table of Contents

Class ThinnedSymbolLayer

Namespace
EncDotNet.S100.Renderers.Mapsui
Assembly
EncDotNet.S100.Renderers.Mapsui.dll

A Mapsui layer of scaled point symbols (S-111 current arrows) that thins itself for the zoom it is drawn at. Each time Mapsui asks for the visible features, the layer runs SymbolThinning for the current resolution and returns only the symbols that keep the required on-screen spacing, so arrow density stays legible from a whole-bay view down to a harbour.

public sealed class ThinnedSymbolLayer : BaseLayer, ILayer, IAnimatable, INotifyPropertyChanged, IDisposable
Inheritance
BaseLayer
ThinnedSymbolLayer
Implements
ILayer
IAnimatable
Inherited Members
BaseLayer.NextId()
BaseLayer.DataHasChanged()
BaseLayer.ToString()
BaseLayer.Dispose()
BaseLayer.UpdateAnimations()
BaseLayer.Id
BaseLayer.Tag
BaseLayer.MinVisible
BaseLayer.MaxVisible
BaseLayer.Enabled
BaseLayer.Name
BaseLayer.Opacity
BaseLayer.Busy
BaseLayer.Style
BaseLayer.Attribution
BaseLayer.Resolutions
BaseLayer.SortFeatures
BaseLayer.CustomLayerRendererName
BaseLayer.PropertyChanged
BaseLayer.DataChanged

Remarks

A regular grid (constructed with rows × cols symbols) is thinned with ThinGrid(int, int, ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<float>, ReadOnlySpan<float>, double, SymbolRect, double, List<int>) over the displayed field, as S-98 Appendix G-1.1 describes. Scattered points (a station series or an ungeorectified mesh, constructed with rows = 0) are thinned with ThinPoints(ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, ReadOnlySpan<double>, double, List<int>) over every point, so the selection only changes with zoom and stays put while panning.

Features are created lazily, once per symbol, through the supplied factory and reused across frames. The last query is cached, so repeated paints of an unchanged view cost nothing.

Constructors

ThinnedSymbolLayer(int, int, double[], double[], float[], float[], double, double, Func<int, IFeature?>)

Creates a thinned symbol layer.

public ThinnedSymbolLayer(int rows, int cols, double[] x, double[] y, float[] scale, float[] priority, double lengthPixelsPerScale, double maxRatio, Func<int, IFeature?> featureFactory)

Parameters

rows int

Number of grid rows when the symbols form a regular grid (row-major, with cols columns); 0 for scattered points.

cols int

Number of grid columns; ignored when rows is 0.

x double[]

Per-symbol EPSG:3857 x.

y double[]

Per-symbol EPSG:3857 y.

scale float[]

Per-symbol scale relative to lengthPixelsPerScale; NaN or non-positive for a cell without a symbol.

priority float[]

Per-symbol thinning priority (higher is kept first; for S-111, speed).

lengthPixelsPerScale double

On-screen length, in pixels, of a symbol at scale 1.

maxRatio double

The thinning ratio Rmax.

featureFactory Func<int, IFeature>

Creates the feature for a symbol index; may return null to skip it.

Properties

Extent

Returns the envelope of all available data in the layer

public override MRect? Extent { get; }

Property Value

MRect

SymbolCount

Total number of symbol positions (drawn or not) the layer holds.

public int SymbolCount { get; }

Property Value

int

Methods

GetFeatures(MRect?, double)

Get all features in a given MRect for a given resolution

public override IEnumerable<IFeature> GetFeatures(MRect? rect, double resolution)

Parameters

rect MRect
resolution double

Resolution of viewport

Returns

IEnumerable<IFeature>