Convert to and from an XML CoT message

A string/buffer containing the XML representation or the xml-js object tree

Hierarchy (View Summary)

Constructors

Properties

metadata: Record<string, unknown>
path: string
raw: {
    event: {
        _attributes: {
            access?: string;
            how?: string;
            opex?: string;
            qos?: string;
            stale: string;
            start: string;
            time: string;
            type: string;
            uid: string;
            version: string;
        };
        detail?: {
            __chat?: {
                _attributes: {
                    chatroom: string;
                    groupOwner?: string;
                    id: string;
                    messageId?: string;
                    parent?: string;
                    senderCallsign: string;
                };
                chatgrp: any;
            };
            __forcedelete?: {};
            __geofence?: {
                _attributes: {
                    boundingSphere?: number;
                    elevationMonitored?: string;
                    maxElevation?: string;
                    minElevation?: string;
                    monitor?: string;
                    tracking?: string;
                    trigger?: string;
                };
            };
            __group?: { _attributes?: { name: string; role: string } };
            __video?: {
                _attributes?: {
                    sensor?: string;
                    spi?: string;
                    uid?: string;
                    url?: string;
                };
                ConnectionEntry?: {
                    _attributes: {
                        address: string;
                        alias?: string;
                        bufferTime?: number;
                        ignoreEmbeddedKLV?: boolean;
                        networkTimeout?: number;
                        path?: string;
                        port?: number;
                        protocol?: string;
                        roverPort?: number;
                        rtspReliable?: number;
                        uid: string;
                    };
                };
            };
            "_flow-tags_"?: any;
            ackrequest?: {
                _attributes: { ackrequested: boolean; tag: string; uid: string };
            };
            archive?: | { _attributes?: { value?: string } }
            | { _attributes?: { value?: string } }[];
            attachment_list?: { _attributes: { hashes: string } };
            bearing?: { _attributes: { value: string } };
            bearingUnits?: { _attributes: { value: string } };
            color?: { _attributes?: { argb?: string } };
            contact?: {
                _attributes: {
                    callsign?: string;
                    endpoint?: string;
                    name?: string;
                    phone?: string;
                };
            };
            fileshare?: {
                _attributes: {
                    filename: string;
                    name: string;
                    senderCallsign: string;
                    senderUid: string;
                    senderUrl: string;
                    sha256: string;
                    sizeInBytes: number;
                };
            };
            fillColor?: { _attributes?: { value?: string } };
            inclination?: { _attributes: { value: string } };
            labels_on?: { _attributes?: { value?: string } };
            link?:
                | {
                    _attributes: {
                        mime?: string;
                        parent_callsign?: string;
                        point?: string;
                        production_time?: string;
                        relation?: string;
                        remarks?: string;
                        type?: string;
                        uid?: string;
                        url?: string;
                    };
                }
                | {
                    _attributes: {
                        mime?: string;
                        parent_callsign?: string;
                        point?: string;
                        production_time?: string;
                        relation?: string;
                        remarks?: string;
                        type?: string;
                        uid?: string;
                        url?: string;
                    };
                }[];
            link_attr?: {
                _attributes: {
                    color?: number;
                    direction?: "Infil"
                    | "Exfil";
                    method: "Driving" | "Walking" | "Flying" | "Swimming" | "Watercraft";
                    order: "Ascending Check Points" | "Descending Check Points";
                    planningmethod?: "Infil" | "Exfil";
                    prefix: string;
                    routetype: "Primary" | "Secondary";
                    stroke?: string;
                    type?: string;
                };
            };
            marti?: {
                _attributes?: {};
                dest?: | {
                    _attributes: {
                        after?: string;
                        callsign?: string;
                        mission?: string;
                        "mission-guid"?: string;
                        path?: string;
                        uid?: string;
                    };
                }
                | {
                    _attributes: {
                        after?: (...)
                        | (...);
                        callsign?: (...) | (...);
                        mission?: (...) | (...);
                        "mission-guid"?: (...) | (...);
                        path?: (...) | (...);
                        uid?: (...) | (...);
                    };
                }[];
            };
            mission?: {
                _attributes?: {
                    authorUid?: string;
                    guid?: string;
                    name?: string;
                    tool?: string;
                    type?: string;
                };
                MissionChanges?: {
                    MissionChange: | {
                        contentUid: { _text: ... };
                        creatorUid: { _text?: ... };
                        details: { _attributes: ...; location?: ... };
                        isFederatedChange: { _text: ... };
                        missionName: { _text: ... };
                        timestamp: { _text: ... };
                        type: { _text: ... };
                    }
                    | {
                        contentUid: ...;
                        creatorUid: ...;
                        details: ...;
                        isFederatedChange: ...;
                        missionName: ...;
                        timestamp: ...;
                        type: ...;
                    }[];
                };
                missionLayer?: {
                    name?: { _text: string };
                    parentUid?: { _text: string };
                    type?: { _text: string };
                    uid?: { _text: string };
                };
            };
            northRef?: { _attributes: { value: string } };
            precisionlocation?: {
                _attributes: { altsrc?: string; geopointsrc?: string };
            };
            range?: { _attributes: { value: string } };
            rangeUnits?: { _attributes: { value: string } };
            remarks?: {
                _attributes?: { source?: string; time?: string; to?: string };
                _text?: string;
            };
            sensor?: {
                _attributes: {
                    azimuth?: number;
                    displayMagneticReference?: number;
                    elevation?: number;
                    fov?: number;
                    fovAlpha?: number;
                    fovBlue?: number;
                    fovGreen?: number;
                    fovRed?: number;
                    hideFov?: boolean;
                    model?: string;
                    north?: number;
                    range?: number;
                    rangeLines?: number;
                    rangeLineStrokeColor?: number;
                    rangeLineStrokeWeight?: number;
                    roll?: number;
                    strokeColor?: number;
                    strokeWeight?: number;
                    type?: string;
                    version?: string;
                    vfov?: number;
                };
            };
            shape?: {
                ellipse?: {
                    _attributes: { angle: number; major: number; minor: number };
                };
                polyline?: {
                    _attributes?: {
                        closed?: (...)
                        | (...)
                        | (...);
                        color?: (...) | (...);
                        fillColor?: (...) | (...);
                    };
                    vertex?: | { _attributes: { lat: ...; lon: ... } }
                    | { _attributes: ... }[];
                };
            };
            status?: { _attributes: { battery?: string; readiness?: string } };
            strokeColor?: { _attributes?: { value?: string } };
            strokeStyle?: { _attributes?: { value?: string } };
            strokeWeight?: { _attributes?: { value?: string } };
            TakControl?: {
                TakProtocolSupport?: { _attributes?: { version?: (...) | (...) } };
                TakServerVersionInfo?: {
                    _attributes?: { serverVersion?: (...) | (...) };
                };
            };
            takv?: {
                _attributes: {
                    device?: string;
                    os?: string;
                    platform?: string;
                    version?: string;
                };
            };
            tog?: { _attributes?: { enabled?: string } };
            track?: {
                _attributes?: {
                    course?: string;
                    eCourse?: string;
                    eSlope?: string;
                    eSpeed?: string;
                    slope?: string;
                    speed?: string;
                };
            };
            uid?: { _attributes: { Droid: string } };
            usericon?: { _attributes: { iconsetpath: string } };
        };
        point: {
            _attributes: {
                ce: string
                | number;
                hae: string | number;
                lat: string | number;
                le: string | number;
                lon: string | number;
            };
        };
    };
}

Raw XML-JS representation of CoT

Methods

  • Add a given Dest tag to a CoT

    Parameters

    • dest: {
          after?: string;
          callsign?: string;
          mission?: string;
          "mission-guid"?: string;
          path?: string;
          uid?: string;
      }

    Returns default

  • Parameters

    • link: {
          mime?: string;
          parent_callsign?: string;
          point?: string;
          production_time?: string;
          relation?: string;
          remarks?: string;
          type?: string;
          uid?: string;
          url?: string;
      }

    Returns default

  • Parameters

    • video: { sensor?: string; spi?: string; uid?: string; url?: string }
    • Optionalconnection: {
          address: string;
          alias?: string;
          bufferTime?: number;
          ignoreEmbeddedKLV?: boolean;
          networkTimeout?: number;
          path?: string;
          port?: number;
          protocol?: string;
          roverPort?: number;
          rtspReliable?: number;
          uid: string;
      }

    Returns default

  • Returns or sets the Callsign of the CoT

    Parameters

    • Optionalcallsign: string

    Returns string

  • Determines if the CoT message represents an Element

    Returns boolean

  • Determines if the CoT message represents a Chat Message

    Returns boolean

  • Determines if the CoT message represents a Faker Element

    Returns boolean

  • Determines if the CoT message represents a Friendly Element

    Returns boolean

  • Determines if the CoT message represents a Ground Element

    Returns boolean

  • Determines if the CoT message represents a Joker Element

    Returns boolean

  • Determines if the CoT message represents a UAV Element

    Returns boolean

  • Detect difference between CoT messages Note: This diffs based on GeoJSON Representation of message So if unknown properties are present they will be excluded from the diff

    Parameters

    • cot: default
    • opts: {
          diffDest: boolean;
          diffFlow: boolean;
          diffMetadata: boolean;
          diffStaleStartTime: boolean;
      } = ...

    Returns boolean

  • Parameters

    • Optionalposition: number[]

    Returns number[]

  • Parameters

    • Optionalsensor: {
          azimuth?: number;
          displayMagneticReference?: number;
          elevation?: number;
          fov?: number;
          fovAlpha?: number;
          fovBlue?: number;
          fovGreen?: number;
          fovRed?: number;
          hideFov?: boolean;
          model?: string;
          north?: number;
          range?: number;
          rangeLines?: number;
          rangeLineStrokeColor?: number;
          rangeLineStrokeWeight?: number;
          roll?: number;
          strokeColor?: number;
          strokeWeight?: number;
          type?: string;
          version?: string;
          vfov?: number;
      }

    Returns null | { coordinates: number[][][]; type: "Polygon" }

  • Return a GeoJSON Feature from an XML CoT message

    Returns {
        geometry:
            | { coordinates: number[][][]; type: "Polygon" }
            | { coordinates: number[]; type: "Point" }
            | { coordinates: number[][]; type: "LineString" };
        id: string;
        path?: string;
        properties: {
            ackrequest?: { ackrequested: boolean; tag: string; uid: string };
            archived?: boolean;
            attachments?: string[];
            callsign: string;
            center: number[];
            chat?: {
                chatgrp: any;
                chatroom: string;
                groupOwner?: string;
                id: string;
                messageId?: string;
                parent?: string;
                senderCallsign: string;
            };
            contact?: {
                callsign?: string;
                endpoint?: string;
                name?: string;
                phone?: string;
            };
            course?: number;
            dest?: | {
                after?: string;
                callsign?: string;
                mission?: string;
                "mission-guid"?: string;
                path?: string;
                uid?: string;
            }
            | {
                after?: string;
                callsign?: string;
                mission?: string;
                "mission-guid"?: string;
                path?: string;
                uid?: string;
            }[];
            droid?: string;
            fileshare?: {
                filename: string;
                name: string;
                senderCallsign: string;
                senderUid: string;
                senderUrl: string;
                sha256: string;
                sizeInBytes: number;
            };
            fill?: string;
            "fill-opacity"?: number;
            flow?: { [key: string]: string };
            geofence?: {
                boundingSphere?: number;
                elevationMonitored?: string;
                maxElevation?: string;
                minElevation?: string;
                monitor?: string;
                tracking?: string;
                trigger?: string;
            };
            group?: { name: string; role: string };
            how: string;
            icon?: string;
            links?: {
                mime?: string;
                parent_callsign?: string;
                point?: string;
                production_time?: string;
                relation?: string;
                remarks?: string;
                type?: string;
                uid?: string;
                url?: string;
            }[];
            "marker-color"?: string;
            "marker-opacity"?: number;
            metadata?: { [key: string]: unknown };
            mission?: {
                authorUid?: string;
                guid?: string;
                missionChanges?: {
                    contentUid: string;
                    creatorUid: string;
                    details: {
                        callsign: string;
                        color: string;
                        lat: string;
                        lon: string;
                        type: string;
                    };
                    isFederatedChange: string;
                    missionName: string;
                    timestamp: string;
                    type: string;
                }[];
                missionLayer?: {
                    name?: string;
                    parentUid?: string;
                    type?: string;
                    uid?: string;
                };
                name?: string;
                tool?: string;
                type?: string;
            };
            precisionlocation?: { altsrc?: string; geopointsrc?: string };
            remarks?: string;
            sensor?: {
                azimuth?: number;
                displayMagneticReference?: number;
                elevation?: number;
                fov?: number;
                fovAlpha?: number;
                fovBlue?: number;
                fovGreen?: number;
                fovRed?: number;
                hideFov?: boolean;
                model?: string;
                north?: number;
                range?: number;
                rangeLines?: number;
                rangeLineStrokeColor?: number;
                rangeLineStrokeWeight?: number;
                roll?: number;
                strokeColor?: number;
                strokeWeight?: number;
                type?: string;
                version?: string;
                vfov?: number;
            };
            shape?: { ellipse?: { angle: number; major: number; minor: number } };
            slope?: number;
            speed?: number;
            stale: string;
            start: string;
            status?: { battery?: string; readiness?: string };
            stroke?: string;
            "stroke-opacity"?: number;
            "stroke-style"?: string;
            "stroke-width"?: number;
            takv?: {
                device?: string;
                os?: string;
                platform?: string;
                version?: string;
            };
            time: string;
            track?: {
                course?: string;
                eCourse?: string;
                eSlope?: string;
                eSpeed?: string;
                slope?: string;
                speed?: string;
            };
            type: string;
            video?: {
                connection?: {
                    address: string;
                    alias?: string;
                    bufferTime?: number;
                    ignoreEmbeddedKLV?: boolean;
                    networkTimeout?: number;
                    path?: string;
                    port?: number;
                    protocol?: string;
                    roverPort?: number;
                    rtspReliable?: number;
                    uid: string;
                };
                sensor?: string;
                spi?: string;
                uid?: string;
                url?: string;
            };
        };
        type: string;
    }

  • Return an ATAK Compliant Protobuf

    Parameters

    • version: number = 1

    Returns Uint8Array

  • Returns or sets the UID of the CoT

    Parameters

    • Optionaluid: string

    Returns string

  • Return an CoT Message given a GeoJSON Feature

    Parameters

    • feature: {
          geometry:
              | { coordinates: number[][][]; type: "Polygon" }
              | { coordinates: number[]; type: "Point" }
              | { coordinates: number[][]; type: "LineString" };
          id?: string;
          path?: string;
          properties: {
              ackrequest?: { ackrequested: boolean; tag: string; uid: string };
              archived?: boolean;
              attachments?: string[];
              callsign?: string;
              center?: number[];
              chat?: {
                  chatgrp: any;
                  chatroom: string;
                  groupOwner?: string;
                  id: string;
                  messageId?: string;
                  parent?: string;
                  senderCallsign: string;
              };
              contact?: {
                  callsign?: string;
                  endpoint?: string;
                  name?: string;
                  phone?: string;
              };
              course?: number;
              dest?: | {
                  after?: string;
                  callsign?: string;
                  mission?: string;
                  "mission-guid"?: string;
                  path?: string;
                  uid?: string;
              }
              | {
                  after?: string;
                  callsign?: string;
                  mission?: string;
                  "mission-guid"?: string;
                  path?: string;
                  uid?: string;
              }[];
              droid?: string;
              fileshare?: {
                  filename: string;
                  name: string;
                  senderCallsign: string;
                  senderUid: string;
                  senderUrl: string;
                  sha256: string;
                  sizeInBytes: number;
              };
              fill?: string;
              "fill-opacity"?: number;
              flow?: { [key: string]: string };
              geofence?: {
                  boundingSphere?: number;
                  elevationMonitored?: string;
                  maxElevation?: string;
                  minElevation?: string;
                  monitor?: string;
                  tracking?: string;
                  trigger?: string;
              };
              group?: { name: string; role: string };
              how?: string;
              icon?: string;
              links?: {
                  mime?: string;
                  parent_callsign?: string;
                  point?: string;
                  production_time?: string;
                  relation?: string;
                  remarks?: string;
                  type?: string;
                  uid?: string;
                  url?: string;
              }[];
              "marker-color"?: string;
              "marker-opacity"?: number;
              metadata?: { [key: string]: unknown };
              mission?: {
                  authorUid?: string;
                  guid?: string;
                  missionChanges?: {
                      contentUid: string;
                      creatorUid: string;
                      details: {
                          callsign: string;
                          color: string;
                          lat: string;
                          lon: string;
                          type: string;
                      };
                      isFederatedChange: string;
                      missionName: string;
                      timestamp: string;
                      type: string;
                  }[];
                  missionLayer?: {
                      name?: string;
                      parentUid?: string;
                      type?: string;
                      uid?: string;
                  };
                  name?: string;
                  tool?: string;
                  type?: string;
              };
              precisionlocation?: { altsrc?: string; geopointsrc?: string };
              remarks?: string;
              sensor?: {
                  azimuth?: number;
                  displayMagneticReference?: number;
                  elevation?: number;
                  fov?: number;
                  fovAlpha?: number;
                  fovBlue?: number;
                  fovGreen?: number;
                  fovRed?: number;
                  hideFov?: boolean;
                  model?: string;
                  north?: number;
                  range?: number;
                  rangeLines?: number;
                  rangeLineStrokeColor?: number;
                  rangeLineStrokeWeight?: number;
                  roll?: number;
                  strokeColor?: number;
                  strokeWeight?: number;
                  type?: string;
                  version?: string;
                  vfov?: number;
              };
              shape?: { ellipse?: { angle: number; major: number; minor: number } };
              slope?: number;
              speed?: number;
              stale?: string | number;
              start?: string;
              status?: { battery?: string; readiness?: string };
              stroke?: string;
              "stroke-opacity"?: number;
              "stroke-style"?: string;
              "stroke-width"?: number;
              takv?: {
                  device?: string;
                  os?: string;
                  platform?: string;
                  version?: string;
              };
              time?: string;
              track?: {
                  course?: string;
                  eCourse?: string;
                  eSlope?: string;
                  eSpeed?: string;
                  slope?: string;
                  speed?: string;
              };
              type?: string;
              video?: {
                  connection?: {
                      address: string;
                      alias?: string;
                      bufferTime?: number;
                      ignoreEmbeddedKLV?: boolean;
                      networkTimeout?: number;
                      path?: string;
                      port?: number;
                      protocol?: string;
                      roverPort?: number;
                      rtspReliable?: number;
                      uid: string;
                  };
                  sensor?: string;
                  spi?: string;
                  uid?: string;
                  url?: string;
              };
          };
          type: string;
      }

      GeoJSON Point Feature

    Returns default