Table of Contents

Class PlacementArea

Namespace
EncDotNet.S100.Rendering.Scene
Assembly
EncDotNet.S100.Rendering.Scene.dll

The area a point symbol or text is kept in when it is placed in the visible parts of its surface (S-100 Part 9 AreaPlacement:VisibleParts).

public sealed class PlacementArea
Inheritance
PlacementArea
Inherited Members

Remarks

The op's own anchor is a representative point inside the area. While that point is in view the symbol stays there, so it doesn't move as the chart pans. Once it leaves the view, AnchorIn((double X, double Y), double, double, double, double) moves the symbol to a representative point of the largest part of the area that is still in view.

Constructors

PlacementArea(Geometry)

Creates a placement area over a polygon or multipolygon in EPSG:3857 metres.

public PlacementArea(Geometry area)

Parameters

area Geometry

The surface, in EPSG:3857 metres.

Properties

MaxX

East edge of the area, in EPSG:3857 metres.

public double MaxX { get; }

Property Value

double

MaxY

North edge of the area, in EPSG:3857 metres.

public double MaxY { get; }

Property Value

double

MinX

West edge of the area, in EPSG:3857 metres.

public double MinX { get; }

Property Value

double

MinY

South edge of the area, in EPSG:3857 metres.

public double MinY { get; }

Property Value

double

Methods

AnchorIn((double X, double Y), double, double, double, double)

The anchor to draw at in the view (minX, minY)–(maxX, maxY), in EPSG:3857 metres: anchor while it is in view or the area is entirely out of view, otherwise a representative point of the largest part of the area in view.

public (double X, double Y) AnchorIn((double X, double Y) anchor, double minX, double minY, double maxX, double maxY)

Parameters

anchor (double X, double Y)
minX double
minY double
maxX double
maxY double

Returns

(double X, double Y)

Remarks

The last result is kept, so the declutter and draw passes of a frame work it out once. Safe to call from several threads.

RepresentativePoint(Geometry)

A point inside polygon: its centroid when that lies inside, otherwise an interior point.

public static (double X, double Y) RepresentativePoint(Geometry polygon)

Parameters

polygon Geometry

Returns

(double X, double Y)