Sections
This class represents Routes used in many GIS operations.
Currently this class has not been created, but as the GIS library expands in uses and capabilities, one will be created analogous to the Track Class. Information on this page is still accurate, apart from the diagrams referring to ‘Track’ where is should have ‘Route’ displayed.
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 Route object from a GeoJSON FeatureCollection wrapper object. If such an object was initialized with raw GeoJSON, then changes to the Route object will cascade to the original GeoJSON object.
Serialization
The Route object has a variety of methods for exporting its state for other uses.
toJson
The Route 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 Route 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 Route Manager during Route modifications. However, it can also be called independently from the main Map.tsx
React-Leaflet component. See GIS Route Managers & GIS.ly Route Managers for examples of where this method is called.
Not only does this synchronize the state of the GeoJSON Wrapper object stored within the Route object, but it also updates any raw GeoJSON object that may have been used to instantiate the Route object.
Route Calculations
The Route object holds a Polyline Data Structure (Route 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 Route object to perform work on.
Attachments:
Screen Shot 2023-11-18 at 11.41.23 AM.png (image/png)
Screen Shot 2023-11-09 at 12.30.31 PM.png (image/png)
Screen Shot 2023-11-17 at 4.22.41 PM.png (image/png)
Screen Shot 2023-11-09 at 12.20.34 PM.png (image/png)