Class GridDisplayScale
Derives a gridded coverage's minimum display scale (the scale beyond which it is hidden as you zoom out) from its grid spacing, for datasets that declare none.
public static class GridDisplayScale
- Inheritance
-
GridDisplayScale
- Inherited Members
Remarks
A grid drawn with many nodes behind each screen pixel shows nothing the mariner can read, yet every such dataset still costs a raster draw per frame; hundreds of them made zoomed-out panning lag. The cutoff is where one nominal screen pixel (0.28 mm, as for S-101 display scales) covers NodesPerPixel grid nodes. A display scale the dataset or its catalogue declares takes precedence.
Fields
MetresPerDegreeLatitude
Metres per degree of latitude (mean).
public const double MetresPerDegreeLatitude = 111320
Field Value
NodesPerPixel
Grid nodes behind one screen pixel at the cutoff.
public const double NodesPerPixel = 4
Field Value
PixelSizeMetres
Nominal screen pixel pitch in metres (0.28 mm).
public const double PixelSizeMetres = 0.00028
Field Value
Methods
FromGrid(GridMetadata, bool)
The minimum display scale denominator for grid,
using its finer axis spacing. A geographic grid's spacing is in degrees
(latitude spacing converts directly; longitude spacing shrinks with
latitude, so the latitude axis alone decides); a projected grid's is in
metres.
public static int? FromGrid(GridMetadata grid, bool geographic)
Parameters
gridGridMetadataThe full-resolution grid.
geographicboolTrue when the grid's CRS is geographic (degrees).
Returns
- int?
FromSpacing(double)
The minimum display scale denominator for a grid whose node spacing is
spacingMetres, or null when the
spacing is not a positive finite number.
public static int? FromSpacing(double spacingMetres)
Parameters
spacingMetresdoubleThe grid's finest node spacing, in metres.
Returns
- int?