Aerial imagery

This tutorial guides you through creating background aerial imagery for Purdue University Airport (KLAF) in Tippecanoe County, Indiana, United States.

To complete the tutorial, you need:

  • MSFS SDK,
  • MSFS Toolkit,
  • general purpose mapping software (eg Google Earth).

An image editor such as Adobe Photoshop, Affinity Photo or ImageMagick is optional.

The screenshots below show the difference between stock imagery (left) and our custom imagery.

Stock KLAF
Custom KLAF

Tutorial contents:

Tip
All source files have been assambled into a project in klaf-aerial example available from Examples.

1. Install tools

MSFS SDK

Start MSFS. Go to Options > General > Developers settings menu and enable Developer Mode.
A black menu bar will appear and you will find SDK Installer under Help menu item. Run the installer.

Nool MSFS Toolkit

Download MSFS Toolkit and extract contents into a new folder.

Open Start > Settings > System > About > Advanced system settings > Environment variables.
Under System variables click on Path, then New. Enter the path where you extracted the toolkit.

Then press Windows key + R, type cmd and press Enter. A command prompt opens.
Type msfs and press Enter.

Everything was set up correctly if you see a list of MSFS Toolkit programs or a prompt to install OSGeo4W components (on first use of the toolkit).


2. Create project folder

Open Documents folder on your computer. Hold Shift and right-click, select Open Powershell window here from the menu.

Type the following command:

msfs project -type scenery -id KLAF -name "myname-airport-purdue-uni" -title "KLAF Purdue Uni" -creator "myname" -aerial "KLAF Purdue Uni"

This will create a MSFS add-on project folder named KLAF Purdue Uni. Inside it, create a subfolder named Source. This is where we will put all source files for the project.


3. Set up the area of interest

You need to define the area you want to replace with custom imagery.

Open Google Earth. Draw a polygon that covers the area you want to replace. For best blending, follow natural boundaries such as rivers and treelines.

Border drawn in Google Earth
Border drawn in Google Earth

KLAF lies next to the Wabash river. We trace it from the east to the southwest, then along treelines around the airport and denser parts of the nearby urban area. Save the polygon as purdue.kml file in Source folder of your project.


4. Choose imagery

Now you need to choose which imagery to use. A fairly good source for the United States is Department of Agriculture’s National Agriculture Imagery Program (NAIP). Go to https://earthexplorer.usgs.gov/ and create an account (free).

Under Enter Search Criteria select KML/Shapefile Upload and upload the previously created purdue.kml file.

EarthExplorer search
EarthExplorer search

Switch to Data Sets tab. Tick Aerial Imagery > NAIP and click Results.

EarthExplorer results
EarthExplorer results

You will see a list of aerial images that cover your search area. You can see the footprint of each frame by clicking on the foot icon, and a low-resolution preview by clicking on the image icon next to it.

Download the frames with best colors, which at the time of writing are (acquisition date 2020-06-11):

M_4008633_SE_16_060_20200611
M_4008633_SW_16_060_20200611

Each downloaded frame is a ZIP that contains a XML file with description and a TIF file with the actual image. Copy TIF files into the Source folder of your project.


5. Cut imagery into tiles

Open your project folder. Hold Shift and right-click, select Open Powershell window here from the menu.

Type the following command (all a single line):

msfs aerial -border "Source\purdue.kml" -imagery "Source\*.tif" -res 0.5 "PackageSources\aerial\tiles"

This reprojects and cuts the imagery into tiles that MSFS development tools recognize. Target resolution is 0.5 meters per pixel, which will be rounded to closest level of detail: level 18 at approximately 0.59 meters per pixel.


6. Apply color-correction

Optional. After you have cut the tiles, you can apply color-correction, if needed.

Our downloaded imagery is slightly too bright and blue. Using ImageMagick software and the command window still open from the previous step, we can call ImageMagick to adjust brightness, contrast and color balance:

magick mogrify -channel rgb -brightness-contrast -14x-9 -channel blue -modulate 90,100,95 -alpha on "PackageSources\aerial\tiles\*.png"

You can also use other photo editing software to alter the tiles. Look for batch editing feature to automatically apply changes to a large number of images. Ensure that edited images get saved in 32 bit PNG format (RGB + alpha) to retain their transparency.


7. Build the project

Now type into command prompt:

&"$env:MSFS_SDK\Tools\bin\fspackagetool.exe" "myname-airport-purdue-uni.xml"

After a short wait the MSFS SDK package tool starts building the final redistributable add-on package.
A new window will spawn to show progress.

After it completes, you will find the package in Output folder.
Copy myname-airport-purdue-uni folder into MSFS Community folder to activate the add-on in the simulator.


Summary

As you could see, the process is very straightforward.
To sum up, you need to:

  1. Create a project folder.
  2. Define a border and download aerial imagery.
  3. Cut imagery into tiles.
  4. Color-balance the tiles.
  5. Build the project.

MSFS Toolkit reduced most of these steps to a single command. Reprojection, cutting and blend masking were done for you automatically.