Create mesh using Global Mapper: Difference between revisions

From FSDeveloper Wiki
Jump to navigationJump to search
mNo edit summary
No edit summary
Line 93: Line 93:
That's it! You now have successfully created a BGL to tell FS2004/FSX/P3D the altitude on the earth. For sure this BGL is, in this tutorial, not valid for the whole world or the whole Europe, but only on the selected area in western France near the city of Brest.
That's it! You now have successfully created a BGL to tell FS2004/FSX/P3D the altitude on the earth. For sure this BGL is, in this tutorial, not valid for the whole world or the whole Europe, but only on the selected area in western France near the city of Brest.


[category:Terrain_Design]
[[category:Terrain_Design]]

Revision as of 10:20, 1 March 2015

Summary

In this tutorial you will learn how to use Global Mapper to create a BGL which includes terrain data information (called mesh) for FS2004 and FSX/P3D.


Requirements for this lesson

In order to follow this wiki article you need at least:

- an installed Global Mapper from Blue Marble Geographics.

- one (or more) elevation data files. You can get them for example via USGS's EarthExplorer. For this example we use the ASTER data of West-France around the city of Brest.

- around 15-30 minutes of time (depending on how fast you get through this tutorial and how fast your PC is).

- depending on your needs either the FS2004 and/or FSX and/or P3D SDK.


Starting

After downloading the files from USGS's Earth Explorer, I have these three files: ASTGTM2_N47W005.zip, ASTGTM2_N48W005.zip and ASTGTM2_N48W006.zip. First thing to do is to extract all the files and put the files ending in ***_dem.tif and ***_num.tif into the same folder to not mix the things up. In this case the *** are used to describe anything before. With this step done, let's start Global Mapper.


Inside Global Mapper

After Global Mapper successfully started, click on File and then on Open Data File(s).... Select now all the files ending in ***_dem.tif and click on Open. In my case I selected the following files (that are those which are previously extracted and copied to one folder): ASTGTM2_N47W005_dem.tif, ASTGTM2_N48W005_dem.tif and ASTGTM2_N48W006_dem.tif. The files will now be loaded into Global Mapper and Global Mapper will also render the loaded pictures. This may take a little while. When the loading and rendering process is done, click again on File and then on Batch Convert/Reproject.... A new window appears and you need to select the file type to convert from. In that window select GeoTIFF (Imagery, Raster Maps, and Terrain) and then click OK. After this, a second window appears asking you the file type to convert to. Here we need to divide between FS2004 and FSX/P3D:

-> If you are creating mesh for FS2004 you need to select BIL (16-bit Elevation Samples).

-> If you are creating mesh for FSX/P3D you need to select GeoTIFF (32-bit Elevation Grid).

After selecting your correct file type to convert to, click OK. An additional window will show up and here you need to pay attention since missing one part of what we do next may mean you work is worth nothing. We go through the window from left to right and from top to bottom. So let's start.

In that big white window on the left are listed all our source files which are converted according to the settings we choosed and which we choose soon. In order to let Global Mapper know what our source files are, we just need to click on Add Loaded Files and Global Mapper uses the files which we previously opened. If we did not loaded the files as previosuly described into Global Mapper, we would simply click on Add Files... and select all the ***_dem.tif files. Moving along to the right side of the window we can now select the output directory. It is highly recommended to do this since it allows people with less knowledge about the ***_dem.tif and ***_num.tif files to choose between the raw original files and the converted files. So we specify an output directory. To do so, we either click on Specify output directory or on the button Change... Both do the same. Select a subfolder and click on OK. The file names can be changed but I do not do it since we do not really need this. Due to this we can leave the settings under File Names as they are. The settings under Projection should also be left like this. The two following buttons Set up Gridding (i.e. Tiling)... and Set up Sample Spacing... can be left like this. The Horz Datum should be changed to WGS84. The Vertical Units should be Source Units. In the box under the Vertical Units settings we need to check that the following settings are thicked:

- Force Square Pixels in Output

- Fill Small Gaps in Data

- Show Batch Conversion Progress

The last setting is not really needed but it is quite interesting to see the conversion progress. After doing all these steps, we can finally click on the upper right part of the window on OK. Now Global Mapper converts the files we selected according the settings we selected. After the converting process is done, 3 new files have been created. In my case they are named:

- -ASTGTM2_N47W005_dem.tif-_SILC_TIFF.tif

- -ASTGTM2_N48W005_dem.tif-_SILC_TIFF.tif

- -ASTGTM2_N48W006_dem.tif-_SILC_TIFF.tif

To avoid any problems with the filename, simply delete the character "-" in front of every filename. This results in these new filenames:

- ASTGTM2_N47W005_dem.tif-_SILC_TIFF.tif

- ASTGTM2_N48W005_dem.tif-_SILC_TIFF.tif

- ASTGTM2_N48W006_dem.tif-_SILC_TIFF.tif

The files are now ready to be used with resample.exe.


Making our elevation data ready for the flight simulator

As I want to use my eleveation data in FSX, I need to use the resample.exe with the FSX SDK. If you want to use the elevation data in FS2004, follow the FS2004 SDK rules. The instructions for P3D should be the same as for FSX.

In order to compile our BGL for FSX, we need first of all to create the Elevation_Data_Brest.inf, so that resample.exe knows what it has to do and how. Following the SDK documentation, the Elevation_Data_Brest.inf should look like this:

[Source]
Type = MultiSource
NumberOfSources = 3

 [Source1]
Type                = GeoTIFF
Layer               = Elevation
SourceDir           = "SourceData"
SourceFile          = "ASTGTM2_N47W005_dem.tif-_SILC_TIFF.tif"

 [Source2]
Type                = GeoTIFF
Layer               = Elevation
SourceDir           = "SourceData"
SourceFile          = "ASTGTM2_N48W005_dem.tif-_SILC_TIFF.tif"

 [Source3]
Type                = GeoTIFF
Layer               = Elevation
SourceDir           = "SourceData"
SourceFile          = "ASTGTM2_N48W006_dem.tif-_SILC_TIFF.tif"

 [Destination]
DestDir             = "Output"
DestBaseFileName    = "Elevation_Data_Brest"
DestFileType        = BGL
LOD                 = Auto


To compile now the BGL with the elevation data, simply drop the Elevation_Data_Brest.inf on resample.exe. Resample.exe is starting to compile the Elevation_Data_Brest.bgl. This may take up some time according to your computer specifications. When the compiling process is done a file called Elevation_Data_Brest.bgl can be found in the Output folder.

That's it! You now have successfully created a BGL to tell FS2004/FSX/P3D the altitude on the earth. For sure this BGL is, in this tutorial, not valid for the whole world or the whole Europe, but only on the selected area in western France near the city of Brest.