Home > @magiclane/maps-sdk > LogMetadata

LogMetadata class

Provides metadata for a recorded sensor data log.

The LogMetadata object exposes information extracted from a recorded log file such as start/end timestamps and positions, route coordinates, activity details, user-provided metadata, and basic metrics. The LogMetadata class provides information about the recorded log via the Recorder class.

Do not construct this class directly; obtain an instance via RecorderBookmarks.getLogMetadata.

Signature:

export declare class LogMetadata extends GemAutoreleaseObject 

Extends: GemAutoreleaseObject

Properties

Property

Modifiers

Type

Description

activeDurationMillis

readonly

number

Total active recording time in milliseconds (excludes paused intervals).

The active duration counts only periods when recording was actually running; any paused segments are excluded.

activityRecord

readonly

ActivityRecord

Activity details recorded with the log.

This returns an ActivityRecord describing the activity metadata associated with the log (sport type, effort, visibility, etc.).

availableDataTypes

readonly

DataType[]

List of data types recorded in the log.

Use this getter to discover which sensor/data streams were recorded. The returned list contains DataType values present in the log.

durationMillis

readonly

number

Total duration of the log in milliseconds.

This is the reported duration for the recorded log and is typically equal to endTimestampInMillis - startTimestampInMillis but may differ slightly depending on how samples are recorded.

endPosition

readonly

Coordinates

Last recorded GPS coordinate in the log.

Returns the most recent valid Coordinates recorded in the log. If the log contains no GPS samples, an invalid coordinate (0, 0) is returned.

endTimestampInMillis

readonly

number

Timestamp of the last sensor data in the log, in milliseconds since epoch.

This value represents the timestamp of the final recorded sensor sample contained in the log and can be used together with startTimestampInMillis to compute durations.

isProtected

readonly

boolean

Whether the log file is marked as protected from automatic deletion.

Protected logs are preserved even when automatic cleanup of old logs is performed due to space or retention settings.

isUploaded

readonly

boolean

Whether the log file was uploaded to the server.

Returns true if the log has been successfully uploaded and is available on the server for processing.

logMetrics

readonly

LogMetrics

Basic metrics computed for the log (distance, elevation gain, average speed).

Returns a LogMetrics object containing summary metrics for the recorded log.

logSize

readonly

number

Size of the log file in bytes.

preciseRoute

readonly

Coordinates[]

The precise, full-resolution route recorded in the log.

The preciseRoute returns every recorded GPS sample from the log and should be used when an exact replay or analysis of the recorded path is required. This list can be large for long recordings.

route

readonly

Coordinates[]

A simplified route sampled from the recorded log.

The route contains coordinates selected from the full recording such that consecutive points are at least 20 meters apart or respecting a three-second delay rule; it is suitable for quick map rendering.

Can be used to compute a path-based route.

soundMarks

readonly

SoundMark[]

Sound annotations recorded within the log.

Returns a list of SoundMark objects describing intervals where audio was recorded during the session. These marks are generated when audio recording is enabled in the Recorder during the session.

startPosition

readonly

Coordinates

First recorded GPS coordinate in the log.

Returns the earliest valid Coordinates recorded in the log. If the log contains no GPS samples, an invalid coordinate (0, 0) is returned.

startTimestampInMillis

readonly

number

Timestamp of the first sensor data in the log, in milliseconds since epoch.

This value represents the timestamp of the first recorded sensor sample in the log. It can be used to align log events with other time-based data.

textMarks

readonly

TextMark[]

Text annotations recorded within the log.

Returns a list of TextMark objects created during the recording to annotate the log with short textual notes. These marks are added by calling Recorder.addTextMark while recording.

transportMode

readonly

RecordingTransportMode

Transport mode used during recording.

The transport mode reflects the primary mode of movement (for example walking, driving, cycling) inferred or selected when the log was recorded.

Methods

Method

Modifiers

Description

addUserMetadata(key, userMetadata)

Adds or overwrites custom metadata for the given key.

The provided byte buffer will be stored in the log file's metadata area. If a value already exists for the same key it will be replaced. This operation is asynchronous and returns true when the write succeeded.

getUserMetadata(key)

Retrieves custom user metadata stored with the given key.

The method returns the raw byte buffer that was previously saved using addUserMetadata. If the key does not exist an asynchronous empty response is represented as null.

isDataTypeAvailable(type)

Checks whether a given data type exists in the log.