@@ -4,6 +4,7 @@ import type {
44 Feature ,
55 Polygon ,
66 FeaturePropertyMission ,
7+ FeaturePropertyMissionChange ,
78 FeaturePropertyMissionLayer ,
89} from '../types/feature.js' ;
910import type {
@@ -219,20 +220,40 @@ export async function to_geojson(cot: CoT): Promise<Static<typeof Feature>> {
219220
220221 mission . missionChanges = [ ]
221222 for ( const change of changes ) {
222- mission . missionChanges . push ( {
223- contentUid : change . MissionChange . contentUid . _text ,
223+ const mc : Static < typeof FeaturePropertyMissionChange > = {
224+ contentUid : change . MissionChange . contentUid ? change . MissionChange . contentUid . _text : undefined ,
224225 creatorUid : change . MissionChange . creatorUid . _text ,
225226 isFederatedChange : change . MissionChange . isFederatedChange . _text ,
226227 missionName : change . MissionChange . missionName . _text ,
227228 timestamp : change . MissionChange . timestamp . _text ,
228229 type : change . MissionChange . type . _text ,
229- details : {
230+ } ;
231+
232+ if ( change . MissionChange . contentResource ) {
233+ const cr = change . MissionChange . contentResource ;
234+ mc . contentResource = {
235+ expiration : cr . expiration . _text ,
236+ filename : cr . filename . _text ,
237+ hash : cr . hash . _text ,
238+ name : cr . name . _text ,
239+ size : parseInt ( cr . size . _text ) ,
240+ submissionTime : cr . submissionTime . _text ,
241+ submitter : cr . submitter . _text ,
242+ tool : cr . tool . _text ,
243+ uid : cr . uid . _text ,
244+ } ;
245+ }
246+
247+ if ( change . MissionChange . details ) {
248+ mc . details = {
230249 ...change . MissionChange . details . _attributes ,
231250 ...change . MissionChange . details . location
232251 ? change . MissionChange . details . location . _attributes
233252 : { }
234- }
235- } )
253+ } ;
254+ }
255+
256+ mission . missionChanges . push ( mc )
236257 }
237258 }
238259
0 commit comments