Template.kml
template.kml Introduction
The template.kml
file consists of three parts:
- Creation information: It mainly contains the information of the route file itself, such as the creation and update time of the file.
- Mission information: mainly includes the
wpml:missionConfig
element, which defines the global parameters of the route mission, etc. - Template information: It mainly contains the
Folder
element, which defines the template information of the route (such as waypoint flight, map-building aerial photography, oblique photography, and flight with flight path, etc.). Different route template types contain different elements.
The example file of template.kml
is as follows (take the waypoint flight template as an example):
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:wpml="http://www.dji.com/wpmz/1.0.0">
<Document>
<!-- Step 1: Implement File Creation Information -->
<wpml:author>Name</wpml:author>
<wpml:createTime>1637600807044</wpml:createTime>
<wpml:updateTime>1637600875837</wpml:updateTime>
<!-- Step 2: Setup Mission Configuration -->
<wpml:missionConfig>
<wpml:flyToWaylineMode>safely</wpml:flyToWaylineMode>
<wpml:finishAction>goHome</wpml:finishAction>
<wpml:exitOnRCLost>goContinue</wpml:exitOnRCLost>
<wpml:takeOffSecurityHeight>20</wpml:takeOffSecurityHeight>
<wpml:globalTransitionalSpeed>10</wpml:globalTransitionalSpeed>
<wpml:droneInfo>
<!-- Declare drone model with M30 -->
<wpml:droneEnumValue>67</wpml:droneEnumValue>
<wpml:droneSubEnumValue>0</wpml:droneSubEnumValue>
</wpml:droneInfo>
<wpml:payloadInfo>
<!-- Declare payload model with M30 -->
<wpml:payloadEnumValue>52</wpml:payloadEnumValue>
<wpml:payloadSubEnumValue>0</wpml:payloadSubEnumValue>
<wpml:payloadPositionIndex>0</wpml:payloadPositionIndex>
</wpml:payloadInfo>
</wpml:missionConfig>
<!-- Step 3: Setup A Folder for Waypoint Template -->
<Folder>
<wpml:templateType>waypoint</wpml:templateType>
<wpml:useGlobalTransitionalSpeed>0</wpml:useGlobalTransitionalSpeed>
<wpml:templateId>0</wpml:templateId>
<wpml:waylineCoordinateSysParam>
<wpml:coordinateMode>WGS84</wpml:coordinateMode>
<wpml:heightMode>EGM96</wpml:heightMode>
<wpml:ellipsoidHeight>100</wpml:ellipsoidHeight>
<wpml:height>100</wpml:height>
<wpml:positioningType>GPS</wpml:positioningType>
</wpml:waylineCoordinateSysParam>
<wpml:autoFlightSpeed>7</wpml:autoFlightSpeed>
<wpml:transitionalSpeed>7</wpml:transitionalSpeed>
<wpml:gimbalPitchMode>usePointSetting</wpml:gimbalPitchMode>
<wpml:globalWaypointHeadingParam>
<wpml:waypointHeadingMode>followWayline</wpml:waypointHeadingMode>
</wpml:globalWaypointHeadingParam>
<wpml:globalWaypointTurnMode>toPointAndStopWithDiscontinuityCurvature</wpml:globalWaypointTurnMode>
<Placemark>
<Point>
<!-- Fill longitude and latitude here -->
<coordinates>
longitude,latitude
</coordinates>
</Point>
<wpml:index>0</wpml:index>
<wpml:ellipsoidHeight>90.2</wpml:ellipsoidHeight>
<wpml:height>100</wpml:height>
<wpml:useGlobalHeight>1</wpml:useGlobalHeight>
<wpml:useGlobalSpeed>1</wpml:useGlobalSpeed>
<wpml:useGlobalHeadingParam>1</wpml:useGlobalHeadingParam>
<wpml:useGlobalTurnParam>1</wpml:useGlobalTurnParam>
<wpml:gimbalPitchAngle>0</wpml:gimbalPitchAngle>
</Placemark>
<Placemark>
<Point>
<!-- Fill longitude and latitude here -->
<coordinates>
longitude,latitude
</coordinates>
</Point>
<wpml:index>1</wpml:index>
<wpml:ellipsoidHeight>90.2</wpml:ellipsoidHeight>
<wpml:height>100</wpml:height>
<wpml:useGlobalHeight>1</wpml:useGlobalHeight>
<wpml:useGlobalSpeed>1</wpml:useGlobalSpeed>
<wpml:useGlobalHeadingParam>1</wpml:useGlobalHeadingParam>
<wpml:useGlobalTurnParam>1</wpml:useGlobalTurnParam>
<wpml:gimbalPitchAngle>0</wpml:gimbalPitchAngle>
<!-- Declare action group for waypoint 1# -->
<wpml:actionGroup>
<wpml:actionGroupId>0</wpml:actionGroupId>
<wpml:actionGroupStartIndex>1</wpml:actionGroupStartIndex>
<wpml:actionGroupEndIndex>1</wpml:actionGroupEndIndex>
<wpml:actionGroupMode>sequence</wpml:actionGroupMode>
<wpml:actionTrigger>
<wpml:actionTriggerType>reachPoint</wpml:actionTriggerType>
</wpml:actionTrigger>
<!-- Declare the 1st action: rotate gimbal -->
<wpml:action>
<wpml:actionId>0</wpml:actionId>
<wpml:actionActuatorFunc>gimbalRotate</wpml:actionActuatorFunc>
<wpml:actionActuatorFuncParam>
<wpml:gimbalRotateMode>absoluteAngle</wpml:gimbalRotateMode>
<wpml:gimbalPitchRotateEnable>0</wpml:gimbalPitchRotateEnable>
<wpml:gimbalPitchRotateAngle>0</wpml:gimbalPitchRotateAngle>
<wpml:gimbalRollRotateEnable>0</wpml:gimbalRollRotateEnable>
<wpml:gimbalRollRotateAngle>0</wpml:gimbalRollRotateAngle>
<wpml:gimbalYawRotateEnable>1</wpml:gimbalYawRotateEnable>
<wpml:gimbalYawRotateAngle>30</wpml:gimbalYawRotateAngle>
<wpml:gimbalRotateTimeEnable>0</wpml:gimbalRotateTimeEnable>
<wpml:gimbalRotateTime>0</wpml:gimbalRotateTime>
<wpml:payloadPositionIndex>0</wpml:payloadPositionIndex>
</wpml:actionActuatorFuncParam>
</wpml:action>
<!-- Declare the 2nd action: take photo -->
<wpml:action>
<wpml:actionId>1</wpml:actionId>
<wpml:actionActuatorFunc>takePhoto</wpml:actionActuatorFunc>
<wpml:actionActuatorFuncParam>
<wpml:fileSuffix>point1</wpml:fileSuffix>
<wpml:payloadPositionIndex>0</wpml:payloadPositionIndex>
</wpml:actionActuatorFuncParam>
</wpml:action>
</wpml:actionGroup>
</Placemark>
</Folder>
</Document>
</kml>
Element Description
<Document>
)
Create information (parent element: Element | Description | Type | Unit | Value | Is it required (default) | Product Support |
---|---|---|---|---|---|---|
wpml:author | Author | String | - | - | None, not required | M300RTK, M30 Series |
wpml:createTime | File creation time (Unix Timestamp) | Integer | ms | - | None, not required | M300RTK, M30 Series |
wpml:updateTime | File update time (Unix Timestamp) | Integer | ms | - | None, not required | M300RTK, M30 Series |
<wpml:missionConfig>
)
Mission information (parent element: Element | Description | Type | Unit | Value | Is it required (default) | Product Support |
---|---|---|---|---|---|---|
wpml:flyToWaylineMode | Fly to first waypoint mode | string enumerate | - | safely : The aircraft in safe mode(M300) takes off, ascends to the altitude of the first waypoint, and then flies level to the first waypoint. If the first waypoint is lower than the take-off point, after takeoff, it will level fly to the top of the first waypoint and then descend. (M30) The aircraft takes off, rises to the altitude of the first waypoint, and then flies level to the first waypoint. If the first waypoint is lower than the "safe take-off altitude", after taking off to the "safe take-off altitude", level flight to the first waypoint and then descend. Note that the "safe takeoff altitude" only takes effect when the aircraft is not taking off. pointToPoint : In tilt flight mode(M300), after the aircraft takes off, it tilts to the first waypoint. (M30) The aircraft takes off to the "safe take-off altitude", and then ramps to the first waypoint. If the altitude of the first waypoint is lower than the "safe take-off altitude", it will first level flight and then descend. | Required | M300RTK, M30 Series |
wpml:finishAction | The action when finish mission | string enumerate | - | goHome : After the aircraft completes the route task, exit the route mode and return to home. noAction: After the aircraft completes the route task, it exits the route mode. autoLand : After the aircraft completes the route task, it exits the route mode and lands on the spot. gotoFirstWaypoint : After the aircraft completes the route task, it will immediately fly to the starting point of the route, and exit route mode when it arrives. Note: During the execution of the above actions, if the aircraft exits the route mode and enters the runaway state, the runaway action will be executed first. | Required | M300RTK, M30 Series |
wpml:exitOnRCLost | Whether to continue to execute the route out of control | string enumerate | - | goContinue:继续执行航线 executeLostAction:退出航线,执行失控动作 goContinue : Continue to execute the routeexecuteLostAction : Exit the route and execute the runaway action | Required | M300RTK, M30 Series |
wpml:executeRCLostAction | Type of disconnect action | string enumerate | - | goBack : Go back. The aircraft is flying from the out-of-control position to the take-off pointlanding : landing. The aircraft landed in place from an out-of-control positionhover : hover. The aircraft is hovering from an out-of-control position | goBack | M300RTK, M30 Series |
wpml:takeOffSecurityHeight | Safe takeoff altitude | Float | m | [1.5, 1500] (Altitude mode: relative to takeoff point altitude) Note: After the aircraft takes off, climb to this altitude first, and then fly to the first waypoint according to the setting of "Fly to the first waypoint mode". This element only takes effect when the aircraft is not taking off. | 1.5 | M30 Series |
wpml:globalTransitionalSpeed | Global route transition speed | Float | m/s | > 0 Note: The speed at which the aircraft flies to the first waypoint of each route. When the route mission is interrupted, the speed of the aircraft recovering from the current position to the interruption point. | Required | M300RTK, M30 Series |
wpml:takeOffRefPoint<x,y,z> | reference take-off point | Float | °,°,m | [-90,90],[-180,180],unlimited Note: "Reference Takeoff Point" is only for reference of route planning. When the aircraft executes the route, the actual takeoff point of the aircraft shall prevail, and the height of the ellipsoid shall be used. | None,Not Required | M30 Series |
wpml:takeOffRefPointAGLHeight | The altitude of the reference take-off point | Float | m | Note: The altitude of "reference take-off point" corresponds to the ellipsoid height in "reference take-off point". | None,Not Required | M30 Series |
wpml:droneInfo | Aircraft type information | - | - | - | - | M300RTK, M30 Series |
wpml:payloadInfo | Payload information | - | - | - | - | M300RTK, M30 Series |
<Folder>
)
Template information (parent element: <Folder>
)
Template common elements(parent element:Element | Description | Type | Unit | Value | Is it required (default) | Product Support |
---|---|---|---|---|---|---|
wpml:templateType | Predefined Template Type Note: Templates provide users with a solution for quickly generating routes. The user fills in the template Element, and then imports the DJI support client (such as DJI Pilot) to quickly generate an executable mapping/inspection route. | string enumerate | - | waypoint mapping2d mapping3d mappingStrip | Required | M300RTK, M30 Series |
wpml:templateId | Template ID Note: This ID is unique within a kmz file. It is recommended to start monotonically and continuously increase from 0. In the template.kml and waylines.wpml files, this id will be used to associate the template with the generated executable routes. | Integer | - | [0, 65535] | Required | M300RTK, M30 Series |
wpml:autoFlightSpeed | Global flight speed | Float | m/s | (0, the maximum flight speed] Note: The maximum flight speed of different models is different. This Element defines the target flight speed of the aircraft in the entire route generated by this template. If an additional The Element of the waypoint, the local definition will override the global definition. | Required | M300RTK, M30 Series |
wpml:waylineCoordinateSysParam | Coordinate system parameters | - | - | - | - | M300RTK, M30 Series |
wpml:payloadParam | Payload parameters | - | - | - | - | M300RTK, M30 Series |
<Folder>
)
Waypoint Flight Template Element (Parent Element: Element | Description | Type | Unit | Value | Is it required (default) | Product Support |
---|---|---|---|---|---|---|
wpml:globalWaypointTurnMode | Global Waypoint Type (Global Waypoint Turn Mode) | string enumerate | - | coordinateTurn : Coordinate turn, but point, turn aheadtoPointAndStopWithDiscontinuityCurvature : Fly in a straight line, the aircraft will stop at the pointtoPointAndStopWithContinuityCurvature : curve flight, the aircraft will stop at the pointtoPointAndPassWithContinuityCurvature : Curve flight, the aircraft will stop at the point | Required | M300RTK, M30 Series |
wpml:globalUseStraightLine | Whether the global segment trajectory is as close to a straight line as possible | Boolean | 0: The trajectory of the flight segment is a curve in the whole process 1: The trajectory of the flight segment should be as close as possible to the line connecting the two points | Required Note: Required if and only if "wpml:globalWaypointTurnMode" is set to "toPointAndStopWithContinuityCurvature" or "toPointAndPassWithContinuityCurvature". If the Element of a waypoint is additionally defined, the local definition will override the global definition. | M30 Series | |
wpml:gimbalPitchMode | Gimbal Pitch Control Mode | string enumerate | - | manual : Manual control. When the aircraft is flying from one waypoint to the next, the user can manually control the pitch angle of the gimbal; if there is no user control, the gimbal pitch angle when flying away from the waypoint is maintained. usePointSetting : Set according to each waypoint. When the aircraft flies from one waypoint to the next, the pitch angle of the gimbal transitions evenly to the pitch angle of the next waypoint. | Required | M300RTK, M30 Series |
wpml:ellipsoidHeight | Global route height (ellipsoid height) Note: This Element is used in conjunction with "wpml:height", which are expressions of different elevation reference planes at the same location. | Float | m | - | Required | M300RTK, M30 Series |
wpml:height | Global route height (EGM96 altitude/relative take-off point height/AGL relative ground height) Note: This Element is used in conjunction with "wpml:ellipsoidHeight", which are expressions of different elevation reference planes at the same location. | Float | m | - | Required | M300RTK, M30 Series |
wpml:globalWaypointHeadingParam | Global yaw angle mode parameters | - | - | - | - | M300RTK, M30 Series |
Placemark(Point) | Waypoint information (including waypoint latitude, longitude and altitude, etc.) | - | - | - | - | M300RTK, M30 Series |
<Placemark>
)
Mapping Aerial Template Element (Parent Element: Element | Description | Type | Unit | Value | Is it required (default) | Product Support |
---|---|---|---|---|---|---|
wpml:caliFlightEnable | Whether to enable calibration flight * Note: only applicable to M300RTK and L1 models | Boolean | - | 0: Disable 1: Enable, the inertial navigation calibration is automatically performed on the route to ensure the accuracy of the model. At the end of the route, there will be three acceleration and deceleration flights, and the curve of the route will automatically expand outward for acceleration and deceleration flight. If the route is too long, the acceleration and deceleration will be evenly inserted, and the flight time will not exceed 100s after each calibration. | - | M300RTK |
wpml:elevationOpimizeEnable | Whether to enable elevation optimization | Boolean | - | 0: Disable 1: Enable, the aircraft will fly to the center of the survey area to collect a set of tilted photos after the flight route is completed to optimize the elevation accuracy. | Required | M300RTK, M30 Series |
wpml:smartObliqueEnable | Whether to enable Smart Posing Note: Only applicable to M300RTK and P1 models | Boolean | - | 0: Disabled 1: Enabled, the aircraft can take orthophoto and oblique photos by swinging the gimbal during a single aerial photography task. | - | M300RTK |
wpml:smartObliqueGimbalPitch | Smart Pose Shooting Pitch Angle Note: Only applicable to M300RTK and P1 models. The recommended input range of the P1 model gimbal is [-90, -45]. | Integer | ° | Corresponding model gimbal swivel range | - | M300RTK |
wpml:shootType | Photo mode (timed or fixed distance) | string enumerate | - | time: take photos at equal time distance: take photos at equal intervals Note: It is recommended to use "time" to take photos at equal time. Define "photographing mode", "overlap rate" and "flying speed" in the template.kml file, and write the interval time or interval distance after calculation into wayslines.wpml. | Required | M300RTK, M30 Series |
wpml:direction | route direction | Integer | ° | [0, 360] | Required | M300RTK, M30 Series |
wpml:margin | Expansion distance outside the survey area | Integer | m | - | Required | M300RTK, M30 Series |
wpml:overlap | Overlap rate parameter | - | - | - | - | M300RTK, M30 Series |
wpml:ellipsoidHeight | Global route height (ellipsoid height) Note: This Element is used in conjunction with "wpml:height", which are expressions of different elevation reference planes at the same location. | Float | m | - | Required | M300RTK, M30 Series |
wpml:height | Global route height (EGM96 altitude/relative take-off point height/AGL relative ground height) Note: This Element is used in conjunction with "wpml:ellipsoidHeight", which are expressions of different elevation reference planes at the same location. | Float | m | - | Required | M300RTK, M30 Series |
Polygon | Survey area polygon Note: The format here is " <Polygon> <outerBoundaryIs> <LinearRing> <coordinates> longitude,latitude,0 longitude,latitude,0 longitude,latitude,0 </coordinates> </LinearRing> </outerBoundaryIs> </Polygon> ” | - | - | - | - | M300RTK, M30 Series |
<Placemark>
)
Oblique Photography Template Element (Parent Element: Element | Description | Type | Unit | Value | Is it required (default) | Product Support |
---|---|---|---|---|---|---|
wpml:caliFlightEnable | Whether to enable calibration flight Note: only applicable to M300RTK and L1 models | Boolean | - | 0: Disable 1: Enable, the inertial navigation calibration is automatically performed on the route to ensure the accuracy of the model. At the end of the route, there will be three acceleration and deceleration flights, and the curve of the route will automatically expand outward for acceleration and deceleration flight. If the route is too long, the acceleration and deceleration will be evenly inserted, and the flight time will not exceed 100s after each calibration. | - | M300RTK |
wpml:inclinedGimbalPitch | Gimbal pitch angle (tilt) | Integer | ° | Note: The rotation range of different gimbal is different. The oblique photography template will be generated with five routes, one of which captures orthophoto images and four of which capture oblique images. This Element is used to set the tilt angle of the gimbal during oblique image capture. | Required | M300RTK, M30 Series |
wpml:inclinedFlightSpeed | route flight speed (tilt) | Float | m/s | (0, the maximum flight speed of this aircraft ] Note: The maximum flight speed of different aircraft types is different. The oblique photography template will generate five routes, of which 1 captures orthophoto images and 4 captures oblique images. Element is used to set the flying target speed during oblique image acquisition. | Required | M300RTK, M30 Series |
wpml:shootType | Photo mode (timed or fixed distance) | string enumerate | - | time: take photos at equal time distance: take photos at equal intervals Note: It is recommended to use "time" to take photos at equal time. Define "photographing mode", "overlap rate" and "flying speed" in the template.kml file, and write the interval time or interval distance after calculation into wayslines.wpml. | Required | M300RTK, M30 Series |
wpml:direction | route direction | Integer | ° | [0, 360] | Required | M300RTK, M30 Series |
wpml:margin | Expansion distance outside the survey area | Integer | m | - | Required | M300RTK, M30 Series |
wpml:overlap | Overlap rate parameter | - | - | - | - | M300RTK, M30 Series |
wpml:ellipsoidHeight | Global route height (ellipsoid height) Note: This Element is used in conjunction with "wpml:height", which are expressions of different elevation reference planes at the same location. | Float | m | - | Required | M300RTK, M30 Series |
wpml:height | Global route height (EGM96 altitude/relative take-off point height/AGL relative ground height) Note: This Element is used in conjunction with "wpml:ellipsoidHeight", which are expressions of different elevation reference planes at the same location. | Float | m | - | Required | M300RTK, M30 Series |
Polygon | Survey area polygon Note: The format here is " <Polygon> <outerBoundaryIs> <LinearRing> <coordinates> longitude,latitude,0 longitude,latitude,0 longitude,latitude,0 </coordinates> </LinearRing> </outerBoundaryIs> </Polygon> ” | - | - | - | - | M300RTK, M30 Series |
<Placemark>
)
Strip Flight Template Element (Parent Element: Element | Description | Type | Unit | Value | Is it required (default) | Product Support |
---|---|---|---|---|---|---|
wpml:caliFlightEnable | Whether to enable calibration flight | Boolean | - | 0:Disable 1:Enable | Required | M300RTK, M30 Series |
wpml:shootType | Photo mode (timed or fixed distance) | string enumerate | - | time : take photos at equal time distance : take photos at equal intervals* Note: It is recommended to use "time" to take photos at equal time. Define "photographing mode", "overlap rate" and "flying speed" in the template.kml file, and write the interval time or interval distance after calculation into wayslines.wpml. | Required | M300RTK, M30 Series |
wpml:direction | route direction | Integer | ° | [0, 360] | Required | M300RTK, M30 Series |
wpml:margin | Expansion distance outside the survey area | Float | m | - | Required | M300RTK, M30 Series |
wpml:singleLineEnable | Whether to enable single route flight | Boolean | - | 0:disable 1:enable | Required | M300RTK, M30 Series |
wpml:cuttingDistance | Route length of each sub strip | Float | m | - | Required | M300RTK, M30 Series |
wpml:boundaryOptimEnable | Whether to enable edge optimization | Boolean | - | 0:disable 1:enable | Required | M300RTK, M30 Series |
wpml:leftExtend | Extending distance on the left side of the strip flight | Integer | m | - | Required | M300RTK, M30 Series |
wpml:rightExtend | Extending distance on the right side of the strip flight | Integer | m | - | Required | M300RTK, M30 Series |
wpml:includeCenterEnable | whether to include centerline | Boolean | - | 0:not include 1:include | Required | M300RTK, M30 Series |
wpml:overlap | Overlap rate parameter | - | - | - | - | M300RTK, M30 Series |
wpml:ellipsoidHeight | Global route height (ellipsoid height) Note: This Element is used in conjunction with "wpml:height", which are expressions of different elevation reference planes at the same location. | Float | m | - | Required | M300RTK, M30 Series |
wpml:height | Global route height (EGM96 altitude/relative take-off point height/AGL relative ground height) Note: This Element is used in conjunction with "wpml:ellipsoidHeight", which are expressions of different elevation reference planes at the same location. | Float | m | - | Required | M300RTK, M30 Series |
LineString | Waypoint information Note: The format here is " <LineString> <coordinates> longitude,latitude,0 longitude,latitude,0 longitude,latitude,0 </coordinates> </LineString> " | - | - | - | - | M300RTK, M30 Series |