Skip to content

WPML KMZ export

ARGUS ships a frontend WPMZ KMZ generator (kmz-generator.ts) that produces a .kmz blob in DJI’s Wayline Production File v1.0.3 format. The same generator is used for both manual export from the planner and automatic upload during dock dispatch.

File layout

A generated KMZ is a deflate-compressed ZIP containing:

  • wpmz/template.kml — KML template with mission metadata and waypoint defaults (from buildTemplateKml).
  • wpmz/waylines.wpml — execution-ready WPML with the full waypoint list and per- point overrides (from buildWaylinesWpml).
  • res/ — optional embedded resources. ARGUS does not emit anything here; the folder is reserved for aircraft-resource payloads.

Both files declare the KML (http://www.opengis.net/kml/2.2) and WPML (http://www.dji.com/wpmz/1.0.3) namespaces. The blob MIME type is application/vnd.google-earth.kmz.

Manual export

Planner → Export → WPML KMZ. The download is produced in-browser via generateKmz(mission, options). Use it to:

  • Load the mission into DJI Pilot 2 on a smart RC.
  • Archive for audit / regulatory.
  • Hand off to partners flying their own DJI hardware.

Automatic export on DJI dispatch

DjiMissionDispatcherService.dispatchToDock runs:

  1. generateKmz(mission, options) — produces the blob.
  2. Request a presigned URL from the Cloud API; PUT the blob to S3 with Content-Type: application/vnd.google-earth.kmz.
  3. Call registerWayline to register the object key with DJI Cloud and receive a djiWaylineId.
  4. Create a flight task (taskType: 1 = wayline) referencing the S3 key.
  5. Call prepareTask; the dock handles the rest via MQTT.

Fields emitted

Mission-level (from buildMissionConfigXml)

  • <wpml:flyToWaylineMode>safely</...>
  • <wpml:finishAction>goHome / autoLand / gotoFirstWaypoint / noAction.
  • <wpml:exitOnRCLost>executeLostAction (default) / exitImmediately.
  • <wpml:executeRCLostAction>goBack (default) / hover / land.
  • <wpml:takeOffSecurityHeight> — only when takeoffSecurityHeight is set.
  • <wpml:globalRTHHeight> — only when rthAltitude is set.
  • <wpml:globalTransitionalSpeed>.
  • <wpml:droneInfo> / <wpml:payloadInfo> — drone + payload enums.

Template globals (from buildTemplateKml)

  • <wpml:autoFlightSpeed> — mission speedMps.
  • <wpml:globalHeight> — mission altitudeM.
  • <wpml:heightMode>relativeToStartPoint / WGS84 / EGM96 / aboveGroundLevel.
  • <wpml:gimbalPitchMode>usePointSetting</...>.
  • <wpml:waypointHeadingMode> — one of the five values (followWayline, fixed, manually, towardPOI, smoothTransition).
  • <wpml:waypointTurnMode> — default toPointAndStopWithDiscontinuityCurvature, spec-compliant for stop-at-waypoint.
  • <wpml:waypointTurnDampingDist> (0.2–1000 m).

Per-waypoint (from buildPlacemarks)

  • <wpml:executeHeight> — the waypoint altitude.
  • <wpml:waypointSpeed> — if the waypoint overrides speed.
  • <wpml:useGlobalHeight>0</> + <wpml:executeHeightMode> — if the waypoint overrides the height frame.
  • <wpml:waypointHeadingParam> — per-point heading mode + angle + POI.
  • <wpml:waypointTurnParam> — per-point turn mode + damping.
  • <wpml:gimbalPitchAngle>.
  • <wpml:actionGroup> with one <wpml:actionTrigger> (reachPoint / betweenAdjacentPoints / multipleTiming) and an ordered list of <wpml:action> entries — takePhoto, startRecord, stopRecord, hover, gimbalRotate, rotateYaw, focus, zoom, customDirName.

Camera actions (from buildCameraSettingsXml)

Per-spec the generator only emits the three legal children of takePhoto / startRecord actionActuatorFuncParam:

  • <wpml:fileSuffix> — always emitted (required).
  • <wpml:payloadLensIndex> — comma list of enabled lenses (default wide,zoom).
  • <wpml:useGlobalPayloadLensIndex>1 = use mission-level lens set, 0 = override from this action.

Other camera fields on DroneCameraSettings (focus, metering, exposure, ISO, aperture, shutter, dewarp) are not emitted to WPML — firmware ≥ 1.6 rejects unknown elements inside actionActuatorFuncParam. Those settings are applied via live MQTT camera-control commands instead.

Known limitations

  • Mapping 3D corridors. The mapping pattern with mappingCaptureMode: 'both' emits a nadir + oblique compound but does not yet emit the spec-only <wpml:mappingStrip> element. Strip corridors are still flyable via the generic waypoint path, but without the aircraft-side mapping optimisations DJI ships for that element.
  • Intelligent modes. Spotlight, smart-follow, panorama and POI-track are controlled at flight time via DRC (drone-remote-control) MQTT messages, not baked into the KMZ.
  • Aircraft defaults. Generator defaults target the Mavic 3D family (droneEnumValue: 77). Pass droneEnumType in KmzGenOptions for other aircraft.