DroneDeploy
Search…
Plans
What is a Plan?
A plan contains the flight data, drone data, image information, and the map assets. The same plan is used across planning, flight, uploading, and post-processed viewing.
Contents

Plans.getCurrentlyViewed

Overview
Returns the plan that is the currently visible to the user. For example, if the user is on the datapage the returned plan will be the plan they are looking at. The same applies for mapengine, planning, and the flight page.
Example Call
1
// Get the current one time
2
dronedeployApi.Plans.getCurrentlyViewed()
3
.then(function(plan){
4
console.log(plan);
5
});
6
7
// Will be called each time the plan changes
8
dronedeployApi.Plans.getCurrentlyViewed()
9
.subscribe(function(plan){
10
console.log(plan);
11
});
Copied!
Example Response
1
{
2
"accuracy": {
3
"xRMSE": 35.527931,
4
"yRMSE": 4.964015,
5
"zRMSE": 1.343646,
6
"gcpAccuracyDownload": "String of the ZIP file",
7
},
8
"id": "57e0761f21303e5214b6ae31",
9
"camera": {
10
"v_proj": 0.9,
11
"h_proj": 0.9,
12
"name": "DJIX3",
13
"capture_delay": 0,
14
"yres": 2250,
15
"xres": 4000,
16
"sensor_height": 4.55,
17
"sensor_width": 6.17,
18
"id": 18,
19
"focal": 3.6,
20
"min_capture_period": 2
21
},
22
"deleted": false,
23
"sketchfabModel": "https://sketchfab.com/models/cc462c22851847c78768d0318221a963",
24
"status": "complete",
25
"geometry": [
26
{
27
"lat": 35.92712713888889,
28
"lng": -96.7493288888889
29
},
30
{
31
"lat": 35.92712713888889,
32
"lng": -96.74831555555555
33
},
34
{
35
"lat": 35.92519230555555,
36
"lng": -96.74831555555555
37
},
38
{
39
"lat": 35.92519230555555,
40
"lng": -96.7493288888889
41
}
42
],
43
"info": {
44
"altitude": 75
45
},
46
"location": {
47
"lat": 35.92583194444444,
48
"lng": -96.74852777777778
49
},
50
"name": "Untitled Map",
51
"username": "[email protected]",
52
"frontlap": 70,
53
"sidelap": 60,
54
}
Copied!
plan.status
    "new": Before the plan has been flown
    "queued": Plan is waiting to be processed
    "processing": Plan is being processed
    "failed": Plan failed during processing
    "complete": Plan has finished processing

Plans.all

Overview
Get an array of all the users plans in memory. We store the 50 most recent and any plan a user loads in memory.
Example Call
1
// Get all the users plan one time
2
dronedeployApi.Plans.all()
3
.then(function(plans){
4
console.log(plans);
5
});
6
7
// Will be called each time a plan changes
8
dronedeployApi.Plans.all()
9
.subscribe(function(plans){
10
console.log(plans);
11
});
Copied!
Example Response
1
[
2
{
3
"id": "17e0761f21303e5214b6ae31",
4
"camera": {...},
5
"deleted": false,
6
"geometry": [...],
7
"info": {...},
8
"location": {...},
9
"name": "Plan 1",
10
"username": "[email protected]",
11
"sketchfabModel": "https://sketchfab.com/models/cc462c22851847c78768d0318221a963",
12
},
13
{
14
"id": "87e0761f21303e5214b6ae31",
15
"camera": {...},
16
"deleted": false,
17
"geometry": [...],
18
"info": {...},
19
"location": {...},
20
"name": "Plan 2",
21
"username": "[email protected]om",
22
"sketchfabModel": "https://sketchfab.com/models/dd462c22851847c78768d0318221a963",
23
}
24
]
Copied!

Plans.update

Overview
Plans.update allows you to update specific fields within the flight plan model.
Please reference the fieldsToUpdate variable in the following code for the fields updatable by this api method.
1
const planIdToUpdate = String;
2
const fieldsToUpdate = {
3
// These are the fields that can be updated on the plan
4
name: String,
5
altitude: Number, // in meters
6
geometry: [{lat: Number, lng: Number}, ....],
7
frontlap: Number,
8
sidelap: Number,
9
geometry: {lat: number, lng: number},
10
frontlap: Number, // allowed range: 15 - 95%
11
sidelap: Number, // allowed range: 15 - 95%
12
camera: {
13
id: Number,
14
capture_delay: Number,
15
focal: Number,
16
h_proj: Number,
17
min_capture_period: Number,
18
name: String,
19
sensor_height: Number,
20
sensor_width: Number,
21
v_proj: Number,
22
xres: Number,
23
yres: Number,
24
},
25
waypoints: [
26
{
27
alt: Number // the altitude of the waypoint - in meters
28
lat: Number // the latitude of the waypoint - floating point
29
lng: Number //the longitude of the waypoint - floating point
30
}
31
]
32
};
33
dronedeployApi.Plans.update(planIdToUpdate, fieldsToUpdate);
Copied!
Note: Save the plan's geometry on the planning page to automatically re-calculate the drone's flight path.
Note: Save the plan's waypoints on the planning page to change the drones flight path manually. If you decide your app needs to alter waypoints, this is considered a privileged action and the user will be asked if they wish to allow it on a per plan basis.
Warning: Waypoint changes may be overwritten my manual updates by the user to their flight geometry via the interactive map. Any waypoint changes should be in direct response to a Plans.getCurrentlyViewed, and either ignore, or handle changes to geometry, based on what your app is trying to achieve. Please see this example for an example.
Warning: Changing geometry will overwrite any changes to waypoints, by recalculating the optimal flight path as per DD's calculation code. Please see this example for an example.
Example Call
1
dronedeployApi.Plans.update('57e0761f21303e5214b6ae31', {
2
name: 'New Name',
3
geometry: [
4
{lat: 56.567259707222206,lng: -78.90349675},
5
{lat: 37.717259707222226,lng: -78.88330925000001},
6
{lat: 37.70100590388889,lng: -78.88330925000001},
7
{lat: 37.70100590388889,lng: -78.90349675}
8
],
9
frontlap: 70, // allowed range: 15 - 95%
10
sidelap: 45, // allowed range: 15 - 95
11
waypoints: [
12
{lat: 56.567259707222206,lng: -78.90349675, alt: 100},
13
{lat: 37.717259707222226,lng: -78.88330925000001, alt: 50},
14
{lat: 37.70100590388889,lng: -78.88330925000001, alt: 50},
15
{lat: 37.70100590388889,lng: -78.90349675, alt: 50}
16
],
17
camera: {
18
id: 11245,
19
capture_delay: 0,
20
focal: 4.7,
21
h_proj: 0.9,
22
min_capture_period: 2,
23
name: 'MP4K',
24
sensor_height: 4.55,
25
sensor_width: 6.17,
26
v_proj: 0.9,
27
xres: 4000,
28
yres: 3000,
29
},
30
});
Copied!

Plans.create

Overview
Plans.create allows you to create a new plan with an array of coordinates and an options object.
Example Call
1
var geometry = [
2
{lat: 35.92778956007768, lng: -96.74685001373292},
3
{lat: 35.92524492896255, lng: -96.74667120678352},
4
{lat: 35.92532220011748, lng: -96.74959659576417},
5
{lat: 35.92778151526379, lng: -96.7496186761855},
6
];
7
var options = { name: 'Example Plan', geometry: geometry };
8
9
// Returns the id of the newly created plan
10
dronedeploy.Plans.create(options)
11
.then(function(planId) {
12
console.log(planId);
13
});
Copied!