You are on page 1of 27

FlightOps@aerotas.

com
(949) 386-2277

Phantom 4 RTK Terrain Awareness


The Phantom 4 RTK has Terrain Awareness, but you have to import a DSM of the site you
intend to fly before you can use the Terrain Awareness feature. So, you have to fly the site
before you fly the site? And, therein lies the rub. This doc will help you use USGS elevation data
in order to use the Terrain Awareness feature.

Objective 2

Getting the Elevation Data 2


Go to the USGS web-viewer to download the data 3

Converting and clipping the data 6


Download QGIS 6
Open QGIS 7
Drag and drop the .adf file into QGIS 7
Add a base map 7
Draw a polygon to clip the data 8
Open OSGeo4W Shell 15
Use OS4Geo4 Shell to create a TFW for the clipped TIF 17

Loading the data onto the Controller SD card 18


Put an SD card in your computer 18
Place the TIF and TFW on the SD card 19

Import data to the DJI controller 20


Insert the SD card into the DJI controller 20
Tap three lines 21
Tap the SD card icon 22
Select the DSM file 23
Select Terrain Awareness Mode 25
Select the right DSM 26
Plan Task (aka Plan Flight Path) 26

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Objective

The purpose of this document is to get elevation data from the USGS for areas in the United
States and make that data usable for Terrain Awareness in the DJI Phantom 4 RTK.

There are GIS applications, like Global Mapper, that can assist in this endeavor. But, you have
to pay for those tools. This workflow is FREE.

This process will consist of 4 main steps:

1. Getting the Elevation Data


2. Converting and clipping the data
3. Loading the data onto the drone SD card
4. Import data to the DJI controller

Getting the Elevation Data

First, get the Elevation Data.

To do this we will go to the USGS website to get data from what is called the ​3DEP​ (3D
Elevation Program). Formally known as the NED (National Elevation Dataset) the purpose of
this dataset is:

... to systematically collect 3D elevation data in the form of light detection and ranging
(lidar) data for the conterminous United States, Hawaii, and the U.S. territories, with data
acquired over an 8-year period. Interferometric synthetic aperture radar (IfSAR) data is
being acquired for Alaska, where cloud cover and remote locations preclude the use of
lidar in much of the State.
See: h ​ ttps://www.usgs.gov/core-science-systems/ngp/3dep/what-is-3dep

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Go to the USGS web-viewer to download the data


>> ​https://viewer.nationalmap.gov/basic/

Use the address bar or navigate to the area where we will need elevation data for the flight
using the map on the right.

Check the following boxes:

● Use Map [top right, above the map]


● Current Extent [top right, above the map]
● Elevation Products (3DEP) [left-hand side]
○ 1/3 arc-second DEM [left-hand side, underneath Elevation Products]
○ Data Extent = 1 x 1 degree
○ File Format = ArcGrid

Now hit the “Find Products” box.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Clicking “Find Products” will move you from the “Datasets” tab to the “Products” tab. You will
now see the products that USGS has available for that area. If your area is big enough, you may
have more than one product available.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Next, we will need to add these products to our cart. Click the + button next to the products you
want and click the “View Cart” button circled in red.

This should move you from the “Products” tab to the “Cart” tab.

To download the data, you just need to click the “Download” button highlighted below. This
should download a .zip file.

You will need to unzip the .zip file. Once you have unzipped the .zip file, you will find a bunch of
files and folders inside the unzipped folder.

Navigate to the folder that starts with “grdn..” in that folder, you will find some files with the .adf
file type. These are your actual DEM’s. ​But, those DEM’s are too big and they are not
usable, yet. We need to convert the files in order to make them small enough to work with
the P4RTK.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Converting and clipping the data

In order to covert and clip the data we downloaded from USGS, we will need to use a GIS
program.

We recommend a free open-source program called ​QGIS​. We will be using QGIS in this tutorial.

You can also use programs such as ​ArcGIS​ and ​GlobalMapper​ and the steps outlined here will
be very similar as most GIS programs are built off the same open-source libraries.

Download QGIS

To download QGIS go to ​https://qgis.org/en/site/forusers/download.html

We strongly recommend downloading from the “Long term release repository” as it is far more
stable than the other options.

Go through the set-up wizard and open the program. In my case, it put the program in a folder
on my Desktop. Select the highlighted program below. ​QGIS Desktop 3.4.8

We will also be using OSGeo4W Shell later so go ahead and keep this window open for now.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Open QGIS

Once open, you can go ahead and drag and drop the largest file from your downloaded “grdn..”
folder inside the downloaded folder into the main window of QGIS.

Drag and drop the .adf file into QGIS

A simple drag and drop is all you need. You should now see the elevation data in your viewer in
a black and white gradient. The Black being lower elevation and the white being higher.

Add a base map

Next, we need to add a base map so we can orient ourselves on the map. To do this double
click the “OpenStreetMap” under the “XYZ Tiles” drop-down in the Browser on the Left of QGIS.
You should see a new layer called “OpenStreetMap” in your layers pane in the bottom left. Go
ahead and use the viewer to find your project area. Zoom in by using the scroll wheel on your
mouse and click and drag the mouse to move around in the viewer.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Draw a polygon to clip the data

Once you are zoomed in on your project area, we will need to draw a polygon to “clip” the data
we want out of the larger DEM. To do this we need to go the “Layer” tab in the very top bar of
QGIS. In the layer drop down, click the “Create New Layer” option and the “New Shapefile
Layer”. You should see a pop-up like the one below. First, we need to give the shapefile a
location where we want to save, click the three dots “...” to the right of the file name box.

This should open a finder window, from here we are going to navigate to our Desktop and make
a new folder called “DEM”. You can do this by right-clicking in the finder window, going down to
“New” and clicking “Folder”. Give the folder a name, we chose “DEM” for this demo, but you can
make it whatever you like.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Open this folder in the finder window. Then go ahead and name the file whatever you like, for
this demo, we chose “ClipBox”.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

In the “New Shapefile Layer” pop-up, change the Geometry Type from Point to Polygon, and
name the field, we used “1” because it does not really matter. Leave the Coordinate system to
its default. Check everything is set properly and hit “OK”.

This should add a new layer to your layer pane in the bottom left called whatever you named the
Shapefile layer in the step above, for this example, we named the layer “ClipBox”. Right click
that new layer in the layer pane in the bottom left and hit the “toggle editing” option. We are now
able to edit on that layer.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Click the “New Polygon” button in the 3rd-row bar from the top.

You should now be able to draw a polygon around your flight area. It is strongly recommended
to draw a polygon much bigger than your site, as you do not want to run out of data. The data,
when we are done, is also going to be very small, so it doesn't hurt to have more.

Left-click once for a vertex of your polygon and right-click to end the polygon. When done you
will get a pop-up asking you to give the polygon an id, go ahead and hit anything, we used 1.
You should now see your polygon in the viewer. Right-click the “ClipBox” layer in the layer pane
and hit the “save layer edits” option, then right click again and hit the “toggle editing” option.
Now we are ready to clip the data from USGS using this polygon we just created.

To do this we will need to go to the ”Raster” tab in the top bar of QGIS, then click the
“Extraction” option, and the “Clip Raster by Mask Layer… “. This should make the Clip Raster by
Mask Layer pop-up appear. In that pop-up, we will need to change the “Input Layer” to our DEM
from USGS for this Demo that is “grdn34w118_13” and the “Mask Layer” to our “ClipBox”
polygon layer.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Scroll to the bottom of the pop-up and find the “Clipped (mask)” option, we will need to change
this from a temporary file to a file of our choosing. Do this by clicking the three dots to the right
of the “Clipped Mask” option and select “Save to File” from the drop-down.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

In the “Save File” pop-up, we will want to navigate to the folder we created earlier on our
Desktop called “DEM”, then we will need to name the file, for this example, we choose
“Clipped_DEM”. It is very good practice to stay away from using spaces or periods in your
naming conventions for folders and files. Doing so may prevent you from completing the next
step.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Once everything looks like the screenshot below, you can go ahead and click “Run”.

You should now see the DEM in the viewer. ​We are now done with QGIS.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Open OSGeo4W Shell

Go ahead and open the other program we mentioned earlier called “OSGeo4W Shell” that was
in the same folder as QGIS. This should open a command-line type shell.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

The first thing we will need to do in the shell is navigate to our folder on our desktop where we
created our clipped DEM above. Right-click the “Clipped_DEM.tif” we created and select the
“Properties” option. Copy the “Location” file path as we will need it in the OSGeo4 Shell.

In the OS4Geo4 Shell type in “CD C:\Users\sean\Desktop\DEM” without the quotes and with the
file path from the step before and not the one from this demo and hit enter. This should take you
to your folder on the Desktop with your Clipped_DEM.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Use OS4Geo4 Shell to create a TFW for the clipped TIF

Then we will need to type in “listgeo -tfw Clipped_DEM.tif” and hit enter. The part that says
Clipped_DEM.tif will need to be replaced with whatever you called the DEM two steps ago, for
this Demo, we called the exported TIF “Clipped_DEM.tif”. This should create the .tfw that we
need in addition to the TIF for the P4RTK. You will probably get a warning about an unknown
field and that is perfectly fine.

If at any step above you have spaces in the file path or file names, you can enclose them in
quotes and the shell will treat it as one object instead of two. For example, if I named my TIF
“Clip DEM.tif” for example, and the command fails I can just run it as: listgeo -tfw “Clip DEM.tif”
to get around the space issue.

Now you have the DEM (.tif) and the World file (.tfw) ready to be put on the SD card and loaded
onto the drone.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Loading the data onto the Controller SD card

Put an SD card in your computer


Take an SD card and put it in your computer, create a “DJI” folder on the SD card.

Within the “DJI” folder, create a “DSM” folder, and within that, create a folder for the TIF and
TFW file, name it whatever your project is named.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Place the TIF and TFW on the SD card

Now drag and drop your TIF and TFW into this project named subfolder.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Import data to the DJI controller

Insert the SD card into the DJI controller

Now remove the SD card from the computer and insert it into the lower right-hand compartment
on the DJI controller.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Tap three lines

Power on the controller and tap the three lines in the upper left-hand corner of the screen.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Tap the SD card icon

Tap on the SD card icon in the lower left corner

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Select the DSM file

Be sure “DSM File” is selected from the top drop-down, and select the DSM folder name you
created previously, and tap “import”. The import should only take a few seconds but may take a
bit longer, be patient until it gives you feedback.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

If successful, you will see this popup. Click ok and back out to the home screen and tap “Plan.”

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Select Terrain Awareness Mode

From here, select “Terrain Awareness Mode”

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

Select the right DSM

Once the screen has loaded, scroll down on the right until you see your desired DSM, tap it and
you should see an orange-hued polygon pop up over your area of interest, the same shape as
the DSM you created earlier. Now tap “Plan Task.”

Now a white dashed border should pop up around the perimeter of the DSM.

Plan Task (aka Plan Flight Path)

Next, you will plan your mission as you normally would in the P4RTK. Tap to create a flight path
and adjust your parameters as necessary. See: ​Creating Flight Paths - Phantom 4 RTK

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com


FlightOps@aerotas.com
(949) 386-2277

The one new thing you’ll notice is a flight profile at the bottom of the screen. Each white dot is
the end of a flight line. Cross-reference this profile with the flight lines and terrain under the flight
lines, as well as the projected altitude (*** keep in mind the P4RTK only shows height in
meters). You’ll want to make sure the selected height you chose is consistently represented
above the terrain (represented by the colored bottom portion of the flight profile graph.)

When you are satisfied, click “Save.” This flight plan will now be saved in the general menu
(three lines in the upper left of the home screen) under the middle drop down “Plan” for use
later.

You have successfully used free USGS elevation data to make the Terrain Awareness feature
work for the Phantom 4 RTK.

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com

Questions? Contact us anytime at (949) 386-2277, or ​FlightOps@aerotas.com

You might also like