Sections
This class represents Tracks used in many GIS operations.
Factory Methods
The Track object is instantiated purely through factory methods as there are a variety of ways to instantiate one.
fromJson
This factory method creates a new Track object from a GeoJSON FeatureCollection wrapper object. If such an object was initialized with raw GeoJSON, then changes to the Track object will cascade to the original GeoJSON object.
Serialization
The Track object has a variety of methods for exporting its state for other uses.
toJson
The Track object can write its state back to GeoJSON via the contained GeoJSON wrapper object. This is illustrated below.
Updating
Most of the querying & modifications occur only on the Polyline Track for the sake of efficiency. Because of this, the contained Polyline object will inevitably get out of sync with the contained GeoJSON wrapper object. Updating syncs these two objects on the relevant data.
updateGeoJsonTrack
This is often called within the Track Manager during Track modifications. However, it can also be called independently from the main Map.tsx
React-Leaflet component. See GIS Track Managers & GIS.ly Track Managers for examples of where this method is called.
Not only does this synchronize the state of the GeoJSON Wrapper object stored within the Track object, but it also updates any raw GeoJSON object that may have been used to instantiate the Track object.
Track Calculations
The Track object holds a Polyline Data Structure (Track Polyline) & 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 objects & properties are also easily accessed & manipulated by manager objects that are given a Track object to perform work on.
Attachments:
Screen Shot 2023-11-17 at 4.20.33 PM.png (image/png)
Screen Shot 2023-11-17 at 4.22.41 PM.png (image/png)
Screen Shot 2023-11-09 at 12.30.31 PM.png (image/png)
Screen Shot 2023-11-09 at 12.30.31 PM.png (image/png)
Screen Shot 2023-11-18 at 11.41.23 AM.png (image/png)
Screen Shot 2023-11-09 at 12.20.34 PM.png (image/png)