Observations Layer
The MapWeave observations layer shows identifiable real-word beings or objects, such as a person or vehicle, at a particular time and location. It consumes data made up of multiple observations in a format that uniquely identifies each entity - the object or being - with a location and time stamp. MapWeave can then 'connect-the-dots' to infer the trajectory - the path taken - of each entity.
Data Format
An example of ObservationsLayerData is as follows:
const vehicleObservations = {
entities: { vehicle1: { color: '#F2A688' } },
observations: {
vehicle1_1: {
type: 'observation',
entityId: 'vehicle1',
latitude: 49.2827,
longitude: -123.1207,
time: new Date('2024-12-16T08:00:00'),
},
vehicle1_2: {
type: 'observation',
entityId: 'vehicle1',
latitude: 49.2835,
longitude: -123.1167,
time: new Date('2024-12-16T08:05:00'),
},
vehicle1_3: {
type: 'observation',
entityId: 'vehicle1',
latitude: 49.284,
longitude: -123.1123,
time: new Date('2024-12-16T08:10:00'),
},
vehicle1_4: {
type: 'observation',
entityId: 'vehicle1',
latitude: 49.2832,
longitude: -123.1085,
time: new Date('2024-12-16T08:15:00'),
},
vehicle1_5: {
type: 'observation',
entityId: 'vehicle1',
latitude: 49.2808,
longitude: -123.106,
time: new Date('2024-12-16T08:20:00'),
},
},
};
Entities
An entity is a physical object or being that can be tracked as they move through space and time and can be assigned a color
In the API they are defined as a ObservedEntity in ObservationsLayerData.
Whether entities are displayed as individual observations, trajectories or both can be controlled by changing the mode set in the ObservationsLayerOptions.
They are displayed in 'auto' mode by default. Control the min and max zoom levels in the autoRange objects to control when MapWeave changes between
individual observations and trajectories.
Here we see the path of a drone showing the individual observations and the trajectory. Both the observations and the trajectory
inherit the color of the entity.
Observations
Observations are a series of records of the time, latitude and longitude of an entity and can be assigned a color.
When the observations are shown individually, by setting the mode to 'individual' or 'auto', each observation is represented on the map
by a circle. The radius of the circle can be set using the minimumRadiusMeters
and radiusPixels properties in the individual object in ObservationsLayerOptions.
time
| latitude
| longitude
| color
| individual
| minimumRadiusMeters
| radiusPixels
Trajectories
MapWeave can infer the trajectory, or path, of an entity by linking its observations with a line. Trajectories are only created when the observations are within a set time interval.
When the observations are shown as trajectories, by setting the mode to 'trajectory' or 'auto', the path is represented on the map by a line.
The width of the line can be set using the minimumWidthMeters and widthPixels properties in the trajectory
object in ObservationsLayerOptions.
By default, MapWeave will infer a trajectory when each observation is less than 60000 milliseconds (1 minute) apart.
The interval can be set using the maximumInterval property.
Here the maximumInterval property has been set to 27000 milliseconds, which means that two separate trajectories are created.
Tracker Nodes
Trajectories can be associated with a node on a network layer by assigning a common id to an entity in observations layer data and the id of the networkNode in network layer data. These nodes are called tracker nodes
and can be dragged along a trajectory to estimate the location of an entity at the currentTime.
Set the network layer that contains the tracker node with networkLayerId.