12.23.0 • Published 2 months ago

@tak-ps/node-cot v12.23.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

Lightweight Typescript library for parsing and manipulating TAK related messages, primarily Cursor-on-Target (COT)

About

node-cot converts between TAK message protocols (XML & Protobuf) and a Javascript object/JSON format. It also can bidirectionally convert CoT messages into GeoJSON

It also support creating and parsing the following TAK Data Types

  • Data Packages (CoTs, Attachments, etc)
  • Basemap XML Documents

Installation

NPM

To install node-cot with npm run

npm install @tak-ps/node-cot

Usage Examples

Cursor-On-Target

import CoT from '@tak-ps/node-cot';

const cot = new CoT(`
    <event version="2.0" uid="ANDROID-deadbeef" type="a-f-G-U-C" how="m-g" time="2021-02-27T20:32:24.771Z" start="2021-02-27T20:32:24.771Z" stale="2021-02-27T20:38:39.771Z">
        <point lat="1.234567" lon="-3.141592" hae="-25.7" ce="9.9" le="9999999.0"/>
    </event>
`);


// Export Formats
cot.to_geojson();   // Output GeoJSON Representation
cot.to_xml();       // Output String XML Representation

cot.raw; // JSON XML Representation

Debugging

If the Environment Variable DEBUG_COTS is truthy ie:

export DEBUG_COTS=1

Then the raw JSONified XML will be printed on each constructor invocation.

CoT Spec

The CoT Spec is very informally developed by rough internal concensus of large TAK Clients within the TPC (TAK Product Center). The following is a current understanding of the spec primarily developed through reverse engineering TAK clients

<event version uid type how time start stale/>

Event Attributes

NameDescriptionExample
versionCoT Version, currently 2.0version="2.0"
uidGlobally unique name for this information on this eventuid="any-unique-string-123"
typeHierarchically organized hint about event type`type="a-f-G-E"'
howGives a hint about how the coordinates were generatedhow=""
timeThe time at which the event was generatedtime="2023-07-18T15:25:09.00Z"
startThe time at which the event starts or is relevantstart="2023-07-18T15:25:09.00Z"
staleThe time at which the event ends or is not relevantstale="2023-07-18T15:25:09.00Z"

CoT GeoJSON Spec

One of the primary use-cases of this library is to make serialization and deserialiation from more commmon geospatial formats a breeze. This section will walk through CoT options that are exposed via the from_geojson() function.

Supported Geometries

  • All Input Geometries must be a GeoJSON Feature type
  • Point, Polygon, and LineString are all supported
  • Multi Geometries are not supported and must be cast to their non-multi type before being passed to the library
  • Centroids are calulated using a PointOnSurface algorithm

Supported Properties

The following are the most important/relevant properties

PropertyDescription
.idUsed as the CoT uid - If omitted a UUID is generated
.properties.typeCoT type - note this will be overridden if geometry is not a Point
.properties.howCoT how
.properties.timeTime at which CoT was created
.properties.startTime at which CoT is relevant
.properties.staleTime at which CoT expires
.properties.callsignDisplayed callsign (basically the name of the feature)
.properties.speedSpeed in m/s of the object
.properties.courseCourse in degrees from north of the object
.properties.remarksHuman readable remarks field

Styles can also be applied to features using the following

PropertyDescription
.properties.marker-colorPoint
.properties.marker-opacityPoint
.properties.strokePolygon/LineString
.properties.stroke-opacityPolygon/LineString: Int from 0-256
.properties.stroke-widthPolygon/LineString
.properties.stroke-stylePolygon/LineString
.properties.stroke-stylePolygon/LineString
.properties.fillPolygon
.properties.fill-opacityPolygon: Int from 0-256

These are less common properties that can be used:

PropertyDescription
.properties.iconString: Custom Icon Path (string)
.properties.archivedBoolean: TAK Clients will ignore the stale value and retain the feature
.properties.destMarti API Instructions for sending CoTs to a specific location
.properties.filesharePush Data Packages via CoT

Known Special CoT Types

CoT TypeNotes
u-d-fLineString or Polygon
u-d-r4 Cornered Rectangle
u-d-pPoint
CoT TypeNotes
t-x-c-tTAK Server Ping Request
t-x-c-t-rTAK Server Pong Response
CoT TypeNotes
b-aAlert
b-a-o-tbl911 Alert
b-a-o-canCancel Alert
b-a-gGeoFence Breach
b-a-o-panRingTheBell
b-a-o-opnTroopsInContact
b-r-f-h-cCasevac
CoT TypeNotes
b-t-fChat
b-t-f-dChat delivery receipt
b-t-f-rChat read receipt
b-t-f-pChat pending receipt
b-t-f-sChat delivery failure
CoT TypeNotes
t-x-mMission
t-x-m-nMission Created
t-x-m-dMission Deleted
t-x-m-iMission Invite Notification
t-x-m-cMission Change
t-x-m-c-hMission Change: Layer
t-x-m-c-lMission Change: Log
t-x-m-c-eMission Change: External
t-x-m-c-mMission Change: Metadata
t-x-m-c-kMission Change: Keywords
CoT TypeNotes
b-i-vBits/Imagery/Video
b-i-r-rRemote Resource
b-f-t-rFile Transfer Request
b-i-x-iQuickPic
b-m-rRoute
b-m-p-cRoute Control Point
b-m-p-wRoute Way Point
12.21.0

3 months ago

12.22.0

2 months ago

12.23.0

2 months ago

12.20.0

3 months ago

12.18.0

4 months ago

12.19.0

4 months ago

12.14.0

6 months ago

12.15.0

6 months ago

12.16.1

6 months ago

12.16.0

6 months ago

12.16.2

5 months ago

12.12.0

6 months ago

12.17.0

5 months ago

12.17.1

4 months ago

12.13.0

6 months ago

12.11.0

6 months ago

12.8.0

6 months ago

12.10.0

6 months ago

12.7.1

7 months ago

12.7.0

7 months ago

12.6.0

7 months ago

12.4.0

7 months ago

12.5.2

7 months ago

12.5.0

7 months ago

12.5.1

7 months ago

9.8.0

10 months ago

10.8.0

9 months ago

9.4.0

10 months ago

10.0.0

10 months ago

10.4.0

9 months ago

8.1.0

11 months ago

12.0.0

8 months ago

10.11.0

9 months ago

11.2.0

8 months ago

9.9.0

10 months ago

10.7.0

9 months ago

9.5.0

10 months ago

10.3.0

10 months ago

12.3.0

8 months ago

8.2.0

11 months ago

10.12.2

9 months ago

10.12.0

9 months ago

10.12.1

9 months ago

9.0.0

11 months ago

11.1.0

9 months ago

10.6.0

9 months ago

10.6.1

9 months ago

10.6.2

9 months ago

9.6.0

10 months ago

10.2.0

10 months ago

8.4.0

11 months ago

9.10.0

10 months ago

8.3.0

11 months ago

12.2.0

8 months ago

9.1.0

11 months ago

11.0.0

9 months ago

10.5.0

9 months ago

9.7.0

10 months ago

10.9.0

9 months ago

10.9.1

9 months ago

10.9.2

9 months ago

10.9.3

9 months ago

9.3.0

11 months ago

10.1.0

10 months ago

8.5.0

11 months ago

8.5.2

11 months ago

8.5.1

11 months ago

10.9.4

9 months ago

10.9.5

9 months ago

8.0.1

11 months ago

8.0.0

11 months ago

12.1.0

8 months ago

9.2.0

11 months ago

7.1.0

12 months ago

7.2.3

12 months ago

7.2.2

12 months ago

7.2.1

12 months ago

7.2.0

12 months ago

7.0.0

12 months ago

7.0.1

12 months ago

6.11.0

1 year ago

6.10.0

1 year ago

6.8.0

1 year ago

6.9.0

1 year ago

6.9.1

1 year ago

6.6.0

1 year ago

6.7.0

1 year ago

6.5.0

1 year ago

6.4.0

1 year ago

6.3.3

1 year ago

6.2.1

1 year ago

6.2.0

1 year ago

6.2.2

1 year ago

6.1.0

1 year ago

6.0.0

1 year ago

5.5.1

1 year ago

5.5.0

1 year ago

5.6.1

1 year ago

5.6.0

1 year ago

5.4.0

1 year ago

5.7.1

1 year ago

5.3.1

1 year ago

5.3.0

1 year ago

5.1.1

1 year ago

5.1.0

1 year ago

5.0.6

1 year ago

5.0.5

1 year ago

5.0.3

1 year ago

5.0.2

1 year ago

5.0.1

1 year ago

5.0.0

1 year ago

4.6.0

1 year ago

4.5.1

1 year ago

4.5.0

1 year ago

4.4.1

1 year ago

4.4.0

1 year ago

4.4.2

1 year ago

3.5.4

2 years ago

3.5.3

2 years ago

4.1.0

2 years ago

4.0.0

2 years ago

4.3.0

2 years ago

4.2.1

2 years ago

4.1.2

2 years ago

4.2.0

2 years ago

4.1.1

2 years ago

3.5.2

2 years ago

3.5.1

2 years ago

3.5.0

2 years ago

3.4.0

2 years ago

3.4.3

2 years ago

3.4.2

2 years ago

3.4.1

2 years ago

3.3.0

2 years ago

3.2.0

2 years ago

3.1.1

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.3.0

2 years ago

2.2.1

2 years ago

2.2.0

2 years ago

2.5.0

2 years ago

2.4.0

2 years ago

2.7.0

2 years ago

2.6.0

2 years ago

2.8.1

2 years ago

2.8.0

2 years ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.0

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago