@magiclane/maps-sdk
    Preparing search index...

    Class LogMetadata

    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.

    • RecorderBookmarks.getLogMetadata - Obtain a LogMetadata for a file path.
    • LogMetrics - High-level metrics for the recorded log.

    Hierarchy

    • GemAutoreleaseObject
      • LogMetadata
    Index

    Accessors

    • get activeDurationMillis(): 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.

      Returns number

      An integer representing active recording time in milliseconds.

      durationMillis - Total duration including paused time.

    • get activityRecord(): ActivityRecord

      Activity details recorded with the log.

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

      Returns ActivityRecord

      An ActivityRecord instance parsed from the log metadata.

    • get availableDataTypes(): 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.

      Returns DataType[]

      An array of DataType items available in the log.

    • get durationMillis(): 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.

      Returns number

      An integer representing the duration in milliseconds.

      activeDurationMillis - Total active recording time excluding pauses.

    • get endPosition(): 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.

      Returns Coordinates

      A Coordinates instance representing the ending position, or (0, 0) if no GPS data is available.

    • get endTimestampInMillis(): 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.

      Returns number

      An integer with milliseconds since epoch for the last sample.

    • get isProtected(): 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.

      Returns boolean

      true when the log is protected; otherwise false.

    • get isUploaded(): 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.

      Returns boolean

      true when the log is uploaded; otherwise false.

    • get logMetrics(): LogMetrics

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

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

      Returns LogMetrics

      A LogMetrics instance with distance, elevation and speed metrics.

    • get logSize(): number

      Size of the log file in bytes.

      Returns number

      An integer with the total size of the log file in bytes.

    • get preciseRoute(): 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.

      Returns Coordinates[]

      An array of Coordinates containing all recorded positions.

      • route - A simplified, downsampled version of the recorded path.
      • Path - A class representing a geometric path.
    • get route(): 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.

      Returns Coordinates[]

      An array of Coordinates representing the sampled route.

      • preciseRoute - A full-resolution version of the recorded path.
      • Path - A class representing a geometric path.
    • get soundMarks(): 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.

      Returns SoundMark[]

      An array of SoundMark instances.

    • get startPosition(): 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.

      Returns Coordinates

      A Coordinates instance representing the starting position, or (0, 0) if no GPS data is available.

    • get startTimestampInMillis(): 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.

      Returns number

      An integer with milliseconds since epoch for the first sample.

    • get textMarks(): 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.

      Returns TextMark[]

      An array of TextMark instances.

    • get transportMode(): 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.

      Returns RecordingTransportMode

      A RecordingTransportMode value describing the transport mode.

    Methods

    • 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.

      Parameters

      • key: string

        The string key to associate with the metadata.

      • userMetadata: Uint8Array

        A Uint8Array containing the data to store.

      Returns Promise<boolean>

      A Promise that resolves with true on success, false on failure.

      • getUserMetadata - Retrieve custom metadata from the log.
      • Recorder.addUserMetadata - Add custom metadata during recording.
    • 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.

      Parameters

      • key: string

        The string key used when saving the metadata.

      Returns Uint8Array<ArrayBufferLike> | null

      A Uint8Array with the stored data, or null if no data exists for the provided key.

      • addUserMetadata - Store custom metadata in the log.
      • Recorder.addUserMetadata - Add custom metadata during recording.
    • Checks whether a given data type exists in the log.

      Parameters

      • type: DataType

        The DataType to check for availability in the recorded log.

      Returns boolean

      true if the data type is present in the log, otherwise false.

    • Registers an object for auto release. When the object is not used anymore, it will be released automatically from C++.

      Parameters

      • pointerId: any

        The pointer ID to register

      Returns void