Skip to content

Commit

Permalink
Add Chat parsing in GeoJSON
Browse files Browse the repository at this point in the history
  • Loading branch information
ingalls committed Jan 23, 2024
1 parent 098b347 commit a97a8db
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
7 changes: 7 additions & 0 deletions lib/cot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,13 @@ export default class CoT {
feat.properties.remarks = raw.event.detail.remarks._text;
}

if (raw.event.detail.__chat) {
feat.properties.chat = {
...raw.event.detail.__chat._attributes,
chatgrp: raw.event.detail.__chat.chatgrp
}
}

if (raw.event.detail.track && raw.event.detail.track._attributes) {
if (raw.event.detail.track._attributes.course) feat.properties.course = Number(raw.event.detail.track._attributes.course);
if (raw.event.detail.track._attributes.course) feat.properties.speed = Number(raw.event.detail.track._attributes.speed);
Expand Down
3 changes: 0 additions & 3 deletions lib/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,6 @@
"type": "object"
}
},
"required": [
"_attributes"
],
"type": "object"
},
"Point": {
Expand Down
2 changes: 1 addition & 1 deletion lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export interface FlowTags {
}

export interface Group {
_attributes: {
_attributes?: {
name: string;
role: string;
[k: string]: string;
Expand Down

0 comments on commit a97a8db

Please sign in to comment.