The airport elevation tool elev reads elevation imagery and writes MSFS height map rectangles into XML file that can be directly compiled into BGL.
If airport XML file is supplied with
-airport, then height maps will be merged into the existing airport file. Elevations of airport elements will also be updated and runway deformation profiles will be generated. If
-airport is not supplied, then a new XML file will be created, which will contain only height maps. You can use that standalone file with
-mesh component initialized with the project tool.
You can generate height maps by defining a bounding box with coordinates (
-bounds), by providing a vector file containing polygons to be covered with height maps (
-border), or by providing a vector file containing entirely custom grid (
-grid) that will have each individual polygon turned into a height map.
Imagery is loaded in alphabetical order, one source at a time, layered from bottom up. Multiple sources may be defined with wildcard-supported filemasks. Last-defined source will be added on top of previously loaded imagery.
All imagery must be in the same projection, but may differ in resolution.
Height maps are intended for small areas, such as for adding a hill or fixing a slope. While height maps may be laid over very large areas that span hundreds of kilometers, this may not be future-proof.
Elevation values must be in meters. If your source is in feet, use
-scale 0.3048to convert values from feet to meters.
When MSFS offers to convert height maps to the new terraforming method, select
If you would like to use the new terraforming method, use
-newmethodoption instead. See Terraforming Methods section.
msfs elev [-help] [-formats] -imagery filemask [filemask ...] (-bounds lon_min lon_max lat_min lat_max | -border file) [-grid file] [-epsg code] [-res m] [-falloff m] [-priority val] [-resample algo] [-newmethod] [-namefield name] [-fillnodata [m]] [-scale val] [-offset val] [-airport xml] [-nodefo] [-exclude file] [-dump shp] [-group name] [-nobackup] dest
- Shows a list of all currently supported file formats.
- -imagery <filemask> [<filemask> …]
- A list of one or more elevation imagery files to use (wildcard supported). Recommended format is GeoTIFF.
- -bounds <lon_min> <lon_max> <lat_min> <lat_max>
- Area to be covered by height maps in WGS84 decimal degrees. Alternatively, the area may be defined with
- -border <file>
- Vector file containing polygons that define the export area. All rectangles overlapping with these polygons will be written to output file. Recommended vector file formats are ESRI Shapefile or Google Earth KML. Choose this or use
- -grid <file>
- Vector file containing polygons that define the cells of a custom grid. For each polygon, a minimum oriented bounding box (MOBB) will be calculated and a matching height map rectangle will be written to the output file. You can use it alone or combine with
-borderto add custom rectangles.
- -epsg <code>
- Projection of input imagery expressed in EPSG code (eg 4326 for WGS84). Overrides auto-detected projection.
- -res <m>
- Target resolution in meters per pixel.
- -falloff <m>
- Falloff distance in meters to ensure smooth transition to stock terrain (default: 100 m). Has effect only on the lowest-priority rectangles. Other rectangles stacked on top of them behave as if falloff sitance was 0 m. See Falloff Distance.
- -priority <val>
- Height map priority level (default: 0). When generating height maps into an airport XML file (
-airport), all existing height maps with the same priority will be removed.
- -resample <algo>
- Resampling algorithm to use when reprojecting the imagery (default: bilinear). See GDAL for a list of all supported algorithms.
- Uses the new terraforming method (default: old method). See Terraforming Methods section below.
- -namefield <name>
- When using
-gridto generate a custom grid, names are assigned to generated rectangles from
Namefield in the source file. You can use
-namefieldto select a custom field. For example,
-namefield titlewill give the rectangle a name from a field called
- -fillnodata [m]
- Fill areas with no data by interpolating nearby pixels, or with a specific value, if provided. See Partial Data section below.
- -scale <val>
- Multiplies elevation values by the specified value. Use to convert data in feet to meters.
- -offset <val>
- Shifts elevation values by the specified amount. Use to correct data that does not have sea level at 0.
- -airport <xml>
- XML file containing airport information. If provided, height maps will be added to the specified file, existing airport elements will be moved to imagery elevations and runway deformation profiles will be generated for each runway (can be skipped with
- Skips writing runway deformation profiles when using
-airport. Existing data will remain unmodified.
- -exclude <file>
- Vector file containing polygons. Areas under these polygons will remain untouched. See Excluded Areas section below.
- -dump <shp>
- Dumps bounds of generated heightmap rectangles into a Shapefile for debugging.
- -group <name>
- Generated heightmap rectangles will be added to this group (default: Terraforming). If the group does not exist, it will be created.
- Skip automatic backup of output XML files before overwriting them. Backup copies are stored in Windows’ temporary folder.
- Output XML file.
Load imagery from “C:\DEM” folder and generate 10 m resolution height maps for area covered by “C:\area.kml” into “C:\MyAirport\EGLC.xml”:
msfs elev "C:\DEM\*.tif" -border "C:\area.kml" -airport "C:\MyAirport\EGLC.xml" -res 10 "C:\MyAirport\EGLC.xml"
See Sloped runway tutorial for an extended example.
To effectively work with elev tool, you should understand how it works internally.
It takes arbitrary shapes as input and generates a grid of height maps to cover them. Then imagery is loaded and partially or fully uncovered tiles will be filtered out, because MSFS height maps do not support partial data (nodata). This means that your imagery should always be large enough to cover the resulting grid. You can analyze generated grids with
-dump option, which writes the grid to a shapefile.
Notice how the polygon is slightly larger than imagery in the example above (4). This results in outermost tiles getting filtered out (5a), because they do not fully contain elevation data. Since it is a group of islands surrounded by water, you can use
-fillnodata 0 to fill missing areas with 0 m water level to fully cover partial tiles (5b) and get the whole area exported.
Any other void filling should be done in appropriate GIS programs.
When developing a regional terrain that covers multiple airports (without including them), you may want to cut out holes around airports to avoid conflicts with third party airport packages.
You can use
-exclude argument to assign a vector file with polygons that define excluded areas. These areas will retain their original elevation and remain free from any influence.
In order to get greater control over the size, location and orientation of height map rectangles, you can provide an entirely custom grid using
-grid. Every polygon within the supplied file will get a minimum oriented bounding box height map rectangle to cover it.
This has two main uses:
You can use
-borderto automatically generate a grid and add additional rectangles over the grid in places that you would like to manually edit. Set priority of custom rectangles higher than the grid and use in-game editor to tweak them. This lets you add manual changes while keeping the underlying grid intact. You can then always come back and re-generate the grid without losing your edits. This is particularly useful in scenarios like flattening the ground under buildings.
If you need your grid laid out in a particular manner, for example to match 3D cities, you can skip
-borderand only input the custom grid to gain precise control over how the rectangles are laid out.
Let’s say you have an airport project that needs height maps to cover the whole airport, with manual tweaking required around some buildings. Prepare a border file with polygons defining the area you would like to cover, add another file with polygons covering areas selected for manual editing, and run them through the tool using
Microsoft Flight Simulator introduced new terraforming method in Sim Update 12 (SU12). Differences between the two are generally unnoticable and this tool defaults to using the old method, but in some edge cases the old terraforming method may give very jagged surfaces. In such situations, it is recommended that you use the new terraforming method by enabling it with
Falloff distance (
-falloff) controls how far beyond its border the influence of a height map rectangle extends.
If your project has overlapping rectangles with different priorities, then only the lowest-priority rectangles will get a smooth falloff.
The default value is 100 meters. In mountainous regions, 100 m falloff may cause sharp spikes and cliffs running along the edge of your height map grid. An increase to 300-500 meters greatly reduces them.
In other areas, large falloff distances may cause ripples along grid edges. Lowering the falloff distance to 100 m removes them.