NiVO / BY TECHNOGISGermany · Indonesia
Trajectory exchange review

KML gx:Track: Preserve Time and Coordinate Slots in a Drone Review

Audit paired when and gx:coord elements without dropping empty position slots or mistaking an interpolated review track for recorded drone observations.

KML gx:Track: Preserve Time and Coordinate Slots in a Drone Review

Define what the moving track is meant to show

A moving symbol in a KML review can make a trajectory feel more complete than its underlying records. Before using that display in a NiVO drone-data discussion, identify the time and position association that the file actually carries. This tutorial examines the parallel slots inside one gx:Track element. It focuses on an easy conversion mistake: removing an empty coordinate before associating positions with times. The result can retain plausible numbers while attaching them to the wrong moments. The example is a constructed XML fragment, not a flight record or evidence about a particular NiVO exporter.

Start with the accepted file revision and a clear review purpose. Is the recipient viewing a route for context, inspecting a recorded trajectory, or comparing locations with separate image events? Keep those purposes distinct. Record the producer, any intermediate conversion and the intended viewer before drawing conclusions from the animation. A useful inspection begins with the source relationships, rather than with a screenshot of a smooth path. Retain the original file and place any extracted report beside a separately identified working copy, so a later reviewer can reproduce the same association without changing the evidence.

Read parallel arrays and empty positions explicitly

The Google KML reference describes gx:Track time and coordinate elements as equal-length arrays. Their corresponding positions matter. It also permits an empty coordinate element to represent missing data and describes interpolation for sparse values. A missing position slot is therefore different from an omitted element that makes the array lengths disagree. Review both situations explicitly. Do not describe an empty coordinate as a measured zero location, and do not repair an unequal count by silently discarding whichever extra entry happens to remain at the end of an export.

This matters when a conversion first builds a list of usable coordinates and then combines that shorter list with the original times. In a constructed three-slot example, the second coordinate is empty and the third is present. Filtering the empty coordinate first would move the third position next to the second time. Instead, preserve all three slot numbers and carry the missing value as a finding. The distinction can be checked without calculating distance, speed or a replacement position. It gives the recipient a precise question to resolve with the producing workflow rather than an apparently complete but altered trajectory.

NiVO VTOL V7 with a white fuselage, lift rotors, and yellow wing tips
NiVO VTOL V7 with a white fuselage, lift rotors, and yellow wing tips.Source: NiVO / TechnoGIS catalogue materials supplied by the site owner · Catalogue photo
Product context only; this photograph does not depict the constructed examples in this article.

Inspect a trusted teaching fragment with namespace-aware code

The Python example below accepts one already selected track element. It uses expanded namespace names, because ElementTree identifies XML elements by namespace URI and local name rather than by a particular written prefix. It reads direct child time and coordinate elements, compares their counts and preserves the coordinate text or a missing marker at each index. The small profile requires at least one nonempty time and rejects missing time text. It does not validate date syntax, coordinate numbers, optional angle arrays, extended attributes or the complete KML schema. Use it as a slot inventory, not a universal KML validator.

Run this literal fragment to see three returned entries, with slot two retaining a null coordinate marker. The function does not write a file, contact a viewer, interpolate positions or connect to an aircraft. Its source is deliberately small and trusted; handling an arbitrary external XML delivery requires the receiving application and appropriate parsing controls. For a real review, select the intended track through its document context and retain the parent placemark identity. Applying the function independently to every track is different from concatenating all time and coordinate descendants across an entire document.

import xml.etree.ElementTree as ET

KML = "{http://www.opengis.net/kml/2.2}"
GX = "{http://www.google.com/kml/ext/2.2}"

def inspect_track_slots(track):
    if track.tag != GX + "Track":
        raise ValueError("expected one gx:Track element")
    times = [(e.text or "").strip() for e in track.findall(KML + "when")]
    coords = [(e.text or "").strip() for e in track.findall(GX + "coord")]
    if len(times) != len(coords):
        raise ValueError("time and coordinate slot counts differ")
    if not times or any(not value for value in times):
        raise ValueError("this profile requires nonempty time text")
    return [{"slot": i + 1, "whenText": times[i],
             "coordinateText": coords[i] or None}
            for i in range(len(times))]

# Trusted constructed fragment only; no actual flight data.
track = ET.fromstring('''<gx:Track
 xmlns="http://www.opengis.net/kml/2.2"
 xmlns:gx="http://www.google.com/kml/ext/2.2">
 <when>2026-11-23T01:00:00Z</when>
 <when>2026-11-23T01:00:01Z</when>
 <when>2026-11-23T01:00:02Z</when>
 <gx:coord>110 -7 100</gx:coord>
 <gx:coord/>
 <gx:coord>110.001 -7.001 101</gx:coord>
</gx:Track>''')
print(inspect_track_slots(track))

Keep structural findings separate from time and location quality

Equal array lengths answer an association question, not every question about the contents. A timestamp can be repeated, out of order or expressed with a reference that needs clarification. Coordinate text can have the wrong syntax or a height whose meaning is unknown. Keep those checks separate so that a successful count is not reported as a complete trajectory assessment. Where the task requires temporal ordering, preserve the original sequence before producing a derived sorted view. Sorting one array independently would destroy the relationship that the slot review was meant to protect.

Optional values need the same care in a complete conversion. The KML reference describes angle arrays and custom track data, but this recipe intentionally returns only time text and coordinate text. Report that scope rather than claiming that every associated attribute was validated. Keep source slot numbers in any exported table, including rows with missing positions. A downstream spatial layer can then have a documented inclusion rule while an accompanying inventory retains the complete record sequence. The inventory and the displayed layer serve different purposes and should remain traceable to the same accepted track.

Review interpolation as display behavior with the recipient

An animated object can pass through a location that was not supplied as an explicit coordinate at that time. Ask the receiving viewer how it handles sparse track values and confirm the interpretation on the actual delivery. A report should distinguish recorded entries from positions calculated for display. This tutorial does not run Google Earth or certify another viewer. Its concrete contribution is preserving the missing slot, so later software behavior can be evaluated against the source instead of against a silently shortened table. The context photograph shows a NiVO product, not the constructed trajectory.

If the delivery contains several tracks, retain their identities and review any deliberate joining as a separate conversion decision. Do not infer the cause of a gap from its shape alone. Obtain the producer explanation and relevant recording history when the interpretation matters. A route overview may tolerate an explicitly described interpolation, while a comparison with camera events may require different evidence. Decide that requirement with the receiving task in view. Avoid filling a missing coordinate merely because a line between its neighbors looks reasonable at the chosen map scale.

Hand over the association report with its limits

A useful report identifies the file revision, placemark and track, namespace-aware selection, time-slot count, coordinate-slot count and missing-coordinate positions. Include the extraction method and any exceptions rather than replacing a failed inspection with an empty table. Keep the raw time and coordinate text available alongside any later parsed values. This allows another reviewer to distinguish a source omission from a conversion error. If a corrected export arrives, treat it as a new revision and repeat the association review rather than overwriting the original evidence.

For a NiVO mapping handoff, this produces a small but practical improvement: every displayed or exported trajectory row has a defensible relationship to its source slot. The recipient can see which positions were supplied and which require further interpretation. The result complements altitude-mode and segment-boundary reviews without substituting for either. Preserve the original association first, document any derived representation second, and support the intended analytical use with its own checks. A balanced array is a starting point for that work, not proof that an animated path records every movement of an aircraft.

Technical references

  1. Google KML reference: gx:Track arrays and sparse values ↗
  2. Python ElementTree: namespace-aware element selection ↗
← All articles

Related articles

All articles ↗
LET’S TAKE FLIGHT

Your next mission
starts with a conversation.

Talk to our team