Polylines use the stats that can apply to any numerical trend, such as max/min, avg, sum, mean, etc. This is done through higher-level stats that are comprised of these. For example, a segment always has some concept of a length. This differs if the segment is a straight, curved, or other-shaped path.
GIS libraries may have concepts of height, speed, etc. that do not apply to cross-sectional geometries. As such, this library goes no further, and allows higher-level libraries to use and inherit from this library in order to properly implement the appropriate stats that have meaning for the precise usage of the polyline.
Stats interface properties are just the interface that indicates the entire list of potential stats available in the polyline. Stats criteria allow selective turning on/of of individual stats in case a user does not need them & wants to increase speed. Any deriving library should inherit it’s own PolylineStats class, as well as Stats & StatsCriteria interfaces for these uses.
The PolylineStats class is a manager class that references two main types of objects:
A collection of stats, such as length
An object from which to collect stats, and the start/end location for such stats, as:
A polyline from which the stats are to be derived from beginning to end
A start/end set of vertices (assumed to be in the correct order on a polyline) that indicate along what lengths of a polyline the stats are to be derived.
This allows a pattern of accumulating stats classes and injecting the type of polyline from which stats are to be collected. The polyline need not know anything about this, as it allows access to its internals to visitors.
Stats Subscribing/Updating
Polylines have a version number that is incremented every time a polyline is modified. This allows objects such as PolylineStats managers to lazily subscribe/update to them. In this way, a user can make many modifications to a polyline with no triggering of re-calculating updates. Instead, updates are cached once calculated. When they are fetched, polyline version numbers are compared in order to decide whether to re-calculate the stats or fetch pre-calculated ones.
Attachments:
Screen Shot 2024-08-20 at 4.22.46 PM.png (image/png)
Screen Shot 2024-08-22 at 4.04.54 PM.png (image/png)