Drifting paths and predictions

From Maria GDK Wiki
Jump to navigation Jump to search

The Drifting Path draw object shows and keeps track of the position and path of a floating device (e.g. a buoy). According to user specification, and because of the frequent update of current position, the path is shown simplified/thinned. Apart from last (current) position, which is always shown, a new waypoint along the path is marked only if the distance to the previous marked waypoint exceeds a certain limit. At the current position, an arrow marks current drifting direction, opposite to the bearing between the last two registered positions, which because of the thinning is generally different from the bearing between last position and last shown waypoint.

Code to create the object and add positions consecutively is available from the DriftingPathUtils class in the TPG.DrawObjects.ClientUtils namespace:

public static IDrawObjectData CreateDriftingPath(IDrawObjectDataFactory fac, IEnumerable<GeoPos> path = null);

The path parameter, if present, is the intial path at creation time. Subsequent positions are added using:

public static void AddDriftingPathPosition(IDrawObjectData dp, GeoPos pos);

where dp is the Drifting Path object in question.

Symbolization parameters:

Field Value Description
MinimumWaypointSeparation double Minimum separation between marked wyapoints in meters. Default = 100.
DirectionArrowLength double Length of current direction arrow symbol in pixels. Default = 30
WaypointSymbolSize double Size (radius) of waypoint symbols in pixels. Default = 5

The Drifting Prediction draw object shows the _simulated_ path and position of a floating device (or particle e.g. of oil or similar material) at various time steps according to precalculated simulation results. A typical simulation will commonly encompass a multitude of mutually independent objects seeded at various positions and at various time steps within a common area of interest. Using the DriftingPathUtils class in the TPG.DrawObjects.ClientUtils namespace, a container for these objects/particles are created in terms of a composite draw object:

public static IDrawObjectData CreateDriftingPredictionsContainer(IDrawObjectDataFactory fac);

Then, single objects are added to the container one by one. Unlike the Drifting Path objects, where only the start position(s) are known initially, the Drifting Prediction is known in its entirety at creation time. And so predicted positions and state at every timestep is passed along at this operation:

public static IDrawObjectData AddDriftingPrediction(IDrawObjectDataFactory fac, IDrawObjectData container, IEnumerable<GeoPos> pathPrediction, int timestepSeeded, int timestepBeached);

where "container" denotes the common container object mentioned above. The timestepSeeded parameter indicates at which time step (>= 0) the first element in the predicted path will be valid. The timeStepBeached parameter indicates at which time step (>= timestepSeeded) the object/particle is taken to be beached or evaporated.

Symbolization parameters:

Field Value Description
SeededColor R,G,B,A Symbol color fro objects when seeded.
BeachedColor R,G,B,A Symbol color for objects when beached or evaporated.
DriftingColor R,G,B,A Symbol color for objects when drifting.
WaypointSymbolSize double Size (radius) of waypoint symbols in pixels. Default = 5

Once all objects are added to the container, the simulation can be looped through step by step by repeatedly setting the current time step value:

public static void SetCurrentTimestep(IDrawObjectData container, int timestep);