Custom Flight Areas
To ensure the aircraft will only be able to fly in allowed areas, users can define two types of the custom flight areas on the DJI Dock :
- Polygonal or circular geo-fences (GF) : the aircraft cannot fly out of those areas. In DJI documentation, these are referred as task area.
- Polygonal or circular No-Fly Zones (NFZ) : the aircraft cannot enter those areas. In DJI documentation, these are referred as GEO Zone.
If the distance between the aircraft and the boundary of the custom flight area is less than 5 meters during a flight task, the task will be stopped and the aircraft will return home directly. The aircraft will plan a route around any custom flight area when returning to home. For a the flight task to complete, make sure the planned trajectory stays away from any custom flight area boundaries.
Custom flight areas support in DroneDeploy is disabled by default and need to be enabled manually in the Agent Settings. Doing this will effectively erase any custom flight areas previously configured on the aircraft.
Define the Areas
This section explains how to create a JSON description of custom flight areas for DJI Dock.
Requirements
When defining new custom flight areas, users need to make sure they satisfy the following requirements :
- Multiple GF cannot overlap.
- Polygonal area supports a maximum of 255 vertexes.
- Circular area minimum radius is 10 m.
- Dock should be inside a GF.
- Dock should be outside any NFZ.
- Dock should be at least 10 m away from any custom flight area boundaries.
Format
Make sure you remove all // comment
from the template as those are not valid in JSON.
DJI defines the JSON description format for custom flight areas as shown in the template below.
{
"type": "FeatureCollection",
"features": [
{
"id": "geofence-001", // Unique identifier of user-defined flight zone.
"geofence_type": "dfence", // "dfence": geo-fence; "nfz": no-fly zone.
"properties": {
"radius": 0, // Unused for polygon, always set to 0.
"enable": true // Not supported in the current version, always set to true.
},
"type": "Feature",
"geometry": {
"type": "Polygon", // Polygon needs to be closed (i.e. first and last point have same coordinates).
"coordinates": [
[
[
25.41512807678825, // WGS84 longitude.
4.642350757553345 // WGS84 latitude.
],
[
25.41512807678825,
4.486362750550683
],
[
26.134956012525294,
4.486362750550683
],
[
25.41512807678825, // Same as the first point.
4.642350757553345
]
]
]
}
},
{
"id": "nfz-001", // Unique identifier of user-defined flight zone.
"geofence_type": "nfz", // "dfence": geo-fence; "nfz": no-fly zone.
"properties": {
"subType": "Circle", // Custom area type. Only for circle areas.
"radius": 1000, // Radius must be at least 10 m.
"enable": true // Not supported in the current version, always set to true.
},
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
25.41512807678825, // WGS84 longitude of circular area's center
4.642350757553345 // WGS84 latitude of circular area's center
]
}
}
]
}
Editor
DJI Dock custom area description is based on the GeoJSON standard and can be generated with the help of GeoJSON Editor as follow :
-
Open GeoJSON Editor tool.
-
Navigate to your project location (you can search by address or set the coordinates in the page URL).
-
Draw the custom flight areas on the map. JSON description is automatically created on the side panel.
-
For each GeoJSON
feature
created, add the following lines from the template :"id": "<area_id>",
"geofence_type": "<area_type>",
"properties": {
"radius": 0,
"enable": true
}, -
Replace
<area_type>
bydfence
for geo-fence or bynfz
for no-fly zone. -
Replace
<area_id>
by an unique ID of your choice. We recommend prefixing the area ID by the area type to make it easier to identify once deployed. -
Save the GeoJSON file on your machine.
There is no native support for circles in GeoJSON. We recommend to use the GeoJSON Editor circle tool that will generate a 65 vertex polygon approximation of the circle. This will allow easy visualization of the circular area over the map. Alternatively, you can draw the circle center as a Point
in the GeoJSON Editor and add the rest of the circle definition in JSON directly (don't forget the subType
property).
Deploy to the Dock
This section will explain how to deploy the custom flight areas JSON description to the DJI Dock from the Live Data Viewer.
The aircraft always try to sync custom flight areas before take-off but you can force the sync with the /dji/areas/deploy
service. Forced sync can take a few seconds to start because the aircraft needs to turn on.
- Import the custom flight areas description in DroneDeploy : simply copy-paste it in the
/dji/areas/import
service and press Call Service. - Export the current custom flight areas description from DroneDeploy (safety check) : call
/dji/areas/export
and make sure the response matches your custom flight areas description. - Force the custom flight areas sync to the aircraft (safety check) : subscribe to
/dji/areas/deploy/progress
telemetry then call/dji/areas/deploy
service, after a few seconds you should get a"status": "completed"
progress update. - Monitor the custom flight areas status : make sure the aircraft is localized then subscribe to
/dji/areas/alarms
telemetry, you should see wether the aircraft is inside/outside any of the configured areas and how far it is from any of those areas.