mark-p-thomas : GIS Track Manager Classes

Sections

Track Calculations

The Track object holds a Polyline Data Structure & an associated GeoJSON object within a wrapper. The polyline acts as a proxy for the original track, where additional decorations of properties can be added to vertices, segments, including 2nd & 3rd order affects. These properties can be displayed in the Leaflet component by association with the appropriate Track Point. They are also easily accessed & manipulated by manager objects that are given a Track to perform work on.

Manager Operations

Track Managers are used to do any CRUD operations on a Track object beyond the basic properties & methods provided by the Track object. This allows infinite customization & manipulation of Track objects without needing to modify the Track class itself.

Manager Structure

Managers are structured in two tiers, described below.

Action Managers (Lower Tier)

The lower tier is an action-specific manager. This is a more generic manager that contains the Track object & performs more general operations on it such as splitting & smoothing. This lower tier manager may also expose parts of the Track object, such as start/end vertices & segments for traversals, but usually this is kept at the lower level.

Solution Managers (Upper Tier)

Solution managers implement actions in order to perform a specific solution to problems/needs of a Track. These managers implement more logic more specific to the problem addressed rather than the workings of the Track polyline data structure & interact with the action manager as needed.

The sequence diagram above shows an example of this with a DurationSplitter that splits a Track object based on the elapsed time between two Track Points.

Delegating

Delegating provides external logic, typically by setting a limit criteria, & then directly calls a basic method provided by the Action Manager.

Node Traversal & Manipulation

Sometimes deeper access to the Track Polyline is needed. In this case, the manager may get start/end vertices & segments from the Action Manager, which allows for unlimited depth & flexibility on operations. However, these objects should NOT be exposed beyond this manager in order to avoid unexpected changes to the Track object.

Updating Hooked GeoJSON Objects

For efficiency, none of the manipulations update any GeoJSON objects by default. This allows for intermediate rollbacks before transaction commitments, as well as single actions being iterated without time penalties.

It is up to the manager object to decide when or whether to update the GeoJSON object. Such updates can also be done external to the manager.