Wayline Management Sample
Sample Introduction
Wayline management is an essential function for automatic aircraft operations. Through the interfaces provided by the MSDK, functions like uploading, executing, pausing, resuming, and monitoring the execution status and information of wayline missions can be achieved. A wayline file can define the waylines, waypoints, and waypoint missions. This file follows the DJI's custom Waypoint Markup Language(DJI WPML).
DJI WPML
The WPML wayline files, referred to as KMZ files, all have the ".kmz" extension, and they are essentially archive files packaged using the ZIP format. After the decompression of a standard KMZ file, its file structure is displayed as follows. The "template.kml" defines business attributes, enabling users to quickly adjust and edit. The "waylines.wpml" defines execution details. The "res" folder stores auxiliary resource files. The name of the KMZ compressed package can be customized. The package name corresponds to the wayline name, and the internal folders, KML file, and WPML file names must match the display shown below.
waypoints_name.kmz
└── wpmz
├── res //resource file
├── template.kml //template file
└── waylines.wpml //execution file
The field introduction logic of DJI Waypoint Markup Language:
- only used in template.kml
- only used in waylines.wpml
- both used in template.kml and waylines.wpml
Wayline Editor
Through an independent library called the WPMZ SDK, it offers functionalities such as editing, importing, and exporting KMZ files, static field checks before KMZ uploads, and KML to KMZ conversion. The related interface introduction of wayline editor can be obtained from IWPMZManager in the MSDK API Reference.
Wayline editor related interfaces are introduced in the following figure.
KMZ generation interface
generateKMZFile()
: The generated KMZ varies based on the parameters passed to the interface. When the edited template object is passed, the generated KMZ will include a valid "template.kml" file and a valid "waylines.wpml" file. When the edited waylines object is passed, the generated KMZ will include an invalid "template.kml" file and a valid "waylines.wpml" file, and this KMZ can not be edited by DJI Pilot.The static field checks of KMZ does not encompass all the fields in "wayline.kml". We will gradually add these checks in upcoming versions.
KML to KMZ conversion interface
transKMLtoKMZ()
: When converting KML files generated from non-DJI sources to KMZ, a height mode must be provided. The supported height modes are WGS84, EGM96, and RELATIVE. The RELATIVE mode is solely for DJI Pilot display and can be ignored.

Interface Calling Process
The invocation process of MSDK wayline management API is shown in the following figure. For detailed usage, please check the related information of IWaypointMissionManager class from API documentation of Mobile SDK.
- MSDK supports starting and resuming wayline missions from breakpoints.
- Resuming flight from breakpoint is supported on Matrice 30/30T, Mavic 3E/3T/3M aircraft models.
- The retrieval of breakpoint information is possible only after invoking the pause mission interface
pauseMission()
. - MSDK enables the querying of breakpoint information, which can be used as parameters for the mission start interface startMission() and the mission resume interface resumeMission(). Developers can also choose to skip querying breakpoint information and manually create a BreakPointInfo object to specify breakpoints for parameter passing.
