<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.flightgear.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stuart</id>
	<title>FlightGear wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.flightgear.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stuart"/>
	<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/Special:Contributions/Stuart"/>
	<updated>2026-05-26T16:14:01Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=3D_clouds&amp;diff=143750</id>
		<title>3D clouds</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=3D_clouds&amp;diff=143750"/>
		<updated>2026-03-18T19:49:11Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Voxel-based clouds */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Wiki PlaceTower.jpg|thumb|270px|3D clouds in [[OSG]] with shaders.]]&lt;br /&gt;
[[File:fgfs_prerelease_osg_clouds.png|thumb|270px|[[CVS|Development version]] 3D clouds in [[OSG]] with shaders.]]&lt;br /&gt;
[[File:3D_clouds.jpg|thumb|270px|3D clouds in [[OSG]] version as seen from a [[EC135]].]]&lt;br /&gt;
[[File:Clouds2 2006-06-23.jpg|thumb|270px|3D clouds in [[PLIB]] version]]&lt;br /&gt;
[[File:Clouds_2001.jpg|thumb|270px|Clouds back in 2001]]&lt;br /&gt;
[[FlightGear]]s [[weather]] system uses '''3D clouds''' for a realistic reproduction of the sky. 3D clouds have been present since version 0.9.1, and significantly updated in version 0.9.9.&lt;br /&gt;
&lt;br /&gt;
FlightGear 2024.X uses &amp;quot;billboarded&amp;quot; clouds that can be defined in XML. Post 2024.X, FlightGear uses fully rendered voxel-based clouds.&lt;br /&gt;
&lt;br /&gt;
== Voxel-based clouds (post 2024) ==&lt;br /&gt;
&lt;br /&gt;
Voxels are 3D pixels.  Imagine a rubix cube, then each of the 3x3x3 cubes is a voxel.  &lt;br /&gt;
&lt;br /&gt;
The voxel texture is a 3D texture of WxWxH voxels.  It is stored as a PNG file.  As PNG files are two dimensional, the file is chopped up to make the 3D texture.  So a file of of height W and width WxH, is chopped into WxW slices to create the 3D texture.&lt;br /&gt;
&lt;br /&gt;
Rather than describing the cloud colour, the RGBA channels of the texture are used as follows:&lt;br /&gt;
&lt;br /&gt;
* R - Dimension.  This is a positive gradient with 1.0 at the center of the cloud, and 0.0 at the edge.&lt;br /&gt;
* G - Type.  From wispy (0.0) to billowy (1.0)&lt;br /&gt;
* B - Density.  0.0 is no cloud density, 1.0 is fully opaque density.  Use this to determine if there is any cloud at this location.&lt;br /&gt;
* A - Signed Distance Field in UV space.  The maximum radius sphere centered on this point that doesn't contain any cloud density.  Used for adaptive ray marching.  Negative values represent areas inside the cloud.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, the PNG file should only set the G and B channels, as the R and A channels are calculated by FlightGear itself.&lt;br /&gt;
&lt;br /&gt;
See examples in fgdata/Textures/Sky&lt;br /&gt;
&lt;br /&gt;
== Billboarded Clouds  (2024.X) ==&lt;br /&gt;
&lt;br /&gt;
Note: the cloud XML format in CVS is currently undergoing renovation to allow more control, and more natural looking clouds.&lt;br /&gt;
&lt;br /&gt;
A 3D cloud layer is defined in the &amp;lt;layers&amp;gt; section. It contains of a number of randomly located &amp;lt;boxes&amp;gt;, containing a set of &amp;lt;clouds&amp;gt;.&lt;br /&gt;
          &lt;br /&gt;
Each cloud is generated with random size, based on the following tags:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;min-cloud-width-m&amp;gt;&lt;br /&gt;
 &amp;lt;max-cloud-width-m&amp;gt;&lt;br /&gt;
 &amp;lt;min-cloud-height-m&amp;gt;&lt;br /&gt;
 &amp;lt;max-cloud-height-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cloud consists of &amp;lt;num-sprites&amp;gt; individual sprites. &lt;br /&gt;
Each sprite is generated with random size, based on the following tags:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;min-sprite-width-m&amp;gt;&lt;br /&gt;
 &amp;lt;max-sprite-width-m&amp;gt;&lt;br /&gt;
 &amp;lt;min-sprite-height-m&amp;gt;&lt;br /&gt;
 &amp;lt;max-sprite-height-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;texture&amp;gt; defines the texture file to be used for the sprite. The texture file may contain more than one texture in a grid, by setting the &amp;lt;num-textures-x&amp;gt; and &amp;lt;num-textures-y&amp;gt; tags.&lt;br /&gt;
 &lt;br /&gt;
Clouds are darker towards the bottom. bottom-shade indicates the shading factor of the bottom of the cloud compared with the top.&lt;br /&gt;
&lt;br /&gt;
Finally, note that the clouds are defined as a set of properties, so they can be modified within the simulator under /environment/cloud-layers. You can then see the effects of your changes by changing the clouds dialog, which reloads the clouds from properties.&lt;br /&gt;
&lt;br /&gt;
== Cloud Textures ==&lt;br /&gt;
&lt;br /&gt;
Advice for those editing cloud textures:&lt;br /&gt;
&lt;br /&gt;
* Place a black layer behind the clouds you are editing. This makes it easier to see the white clouds, and in particular spot posterization. Note that GIMP appears to have a bug in that simply changing the transparency colour to black under Preferences-&amp;gt;Display changes the background to black.&lt;br /&gt;
* Display a grid of the appropriate dimensions to ensure you don't draw clouds over the texture boundaries. Otherwise the clouds can bleed into each other and you can see nasty vertical and horizontal edges.&lt;br /&gt;
* Use a white airbrush and a smudge tool to make the cloud textures look random.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://forum.flightgear.org/viewtopic.php?f=6&amp;amp;t=2387 Forum Topic OSG Clouds]&lt;br /&gt;
* http://home.arcor.de/vollnhals-bremen/NewClouds/images.html&lt;br /&gt;
* http://gallery.flightgear.org.uk/&lt;br /&gt;
&lt;br /&gt;
[[Category:FlightGear feature]]&lt;br /&gt;
[[fr:Nuages 3D]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=3D_clouds&amp;diff=143410</id>
		<title>3D clouds</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=3D_clouds&amp;diff=143410"/>
		<updated>2026-01-04T16:58:37Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[File:Wiki PlaceTower.jpg|thumb|270px|3D clouds in [[OSG]] with shaders.]]&lt;br /&gt;
[[File:fgfs_prerelease_osg_clouds.png|thumb|270px|[[CVS|Development version]] 3D clouds in [[OSG]] with shaders.]]&lt;br /&gt;
[[File:3D_clouds.jpg|thumb|270px|3D clouds in [[OSG]] version as seen from a [[EC135]].]]&lt;br /&gt;
[[File:Clouds2 2006-06-23.jpg|thumb|270px|3D clouds in [[PLIB]] version]]&lt;br /&gt;
[[File:Clouds_2001.jpg|thumb|270px|Clouds back in 2001]]&lt;br /&gt;
[[FlightGear]]s [[weather]] system uses '''3D clouds''' for a realistic reproduction of the sky. 3D clouds have been present since version 0.9.1, and significantly updated in version 0.9.9.&lt;br /&gt;
&lt;br /&gt;
FlightGear 2024.X uses &amp;quot;billboarded&amp;quot; clouds that can be defined in XML. Post 2024.X, FlightGear uses fully rendered voxel-based clouds.&lt;br /&gt;
&lt;br /&gt;
== Voxel-based clouds ==&lt;br /&gt;
&lt;br /&gt;
Voxels are 3D pixels.  A voxel-based cloud is simply a 3D texture that defines the characteristics of a cloud.  We implement the 3D texture as a PNG file.  As PNGs are 2D, we simply chop the file up to create layers for the Z axis (height).  The PNG file&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Billboarded Clouds  (2024.X) ==&lt;br /&gt;
&lt;br /&gt;
Note: the cloud XML format in CVS is currently undergoing renovation to allow more control, and more natural looking clouds.&lt;br /&gt;
&lt;br /&gt;
A 3D cloud layer is defined in the &amp;lt;layers&amp;gt; section. It contains of a number of randomly located &amp;lt;boxes&amp;gt;, containing a set of &amp;lt;clouds&amp;gt;.&lt;br /&gt;
          &lt;br /&gt;
Each cloud is generated with random size, based on the following tags:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;min-cloud-width-m&amp;gt;&lt;br /&gt;
 &amp;lt;max-cloud-width-m&amp;gt;&lt;br /&gt;
 &amp;lt;min-cloud-height-m&amp;gt;&lt;br /&gt;
 &amp;lt;max-cloud-height-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The cloud consists of &amp;lt;num-sprites&amp;gt; individual sprites. &lt;br /&gt;
Each sprite is generated with random size, based on the following tags:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;min-sprite-width-m&amp;gt;&lt;br /&gt;
 &amp;lt;max-sprite-width-m&amp;gt;&lt;br /&gt;
 &amp;lt;min-sprite-height-m&amp;gt;&lt;br /&gt;
 &amp;lt;max-sprite-height-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;texture&amp;gt; defines the texture file to be used for the sprite. The texture file may contain more than one texture in a grid, by setting the &amp;lt;num-textures-x&amp;gt; and &amp;lt;num-textures-y&amp;gt; tags.&lt;br /&gt;
 &lt;br /&gt;
Clouds are darker towards the bottom. bottom-shade indicates the shading factor of the bottom of the cloud compared with the top.&lt;br /&gt;
&lt;br /&gt;
Finally, note that the clouds are defined as a set of properties, so they can be modified within the simulator under /environment/cloud-layers. You can then see the effects of your changes by changing the clouds dialog, which reloads the clouds from properties.&lt;br /&gt;
&lt;br /&gt;
== Cloud Textures ==&lt;br /&gt;
&lt;br /&gt;
Advice for those editing cloud textures:&lt;br /&gt;
&lt;br /&gt;
* Place a black layer behind the clouds you are editing. This makes it easier to see the white clouds, and in particular spot posterization. Note that GIMP appears to have a bug in that simply changing the transparency colour to black under Preferences-&amp;gt;Display changes the background to black.&lt;br /&gt;
* Display a grid of the appropriate dimensions to ensure you don't draw clouds over the texture boundaries. Otherwise the clouds can bleed into each other and you can see nasty vertical and horizontal edges.&lt;br /&gt;
* Use a white airbrush and a smudge tool to make the cloud textures look random.&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* [http://forum.flightgear.org/viewtopic.php?f=6&amp;amp;t=2387 Forum Topic OSG Clouds]&lt;br /&gt;
* http://home.arcor.de/vollnhals-bremen/NewClouds/images.html&lt;br /&gt;
* http://gallery.flightgear.org.uk/&lt;br /&gt;
&lt;br /&gt;
[[Category:FlightGear feature]]&lt;br /&gt;
[[fr:Nuages 3D]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142776</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142776"/>
		<updated>2025-10-19T20:57:06Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Textures */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You may need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
[[File:Screenshot from 2025-10-07 21-27-16.png|thumb|Blender shader settings using OSM texture]]glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect to glTF files, which should be used unchanged by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
The only Effect that should be applied direclty is &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  &lt;br /&gt;
&lt;br /&gt;
The main texture is purely used for the base colour of the material, unlike in 2024.1, where it might also include an ambient occlusion texture and emulate roughness and the sheen of metallic materials.&lt;br /&gt;
&lt;br /&gt;
Principled BSDF can take Metallic and Roughness values direct from the Material entry in Blender.  However this generates lots of materials, which is undesirable from a performance perspective.  glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which has (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values in the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion (AO) ===&lt;br /&gt;
Blender can render a texture for ambient occlusion (See &amp;quot;Bake&amp;quot; under the Editor properties).  Unfortunately, it will bake to a grayscale texture, when what we require is the occlusion information written to the red channel of the ORM texture.&lt;br /&gt;
&lt;br /&gt;
Additionally, Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node for it to be exported properly.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;br /&gt;
&lt;br /&gt;
=== Putting together the ORM texture ===&lt;br /&gt;
[[File:Orm texture.png|thumb|Example ORM texture (Occlusion, Roughness, Metallic)  for PBR]]The ORM texture uses channels for different information:&lt;br /&gt;
&lt;br /&gt;
* Red - Ambient Occlusion&lt;br /&gt;
* Green - Roughness (0 = smooth, 1 = rough)&lt;br /&gt;
* Blue - Metallic (0 = non metallic, 1 = metallic)&lt;br /&gt;
&lt;br /&gt;
You can use an image editor such as GIMP, or the [https://extensions.blender.org/add-ons/ucupaint/ UCUPaint] extension for Blender which allows in-Blender painting of material properties.&lt;br /&gt;
&lt;br /&gt;
=== GIMP ===&lt;br /&gt;
Using GIMP, the easiest way to manage this is to have separate layers for each channel:&lt;br /&gt;
&lt;br /&gt;
# Open the Baked AO texture from Blender&lt;br /&gt;
# Make only the Red channel visible&lt;br /&gt;
# Use  Layer -&amp;gt; New from Visible to create a layer containing only Red information.  Label this &amp;quot;Occlusion - R&amp;quot; so you don't forget&lt;br /&gt;
# Create two layers above this. Under Layer Attributes change the mode to &amp;quot;Addition&amp;quot;, and label them &amp;quot;Roughness - G&amp;quot; and &amp;quot;Metallic - B&amp;quot; respectively&lt;br /&gt;
# Delete the bottom later which contains the grayscale AO texture.&lt;br /&gt;
&lt;br /&gt;
You should now have 3 layers, one with a red image of the AO, and two layers with no information.&lt;br /&gt;
&lt;br /&gt;
Using your texture guide, work out (or guess) the roughness and metallic values for the various areas, editing the appropriate layer only, and ensuring you only add colours of that channel - e.g. ensure that &amp;quot;R&amp;quot; and &amp;quot;G&amp;quot; are set to 0.0 when working on the metallic (B) channel.  See the example image which has some high metallic surfaces (top left  blue and cyan), some rougher surfaces towards the bottom (light green) and various ambient occlusion textures (seen as the ghostly outline of the wings and fuselage with darker areas where the wings meet the fuselage).  &lt;br /&gt;
&lt;br /&gt;
Save the texture as a .xcf as you work, as the final baked .png texture will combine the channels.&lt;br /&gt;
&lt;br /&gt;
Once you are happy with your texture, reload it into Blender, and link it into the Principled BSDF shader as shown in the diagram above.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142644</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142644"/>
		<updated>2025-10-08T21:59:30Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Putting together the ORM texture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You may need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
[[File:Screenshot from 2025-10-07 21-27-16.png|thumb|Blender shader settings using OSM texture]]glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect to glTF files, which should be used unchanged by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
The only Effect that should be applied direclty is &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  &lt;br /&gt;
&lt;br /&gt;
The main texture is purely used for the base colour of the material, unlike in 2024.1, where it might also include an ambient occlusion texture and emulate roughness and the sheen of metallic materials.&lt;br /&gt;
&lt;br /&gt;
Principled BSDF can take Metallic and Roughness values direct from the Material entry in Blender.  However this generates lots of materials, which is undesirable from a performance perspective.  glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which has (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values in the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion (AO) ===&lt;br /&gt;
Blender can render a texture for ambient occlusion (See &amp;quot;Bake&amp;quot; under the Editor properties).  Unfortunately, it will bake to a grayscale texture, when what we require is the occlusion information written to the red channel of the ORM texture.&lt;br /&gt;
&lt;br /&gt;
Additionally, Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node for it to be exported properly.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;br /&gt;
&lt;br /&gt;
=== Putting together the ORM texture ===&lt;br /&gt;
[[File:Orm texture.png|thumb|Example ORM texture (Occlusion, Roughness, Metallic)  for PBR]]The ORM texture uses channels for different information:&lt;br /&gt;
&lt;br /&gt;
* Red - Ambient Occlusion&lt;br /&gt;
* Green - Roughness (0 = smooth, 1 = rough)&lt;br /&gt;
* Blue - Metallic (0 = non metallic, 1 = metallic)&lt;br /&gt;
&lt;br /&gt;
The easiest way to manage this is to have separate layers for each channel.  To generate this in GIMP:&lt;br /&gt;
&lt;br /&gt;
# Open the Baked AO texture from Blender&lt;br /&gt;
# Make only the Red channel visible&lt;br /&gt;
# Use  Layer -&amp;gt; New from Visible to create a layer containing only Red information.  Label this &amp;quot;Occlusion - R&amp;quot; so you don't forget&lt;br /&gt;
# Create two layers above this. Under Layer Attributes change the mode to &amp;quot;Addition&amp;quot;, and label them &amp;quot;Roughness - G&amp;quot; and &amp;quot;Metallic - B&amp;quot; respectively&lt;br /&gt;
# Delete the bottom later which contains the grayscale AO texture.&lt;br /&gt;
&lt;br /&gt;
You should now have 3 layers, one with a red image of the AO, and two layers with no information.&lt;br /&gt;
&lt;br /&gt;
Using your texture guide, work out (or guess) the roughness and metallic values for the various areas, editing the appropriate layer only, and ensuring you only add colours of that channel - e.g. ensure that &amp;quot;R&amp;quot; and &amp;quot;G&amp;quot; are set to 0.0 when working on the metallic (B) channel.  See the example image which has some high metallic surfaces (top left  blue and cyan), some rougher surfaces towards the bottom (light green) and various ambient occlusion textures (seen as the ghostly outline of the wings and fuselage with darker areas where the wings meet the fuselage).  &lt;br /&gt;
&lt;br /&gt;
Save the texture as a .xcf as you work, as the final baked .png texture will combine the channels.&lt;br /&gt;
&lt;br /&gt;
Once you are happy with your texture, reload it into Blender, and link it into the Principled BSDF shader as shown in the diagram above.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:Orm_texture.png&amp;diff=142643</id>
		<title>File:Orm texture.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:Orm_texture.png&amp;diff=142643"/>
		<updated>2025-10-08T21:56:39Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Example ORM texture for PBR rendering&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this case there is a small amount of high metallic in the top and middle left, and variable amounts of roughness.  The Occlusion channel can be seen as the ghost-like outline of the wings etc.&lt;br /&gt;
&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=Example ORM texture (Occlusion, Roughness, Metallic)  for PBR}}&lt;br /&gt;
|date=2025-10-08&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Stuart|Stuart]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Modeling]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142642</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142642"/>
		<updated>2025-10-08T21:54:19Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Putting together the ORM texture */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You may need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
[[File:Screenshot from 2025-10-07 21-27-16.png|thumb|Blender shader settings using OSM texture]]glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect to glTF files, which should be used unchanged by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
The only Effect that should be applied direclty is &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  &lt;br /&gt;
&lt;br /&gt;
The main texture is purely used for the base colour of the material, unlike in 2024.1, where it might also include an ambient occlusion texture and emulate roughness and the sheen of metallic materials.&lt;br /&gt;
&lt;br /&gt;
Principled BSDF can take Metallic and Roughness values direct from the Material entry in Blender.  However this generates lots of materials, which is undesirable from a performance perspective.  glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which has (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values in the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion (AO) ===&lt;br /&gt;
Blender can render a texture for ambient occlusion (See &amp;quot;Bake&amp;quot; under the Editor properties).  Unfortunately, it will bake to a grayscale texture, when what we require is the occlusion information written to the red channel of the ORM texture.&lt;br /&gt;
&lt;br /&gt;
Additionally, Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node for it to be exported properly.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;br /&gt;
&lt;br /&gt;
=== Putting together the ORM texture ===&lt;br /&gt;
[[File:Orm texture.png|thumb|Example ORM texture (Occlusion, Roughness, Metallic)  for PBR]]The ORM texture uses channels for different information:&lt;br /&gt;
&lt;br /&gt;
* Red - Ambient Occlusion&lt;br /&gt;
* Green - Roughness (0 = smooth, 1 = rough)&lt;br /&gt;
* Blue - Metallic (0 = non metallic, 1 = metallic)&lt;br /&gt;
&lt;br /&gt;
The easiest way to manage this is to have separate layers for each channel.  To generate this in GIMP:&lt;br /&gt;
&lt;br /&gt;
# Open the Baked AO texture from Blender&lt;br /&gt;
# Make only the Red channel visible&lt;br /&gt;
# Use  Layer -&amp;gt; New from Visible to create a layer containing only Red information.  Label this &amp;quot;Occlusion - R&amp;quot; so you don't forget&lt;br /&gt;
# Create two layers above this. Under Layer Attributes change the mode to &amp;quot;Addition&amp;quot;, and label them &amp;quot;Roughness - G&amp;quot; and &amp;quot;Metallic - B&amp;quot; respectively&lt;br /&gt;
# Delete the bottom later which contains the grayscale AO texture.&lt;br /&gt;
&lt;br /&gt;
You should now have 3 layers, one with a red image of the AO, and two layers with no information.&lt;br /&gt;
&lt;br /&gt;
Using your texture guide, work out (or guess) the roughness and metallic values for the various areas, editing the appropriate layer only, and ensuring you only add colours of that channel - e.g. ensure that &amp;quot;R&amp;quot; and &amp;quot;G&amp;quot; are set to 0.0 when working on the metallic (B) channel.  &lt;br /&gt;
&lt;br /&gt;
Save the texture as a .xcf as you work, as the final baked .png texture will combine the channels.&lt;br /&gt;
&lt;br /&gt;
Once you are happy with your texture, reload it into Blender, and link it into the Principled BSDF shader as shown in the diagram above.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:Orm_texture.png&amp;diff=142641</id>
		<title>File:Orm texture.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:Orm_texture.png&amp;diff=142641"/>
		<updated>2025-10-08T21:53:46Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Uploaded own work with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=Example ORM texture (Occlusion, Roughness, Metallic)  for PBR}}&lt;br /&gt;
|date=2025-10-08&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Stuart|Stuart]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Modeling]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142640</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142640"/>
		<updated>2025-10-07T22:23:11Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Ambient Occlusion (AO) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You may need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
[[File:Screenshot from 2025-10-07 21-27-16.png|thumb|Blender shader settings using OSM texture]]glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect to glTF files, which should be used unchanged by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
The only Effect that should be applied direclty is &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  &lt;br /&gt;
&lt;br /&gt;
The main texture is purely used for the base colour of the material, unlike in 2024.1, where it might also include an ambient occlusion texture and emulate roughness and the sheen of metallic materials.&lt;br /&gt;
&lt;br /&gt;
Principled BSDF can take Metallic and Roughness values direct from the Material entry in Blender.  However this generates lots of materials, which is undesirable from a performance perspective.  glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which has (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values in the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion (AO) ===&lt;br /&gt;
Blender can render a texture for ambient occlusion (See &amp;quot;Bake&amp;quot; under the Editor properties).  Unfortunately, it will bake to a grayscale texture, when what we require is the occlusion information written to the red channel of the ORM texture.&lt;br /&gt;
&lt;br /&gt;
Additionally, Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node for it to be exported properly.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;br /&gt;
&lt;br /&gt;
=== Putting together the ORM texture ===&lt;br /&gt;
The ORM texture uses channels for different information:&lt;br /&gt;
&lt;br /&gt;
* Red - Ambient Occlusion&lt;br /&gt;
* Green - Roughness (0 = smooth, 1 = rough)&lt;br /&gt;
* Blue - Metallic (0 = non metallic, 1 = metallic)&lt;br /&gt;
&lt;br /&gt;
The easiest way to manage this is to have separate layers for each channel.  To generate this in GIMP:&lt;br /&gt;
&lt;br /&gt;
# Open the Baked AO texture from Blender&lt;br /&gt;
# Make only the Red channel visible&lt;br /&gt;
# Use  Layer -&amp;gt; New from Visible to create a layer containing only Red information.  Label this &amp;quot;Occlusion - R&amp;quot; so you don't forget&lt;br /&gt;
# Create two layers above this. Under Layer Attributes change the mode to &amp;quot;Addition&amp;quot;, and label them &amp;quot;Roughness - G&amp;quot; and &amp;quot;Metallic - B&amp;quot; respectively&lt;br /&gt;
# Delete the bottom later which contains the grayscale AO texture.&lt;br /&gt;
&lt;br /&gt;
You should now have 3 layers, one with a red image of the AO, and two layers with no information.&lt;br /&gt;
&lt;br /&gt;
Using your texture guide, work out (or guess) the roughness and metallic values for the various areas, editing the appropriate layer only, and ensuring you only add colours of that channel - e.g. ensure that &amp;quot;R&amp;quot; and &amp;quot;G&amp;quot; are set to 0.0 when working on the metallic (B) channel.  &lt;br /&gt;
&lt;br /&gt;
Save the texture as a .xcf as you work, as the final baked .png texture will combine the channels.&lt;br /&gt;
&lt;br /&gt;
Once you are happy with your texture, reload it into Blender, and link it into the Principled BSDF shader as shown in the diagram above.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142639</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142639"/>
		<updated>2025-10-07T22:05:43Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You may need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear glTF will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect, which replicates this, and should be used by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
There is also a &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  The main texture is purely used for the base colour of the material.&lt;br /&gt;
&lt;br /&gt;
Blender Principled BSDF will take Metallic and Roughness values direct from the Material entry.  However glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which will have (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values across the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion (AO) ===&lt;br /&gt;
Blender can render a texture for ambient occlusion.  It will use the same UV coordinates as the main texture, so it is important that you don't have overlapping UV coordinates.  The option to bake an ambient occlusion can be found under Render on the Editor properties, under Bake. You will need to set Ambient Occlusion as the Bake type.  I have found the Bake to sometimes crash Blender.  One can work around this by baking only part of the model at a time, without setting the &amp;quot;clear&amp;quot; option so that the additionally baked AO is added to the texture.&lt;br /&gt;
&lt;br /&gt;
It will also bake to a full RGB image, when what you need for an ORM texture is just the R channel.  You will need to use an image editor (e.g. GIMP) to convert the baked AO texture to the R channel.&lt;br /&gt;
&lt;br /&gt;
Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;br /&gt;
&lt;br /&gt;
=== Putting together the ORM texture ===&lt;br /&gt;
The ORM texture needs to have different values in different channels:&lt;br /&gt;
&lt;br /&gt;
* Red - Ambient Occlusion&lt;br /&gt;
* Green - Roughness (0 = smooth, 1 = rough)&lt;br /&gt;
* Blue - Metallic (0 = non metallic, 1 = metallic)&lt;br /&gt;
&lt;br /&gt;
To generate this in GIMP:&lt;br /&gt;
&lt;br /&gt;
# Open the Baked AO texture from Blender&lt;br /&gt;
# Make only the Red channel visible&lt;br /&gt;
# Use  Layer -&amp;gt; New from Visible to create a layer containing only Red information.  Label this &amp;quot;Occlusion - R&amp;quot; so you don't forget&lt;br /&gt;
# Create two layers above this. Under Layer Attributes change the mode to &amp;quot;Addition&amp;quot;, and label them &amp;quot;Roughness - G&amp;quot; and &amp;quot;Metallic - B&amp;quot; respectively&lt;br /&gt;
# Delete the bottom later which contains the grayscale AO texture.&lt;br /&gt;
&lt;br /&gt;
You should now have 3 layers, one with a red image of the AO, and two layers with no information.&lt;br /&gt;
&lt;br /&gt;
Using your texture guide, work out (or guess) the roughness and metallic values for the various areas, editing the appropriate layer only, and ensuring you only add colours of that channel - e.g. ensure that &amp;quot;R&amp;quot; and &amp;quot;G&amp;quot; are set to 0.0 when working on the metallic (B) channel.  &lt;br /&gt;
&lt;br /&gt;
Save the texture as a .xcf as you work, as the final baked .png texture will combine the channels.&lt;br /&gt;
&lt;br /&gt;
Once you are happy with your texture, reload it into Blender, and link it into the Principled BSDF shader as follows:&lt;br /&gt;
[[File:Screenshot from 2025-10-07 21-27-16.png|thumb|Blender shader settings using OSM texture]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:Screenshot_from_2025-10-07_21-27-16.png&amp;diff=142638</id>
		<title>File:Screenshot from 2025-10-07 21-27-16.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:Screenshot_from_2025-10-07_21-27-16.png&amp;diff=142638"/>
		<updated>2025-10-07T22:04:19Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{DISPLAYTITLE:File:BlenderPrincipledBSDF.png}}&lt;br /&gt;
&lt;br /&gt;
=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=Blender Principled BSDF shader settings for ORM texture}}&lt;br /&gt;
|date=2025-10-07&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Stuart|Stuart]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Blender bake]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:Screenshot_from_2025-10-07_21-27-16.png&amp;diff=142637</id>
		<title>File:Screenshot from 2025-10-07 21-27-16.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:Screenshot_from_2025-10-07_21-27-16.png&amp;diff=142637"/>
		<updated>2025-10-07T22:03:13Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Uploaded own work with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=Blender Principled BSDF shader settings for ORM texture}}&lt;br /&gt;
|date=2025-10-07&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Stuart|Stuart]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Blender bake]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142636</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142636"/>
		<updated>2025-10-07T22:00:42Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You may need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear glTF will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect, which replicates this, and should be used by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
There is also a &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  The main texture is purely used for the base colour of the material.&lt;br /&gt;
&lt;br /&gt;
Blender Principled BSDF will take Metallic and Roughness values direct from the Material entry.  However glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which will have (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values across the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion (AO) ===&lt;br /&gt;
Blender can render a texture for ambient occlusion.  It will use the same UV coordinates as the main texture, so it is important that you don't have overlapping UV coordinates.  The option to bake an ambient occlusion can be found under Render on the Editor properties, under Bake. You will need to set Ambient Occlusion as the Bake type.  I have found the Bake to sometimes crash Blender.  One can work around this by baking only part of the model at a time, without setting the &amp;quot;clear&amp;quot; option so that the additionally baked AO is added to the texture.&lt;br /&gt;
&lt;br /&gt;
It will also bake to a full RGB image, when what you need for an ORM texture is just the R channel.  You will need to use an image editor (e.g. GIMP) to convert the baked AO texture to the R channel.&lt;br /&gt;
&lt;br /&gt;
Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;br /&gt;
&lt;br /&gt;
=== Putting together the ORM texture ===&lt;br /&gt;
The ORM texture needs to have different values in different channels:&lt;br /&gt;
&lt;br /&gt;
* Red - Ambient Occlusion&lt;br /&gt;
* Green - Roughness (0 = smooth, 1 = rough)&lt;br /&gt;
* Blue - Metallic (0 = non metallic, 1 = metallic)&lt;br /&gt;
&lt;br /&gt;
To generate this in GIMP:&lt;br /&gt;
&lt;br /&gt;
# Open the Baked AO texture from Blender&lt;br /&gt;
# Make only the Red channel visible&lt;br /&gt;
# Use  Layer -&amp;gt; New from Visible to create a layer containing only Red information.  Label this &amp;quot;Occlusion - R&amp;quot; so you don't forget&lt;br /&gt;
# Create two layers above this. Under Layer Attributes change the mode to &amp;quot;Addition&amp;quot;, and label them &amp;quot;Roughness - G&amp;quot; and &amp;quot;Metallic - B&amp;quot; respectively&lt;br /&gt;
# Delete the bottom later which contains the grayscale AO texture.&lt;br /&gt;
&lt;br /&gt;
You should now have 3 layers, one with a red image of the AO, and two layers with no information.&lt;br /&gt;
&lt;br /&gt;
Using your texture guide, work out (or guess) the roughness and metallic values for the various areas, editing the appropriate layer only, and ensuring you only add colours of that channel - e.g. ensure that &amp;quot;R&amp;quot; and &amp;quot;G&amp;quot; are set to 0.0 when working on the metallic (B) channel.  &lt;br /&gt;
&lt;br /&gt;
Save the texture as a .xcf as you work, as the final baked .png texture will combine the channels.&lt;br /&gt;
&lt;br /&gt;
Once you are happy with your texture, reload it into Blender, and link it into the Principled BSDF shader as follows:&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142635</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142635"/>
		<updated>2025-10-07T21:58:19Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You may need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear glTF will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect, which replicates this, and should be used by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
There is also a &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  The main texture is purely used for the base colour of the material.&lt;br /&gt;
&lt;br /&gt;
Blender Principled BSDF will take Metallic and Roughness values direct from the Material entry.  However glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which will have (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values across the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion (AO) ===&lt;br /&gt;
Blender can render a texture for ambient occlusion.  It will use the same UV coordinates as the main texture, so it is important that you don't have overlapping UV coordinates.  The option to bake an ambient occlusion can be found under Render on the Editor properties, under Bake. You will need to set Ambient Occlusion as the Bake type.  I have found the Bake to sometimes crash Blender.  One can work around this by baking only part of the model at a time, without setting the &amp;quot;clear&amp;quot; option so that the additionally baked AO is added to the texture.&lt;br /&gt;
&lt;br /&gt;
It will also bake to a full RGB image, when what you need for an ORM texture is just the R channel.  You will need to use an image editor (e.g. GIMP) to convert the baked AO texture to the R channel.&lt;br /&gt;
&lt;br /&gt;
Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;br /&gt;
&lt;br /&gt;
=== Putting together the ORM texture ===&lt;br /&gt;
The ORM texture needs to have different values in different channels:&lt;br /&gt;
&lt;br /&gt;
* Red - Ambient Occlusion&lt;br /&gt;
* Green - Roughness (0 = smooth, 1 = rough)&lt;br /&gt;
* Blue - Metallic (0 = non metallic, 1 = metallic)&lt;br /&gt;
&lt;br /&gt;
To generate this in GIMP:&lt;br /&gt;
&lt;br /&gt;
# Open the Baked AO texture from Blender&lt;br /&gt;
# Make only the Red channel visible&lt;br /&gt;
# Use  Layer -&amp;gt; New from Visible to create a layer containing only Red information.  Label this &amp;quot;Occlusion - R&amp;quot; so you don't forget&lt;br /&gt;
# Create two layers above this. Under Layer Attributes change the mode to &amp;quot;Addition&amp;quot;, and label them &amp;quot;Roughness - G&amp;quot; and &amp;quot;Metallic - B&amp;quot; respectively&lt;br /&gt;
# Delete the bottom later which contains the grayscale AO texture.&lt;br /&gt;
&lt;br /&gt;
You should now have 3 layers, one with a red image of the AO, and two layers with no information.&lt;br /&gt;
&lt;br /&gt;
Using your texture guide, work out (or guess) the roughness and metallic values for the various areas, editing the appropriate layer only, and ensuring you only add colours of that channel - e.g. ensure that &amp;quot;R&amp;quot; and &amp;quot;G&amp;quot; are set to 0.0 when working on the metallic (B) channel.  &lt;br /&gt;
&lt;br /&gt;
Save the texture as a .xcf as you work, as the final baked .png texture will combine the channels.&lt;br /&gt;
&lt;br /&gt;
Once you are happy with your texture, reload it into Blender.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142630</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142630"/>
		<updated>2025-10-06T20:33:19Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You will need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear glTF will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect, which replicates this, and should be used by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
There is also a &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  The main texture is purely used for the base colour of the material.&lt;br /&gt;
&lt;br /&gt;
Blender Principled BSDF will take Metallic and Roughness values direct from the Material entry.  However glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which will have (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values across the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion (AO) ===&lt;br /&gt;
Blender can render a texture for ambient occlusion.  It will use the same UV coordinates as the main texture, so it is important that you don't have overlapping UV coordinates.  The option to bake an ambient occlusion can be found under Render on the Editor properties, under Bake. You will need to set Ambient Occlusion as the Bake type.  I have found the Bake to sometimes crash Blender.  One can work around this by baking only part of the model at a time, without setting the &amp;quot;clear&amp;quot; option so that the additionally baked AO is added to the texture.&lt;br /&gt;
&lt;br /&gt;
It will also bake to a full RGB image, when what you need for an ORM texture is just the R channel.  You will need to use an image editor (e.g. GIMP) to convert the baked AO texture to the R channel.&lt;br /&gt;
&lt;br /&gt;
Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;br /&gt;
&lt;br /&gt;
=== Putting together the ORM texture ===&lt;br /&gt;
The ORM texture needs to have different values in different channels:&lt;br /&gt;
&lt;br /&gt;
* Red - Ambient Occlusion&lt;br /&gt;
* Green - Roughness (0 = smooth, 1 = rough)&lt;br /&gt;
* Blue - Metallic (0 = non metallic, 1 = metallic)&lt;br /&gt;
&lt;br /&gt;
To generate this in GIMP:&lt;br /&gt;
&lt;br /&gt;
# Open the Baked AO texture from Blender&lt;br /&gt;
# Make only the Red channel visible&lt;br /&gt;
# Use  Layer -&amp;gt; New from Visible to create a layer containing only Red information.  Label this &amp;quot;Occlusion - R&amp;quot; so you don't forget&lt;br /&gt;
# Create two layers above this. Under Layer Attributes change the mode to &amp;quot;Addition&amp;quot;, and label them &amp;quot;Roughness - G&amp;quot; and &amp;quot;Metallic - B&amp;quot; respectively&lt;br /&gt;
# Delete the bottom later which contains the grayscale AO texture.&lt;br /&gt;
&lt;br /&gt;
You should now have 3 layers, one with a red image of the AO, and two layers with no information.&lt;br /&gt;
&lt;br /&gt;
Using your texture guide, work out (or guess) the roughness and metallic values for the various areas, editing the appropriate layer only, and ensuring you only add colours of that channel - e.g. ensure that &amp;quot;R&amp;quot; and &amp;quot;G&amp;quot; are set to 0.0 when working on the metallic (B) channel.  &lt;br /&gt;
&lt;br /&gt;
Save the texture as a .xcf as you work, as the final baked .png texture will combine the channels.&lt;br /&gt;
&lt;br /&gt;
Once you are happy with your texture, reload it into Blender.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142629</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142629"/>
		<updated>2025-10-06T20:01:15Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You will need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear glTF will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect, which replicates this, and should be used by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
There is also a &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  The main texture is purely used for the base colour of the material.&lt;br /&gt;
&lt;br /&gt;
Blender Principled BSDF will take Metallic and Roughness values direct from the Material entry.  However glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which will have (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values across the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion ===&lt;br /&gt;
Blender can render a texture for ambient occlusion.  It will use the same UV coordinates as the main texture, so it is important that you don't have overlapping UV coordinates.  The option to bake an ambient occlusion can be found under Render on the Editor properties, under Bake. You will need to set Ambient Occlusion as the Bake type.  I have found the Bake to sometimes crash Blender.  One can work around this by baking only part of the model at a time, without setting the &amp;quot;clear&amp;quot; option so that the additionally baked AO is added to the texture.&lt;br /&gt;
&lt;br /&gt;
It will also bake to a full RGB image, when what you need for an ORM texture is just the R channel.  You will need to use an image editor (e.g. GIMP) to convert the baked AO texture to the R channel.&lt;br /&gt;
&lt;br /&gt;
Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142628</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142628"/>
		<updated>2025-10-06T19:55:29Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You will need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear glTF will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect, which replicates this, and should be used by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
There is also a &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  The main texture is purely used for the base colour of the material.&lt;br /&gt;
&lt;br /&gt;
Blender Principled BSDF will take Metallic and Roughness values direct from the Material entry.  However glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which will have (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values across the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion ===&lt;br /&gt;
Blender can render a texture for ambient occlusion.  It will use the same UV coordinates as the main texture, so it is important that you don't have overlapping UV coordinates.  The option to bake an ambient occlusion can be found under Render on the Editor properties, under Bake. You will need to set Ambient Occlusion as the Bake type.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
It will also bake to a full RGB image, when what you need for an ORM texture is just the R channel.  You will need to use an image editor (e.g. GIMP) to convert the baked AO texture to the R channel.&lt;br /&gt;
&lt;br /&gt;
Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142627</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142627"/>
		<updated>2025-10-06T19:52:53Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
== Importing AC3D to Blender ==&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
== XML Changes ==&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically, under &amp;lt;code&amp;gt;&amp;lt;sim&amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
 &amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
and&lt;br /&gt;
 &amp;lt;compatibility&amp;gt;&lt;br /&gt;
   &amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
 &amp;lt;/compatibility&amp;gt;&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
== Animations ==&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You will need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
Example: Aileron rotation using two sets of points:&lt;br /&gt;
&lt;br /&gt;
2024.1.3&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt;  3.357 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -0.304 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt;  1.186 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -0.383 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
2024.2.0&lt;br /&gt;
 &amp;lt;animation&amp;gt;&lt;br /&gt;
   &amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
   &amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
   &amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
   &amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
   &amp;lt;axis&amp;gt;&lt;br /&gt;
     &amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
     &amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
     &amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
     &amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
     &amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
     &amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
   &amp;lt;/axis&amp;gt;&lt;br /&gt;
 &amp;lt;/animation&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Effects ==&lt;br /&gt;
glTF by default has what's known as a &amp;quot;Principled BSDF&amp;quot; surface model [https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/principled.html]&lt;br /&gt;
&lt;br /&gt;
FlightGear glTF will automatically assign the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; Effect, which replicates this, and should be used by aircraft.  If you find yourself wanting to add an effect, talk to the core team - it may make more sense to enhance the model-pbr effect.&lt;br /&gt;
&lt;br /&gt;
There is also a &amp;lt;code&amp;gt;model-transparent-pbr&amp;lt;/code&amp;gt; Effect which should be used for transparent objects.&lt;br /&gt;
&lt;br /&gt;
== Textures ==&lt;br /&gt;
PBR uses a set of properties of materials to render surfaces with much greater accuracy than previous rendering methods.  As such, the use of textures is somewhat different.  The main texture is purely used for the base colour of the material.&lt;br /&gt;
&lt;br /&gt;
Blender Principled BSDF will take Metallic and Roughness values direct from the Material entry.  However glTF  (and the &amp;lt;code&amp;gt;model-pbr&amp;lt;/code&amp;gt; effect) supports using an additional texture which will have (Ambient) Occlusion, Roughness and Metallic information in the RGB channels.  This allows you to adjust the roughness and metallic values across the texture itself - for example to mimic polished areas of surfaces.  It also allows much more naturalistic rendering of occlusion.  &lt;br /&gt;
&lt;br /&gt;
=== Ambient Occlusion ===&lt;br /&gt;
Blender can render a texture for ambient occlusion.  It will use the same UV coordinates as the main texture, so it is important that you don't have overlapping UV coordinates.  It will also bake to a full RGB image, when what you need for an ORM texture is just the R channel.  You will need to use an image editor (e.g. GIMP) to convert the baked AO texture to the R channel.&lt;br /&gt;
&lt;br /&gt;
Blender support for Ambient Occlusion in glTF is a bit of hack on Blender's part, and you need to create a special node.  See https://docs.blender.org/manual/en/latest/addons/import_export/scene_gltf2.html.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142626</id>
		<title>Howto:Convert from AC3D to glTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=142626"/>
		<updated>2025-10-06T18:46:28Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Created page with &amp;quot;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.  Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!  === Importing AC3D to Blende...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This guide is targeted at aircraft developers wanting to get started converting AC3D models to glTF models supporting PBR/HDR and suitable for 2024.2.&lt;br /&gt;
&lt;br /&gt;
Caveat: The author is not an aircraft developers, and this guide will focus only on the main processes involved.  It also assumes use of Blender 4.5.3 LTS.  We are using as an example Emmanuel Baranger's Stampe-SV4 as a simple aircraft but with nice animations and materials.  Thanks Emmanuel!&lt;br /&gt;
&lt;br /&gt;
=== Importing AC3D to Blender ===&lt;br /&gt;
See [[Howto:Work with AC3D files in Blender]].   For Blender 4.5.3 on Linux I had to install the importer to &amp;lt;code&amp;gt;$HOME/.config/blender/4.5/extensions/user_default/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default, the .ac file will be imported with a &amp;quot;Principled BSDF&amp;quot; surface, and can be exported our as .glTF.  See [[GlTF]] for details of the export settings to use.&lt;br /&gt;
&lt;br /&gt;
=== XML Changes ===&lt;br /&gt;
Obviously you need to change the model.xml file to reference the .glTF file rather than .ac.&lt;br /&gt;
&lt;br /&gt;
You should also take the opportunity to set the appropriate -set.xml files entries.&lt;br /&gt;
&lt;br /&gt;
Specifically&lt;br /&gt;
&lt;br /&gt;
&amp;lt;minimum-fg-version&amp;gt;2024.2.0&amp;lt;/minimum-fg-version&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;compatibility&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pbr-model&amp;gt;true&amp;lt;/pbr-model&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/compatibility&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will ensure that the aircraft is displayed correctly within the launcher.&lt;br /&gt;
&lt;br /&gt;
=== Animations ===&lt;br /&gt;
Unfortunately the axis for animations are different between .ac and .glTF.  You will need to swap the Y and Z axis, and reverse the Z axis.&lt;br /&gt;
&lt;br /&gt;
This is easiest seen by an example, and is fairly easy to do semi-mechanically by going through an animation file.  Fortunately the X (forward/backwards) axis is unchanged, so more steam gauges should work unchanged.&lt;br /&gt;
&lt;br /&gt;
 asdasd&lt;br /&gt;
&amp;lt;animation&amp;gt;&lt;br /&gt;
&amp;lt;type&amp;gt;rotate&amp;lt;/type&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;object-name&amp;gt;aileronBD&amp;lt;/object-name&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;property&amp;gt;surface-positions/right-aileron-pos-norm&amp;lt;/property&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;factor&amp;gt;-15&amp;lt;/factor&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;x1-m&amp;gt; -0.393 &amp;lt;/x1-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;y1-m&amp;gt; -0.304 &amp;lt;/y1-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;z1-m&amp;gt; -3.357 &amp;lt;/z1-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;x2-m&amp;gt; -0.698 &amp;lt;/x2-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;y2-m&amp;gt; -0.383 &amp;lt;/y2-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;z2-m&amp;gt; -1.186 &amp;lt;/z2-m&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/axis&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/animation&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Random_vegetation&amp;diff=141272</id>
		<title>Random vegetation</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Random_vegetation&amp;diff=141272"/>
		<updated>2025-01-24T21:51:38Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Random Vegetation is the system that generates trees, bushes and other vegetation on scenery.   It is sometimes referred to as &amp;quot;Random Trees&amp;quot;, and tree is often used as a synonym for vegetation throughout the system and documentation.  For simplicity, this article will refer to &amp;quot;trees&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The location of trees can be defined in two ways:&lt;br /&gt;
&lt;br /&gt;
* Random distribution within an area of the scenery, with distribution controlled by parameters in materials.xml&lt;br /&gt;
* Explicit placement defined in a tile by a TREE_LIST entry in the scenery STG file.  Typically generated automatically from openstreetmap data by osm2city.&lt;br /&gt;
&lt;br /&gt;
In both cases, the material definition in  materials.xml file controls parameters such as the tree height, width the texture used,&lt;br /&gt;
&lt;br /&gt;
The trees themselves are rendered using two (3 post 2024.1) rectangles in a cross shape.&lt;br /&gt;
&lt;br /&gt;
See the README.materials file for information on the specific parameters.&lt;br /&gt;
[[File:PBR trees.jpg|thumb|PBR tree showing normal map.]]&lt;br /&gt;
&lt;br /&gt;
=== Tree Texture ===&lt;br /&gt;
The tree textures (tree-texture and tree-normal-map parameters) are png files that provide an atlas of textures to use when rendering individual trees, so there is a variety of trees.&lt;br /&gt;
&lt;br /&gt;
Horizontally, the texture contains a number of individual tree textures defined by the &amp;quot;tree-varieties&amp;quot; parameter.  Typically 8 for tall thin trees, and 4 for broader trees.&lt;br /&gt;
&lt;br /&gt;
Vertically, each tree has 4 textures to cover in four possible states:  &lt;br /&gt;
&lt;br /&gt;
# summer, &lt;br /&gt;
# snow covered in summer&lt;br /&gt;
# winter,&lt;br /&gt;
# snow covered in winter&lt;br /&gt;
&lt;br /&gt;
Post 2024.X, there is an additional tree-normal-map, which is an png normal map file with the same layout used by PBR rendering.&lt;br /&gt;
&lt;br /&gt;
=== Generating PBR Trees ===&lt;br /&gt;
Due to the need to generate a normal map, the traditional approach of just painting a texture does not work for PBR trees.  Instead, we use an approach of creating a tree model in Blender and then rendering a base colour texture and a normal map texture.  This approach is described well on youtube (e.g. https://www.youtube.com/watch?v=_GCy98O9S58&amp;amp;t=888s, https://www.youtube.com/watch?v=Ix-KT9a4PSo).&lt;br /&gt;
&lt;br /&gt;
Useful notes for arborealists:&lt;br /&gt;
&lt;br /&gt;
* The tree-template.blend file in fgdata provides a useful starting point, with an appropriate camera and light set up already, solid shading set to display the normalmap, and some basic material definitions.  So you can easily select the color map (Viewport Shading) or normal map (solid shading).&lt;br /&gt;
* To render the color map, simply press F12, wait for rendering to finish, and save the result.&lt;br /&gt;
* To render the normal map, select Solid Shading, then the camera viewpoint (num-pad 0), then select View-&amp;gt;Viewport Render Image&lt;br /&gt;
* Use Sapling Tree Gen or another add-on to create the initial trees.  You can save presets, which is useful.&lt;br /&gt;
* There will be 3 copies of the texture rendered at different angles, so the tree texture itself can be sparse.&lt;br /&gt;
* The tree needs to be completely vertical.  This is particularly important for conifers which come to a point.&lt;br /&gt;
* Each tree must have a little space at the top. Otherwise subsequent rendering results in &amp;quot;top hats&amp;quot; above trees in the distance where the trunk of the tree above in the textures sheet bleeds downwards when the mipmaps are generated.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:PBR_trees.jpg&amp;diff=141271</id>
		<title>File:PBR trees.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:PBR_trees.jpg&amp;diff=141271"/>
		<updated>2025-01-24T21:50:50Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Uploaded own work with UploadWizard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=={{int:filedesc}}==&lt;br /&gt;
{{Information&lt;br /&gt;
|description={{en|1=Examples of PBR trees with normal maps in different lights.  Note the different shading on the bottom of the trunk and edges of the conifers in particular.}}&lt;br /&gt;
|date=2025-01-24 21:48:44&lt;br /&gt;
|source={{own}}&lt;br /&gt;
|author=[[User:Stuart|Stuart]]&lt;br /&gt;
|permission=&lt;br /&gt;
|other versions=&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
=={{int:license-header}}==&lt;br /&gt;
{{self|cc-by-sa-4.0}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery]]&lt;br /&gt;
[[Category:PBR]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Random_vegetation&amp;diff=141270</id>
		<title>Random vegetation</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Random_vegetation&amp;diff=141270"/>
		<updated>2025-01-24T13:22:32Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Random Vegetation is the system that generates trees, bushes and other vegetation on scenery.   It is sometimes referred to as &amp;quot;Random Trees&amp;quot;, and tree is often used as a synonym for vegetation throughout the system and documentation.  For simplicity, this article will refer to &amp;quot;trees&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The location of trees can be defined in two ways:&lt;br /&gt;
&lt;br /&gt;
* Random distribution within an area of the scenery, with distribution controlled by parameters in materials.xml&lt;br /&gt;
* Explicit placement defined in a tile by a TREE_LIST entry in the scenery STG file.  Typically generated automatically from openstreetmap data by osm2city.&lt;br /&gt;
&lt;br /&gt;
In both cases, the material definition in  materials.xml file controls parameters such as the tree height, width the texture used,&lt;br /&gt;
&lt;br /&gt;
The trees themselves are rendered using two (3 post 2024.1) rectangles in a cross shape.&lt;br /&gt;
&lt;br /&gt;
See the README.materials file for information on the specific parameters.&lt;br /&gt;
&lt;br /&gt;
=== Tree Texture ===&lt;br /&gt;
The tree textures (tree-texture and tree-normal-map parameters) are png files that provide an atlas of textures to use when rendering individual trees, so there is a variety of trees.&lt;br /&gt;
&lt;br /&gt;
Horizontally, the texture contains a number of individual tree textures defined by the &amp;quot;tree-varieties&amp;quot; parameter.  Typically 8 for tall thin trees, and 4 for broader trees.&lt;br /&gt;
&lt;br /&gt;
Vertically, each tree has 4 textures to cover in four possible states:  &lt;br /&gt;
&lt;br /&gt;
# summer, &lt;br /&gt;
# snow covered in summer&lt;br /&gt;
# winter,&lt;br /&gt;
# snow covered in winter&lt;br /&gt;
&lt;br /&gt;
Post 2024.X, there is an additional tree-normal-map, which is an png normal map file with the same layout used by PBR rendering.&lt;br /&gt;
&lt;br /&gt;
=== Generating PBR Trees ===&lt;br /&gt;
Due to the need to generate a normal map, the traditional approach of just painting a texture does not work for PBR trees.  Instead, we use an approach of creating a tree model in Blender and then rendering a base colour texture and a normal map texture.  This approach is described well on youtube (e.g. https://www.youtube.com/watch?v=_GCy98O9S58&amp;amp;t=888s, https://www.youtube.com/watch?v=Ix-KT9a4PSo).&lt;br /&gt;
&lt;br /&gt;
Useful notes for arborealists:&lt;br /&gt;
&lt;br /&gt;
* The tree-template.blend file in fgdata provides a useful starting point, with an appropriate camera and light set up already, solid shading set to display the normalmap, and some basic material definitions.  So you can easily select the color map (Viewport Shading) or normal map (solid shading).&lt;br /&gt;
* To render the color map, simply press F12, wait for rendering to finish, and save the result.&lt;br /&gt;
* To render the normal map, select Solid Shading, then the camera viewpoint (num-pad 0), then select View-&amp;gt;Viewport Render Image&lt;br /&gt;
* Use Sapling Tree Gen or another add-on to create the initial trees.  You can save presets, which is useful.&lt;br /&gt;
* There will be 3 copies of the texture rendered at different angles, so the tree texture itself can be sparse.&lt;br /&gt;
* The tree needs to be completely vertical.  This is particularly important for conifers which come to a point.&lt;br /&gt;
* Each tree must have a little space at the top. Otherwise subsequent rendering results in &amp;quot;top hats&amp;quot; above trees in the distance where the trunk of the tree above in the textures sheet bleeds downwards when the mipmaps are generated.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Random_vegetation&amp;diff=141269</id>
		<title>Random vegetation</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Random_vegetation&amp;diff=141269"/>
		<updated>2025-01-24T09:47:45Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Created page with &amp;quot;Random Vegetation is the system that generates trees, bushes and other vegetation on scenery.   It is sometimes referred to as &amp;quot;Random Trees&amp;quot;, and tree is often used as a synonym for vegetation throughout the system and documentation.  For simplicity, this article will refer to &amp;quot;trees&amp;quot;.  The location of trees can be defined in two ways:  * Random distribution within an area of the scenery, with distribution controlled by parameters in materials.xml * Explicit placement d...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Random Vegetation is the system that generates trees, bushes and other vegetation on scenery.   It is sometimes referred to as &amp;quot;Random Trees&amp;quot;, and tree is often used as a synonym for vegetation throughout the system and documentation.  For simplicity, this article will refer to &amp;quot;trees&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The location of trees can be defined in two ways:&lt;br /&gt;
&lt;br /&gt;
* Random distribution within an area of the scenery, with distribution controlled by parameters in materials.xml&lt;br /&gt;
* Explicit placement defined in a tile by a TREE_LIST entry in the scenery STG file.  Typically generated automatically from openstreetmap data by osm2city.&lt;br /&gt;
&lt;br /&gt;
In both cases, the material definition in  materials.xml file controls parameters such as the tree height, width the texture used,&lt;br /&gt;
&lt;br /&gt;
The trees themselves are rendered using two (3 post 2024.1) rectangles in a cross shape.&lt;br /&gt;
&lt;br /&gt;
See the README.materials file for information on the specific parameters.&lt;br /&gt;
&lt;br /&gt;
=== Tree Texture ===&lt;br /&gt;
The tree textures (tree-texture and tree-normal-map parameters) are png files that provide an atlas of textures to use when rendering individual trees, so there is a variety of trees.&lt;br /&gt;
&lt;br /&gt;
Horizontally, the texture contains a number of individual tree textures defined by the &amp;quot;tree-varieties&amp;quot; parameter.  Typically 8 for tall thin trees, and 4 for broader trees.&lt;br /&gt;
&lt;br /&gt;
Vertically, each tree has 4 textures to cover in four possible states:  &lt;br /&gt;
&lt;br /&gt;
# summer, &lt;br /&gt;
# snow covered in summer&lt;br /&gt;
# winter,&lt;br /&gt;
# snow covered in winter&lt;br /&gt;
&lt;br /&gt;
Post 2024.X, there is an additional tree-normal-map, which is an png normal map file with the same layout used by PBR rendering.&lt;br /&gt;
&lt;br /&gt;
=== Generating PBR Trees ===&lt;br /&gt;
Due to the need to generate a normal map, the traditional approach of just painting a texture does not work for PBR trees.  Instead, we use an approach of creating a tree model in Blender and then rendering a base colour texture and a normal map texture.  This approach is described well on youtube (e.g. https://www.youtube.com/watch?v=_GCy98O9S58&amp;amp;t=888s, https://www.youtube.com/watch?v=Ix-KT9a4PSo).&lt;br /&gt;
&lt;br /&gt;
Useful notes for arborealist:&lt;br /&gt;
&lt;br /&gt;
* The tree-template.blend file in fgdata provides a useful starting point, with an appropriate camera and light set up already, solid shading set to display the normalmap, and some basic material definitions.  So you can easily select the color map (Viewport Shading) or normal map (solid shading) and then press F12 to generate a rendering.&lt;br /&gt;
* Use Sapling Tree Gen or another add-on to create the initial trees.  You can save presets, which is useful.&lt;br /&gt;
* There will be 3 copies of the texture rendered at different angles, so the tree texture itself can be sparse.&lt;br /&gt;
* The tree needs to be completely vertical.  This is particularly important for conifers which come to a point.&lt;br /&gt;
* Each tree must have a little space at the top. Otherwise subsequent rendering results in &amp;quot;top hats&amp;quot; above trees in the distance where the trunk of the tree above in the textures sheet bleeds downwards when the mipmaps are generated.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Changelog_2024.1&amp;diff=140920</id>
		<title>Changelog 2024.1</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Changelog_2024.1&amp;diff=140920"/>
		<updated>2024-11-09T09:58:42Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
{{WIP}}&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
* Many crashes and memory leaks fixed.&lt;br /&gt;
* Preview of World Scenery 3.0.  This is a new scenery system that uses multiple levels of detail to provide higher frame-rates and lower memory occupancy at bigger visibility ranges.&lt;br /&gt;
* Many improvements to the FlightGear launcher.&lt;br /&gt;
&lt;br /&gt;
== Graphics ==&lt;br /&gt;
&lt;br /&gt;
* Compositor multi-pass rendering.&lt;br /&gt;
* Improved photoscenery support.&lt;br /&gt;
* Improved scenery object support, including defining and rendering large numbers of scenery lights in STG files, and support for generic instantiation of objects (e.g. windmills, pylons).&lt;br /&gt;
* Add the Milky Way to the night sky.&lt;br /&gt;
* Optional ShaderVG, a shader based version if ShivaVG.&lt;br /&gt;
&lt;br /&gt;
== Interfaces ==&lt;br /&gt;
&lt;br /&gt;
* Flight data can now be saved to file as a continuous uncompressed file stream.&lt;br /&gt;
* Compressed video encoding is now supported.&lt;br /&gt;
* IO channels can be re-initialized and are exposed on the property tree under /io/channels/.&lt;br /&gt;
&lt;br /&gt;
== FDM ==&lt;br /&gt;
&lt;br /&gt;
* Synchronization with JSBSim v1.1.11.&lt;br /&gt;
* Better support for frozen lakes.&lt;br /&gt;
&lt;br /&gt;
== Environment ==&lt;br /&gt;
&lt;br /&gt;
* Update for world magnetic model data set from WMM2015 to WMM2020.&lt;br /&gt;
* Replace season selection (--season) with improved climate modeling, including seasonal variation, ocean temperatures, dew point, snow line and other environmental factors.&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* Localization support for add-ons as well as aircraft&lt;br /&gt;
* Improve translations for the following languages:&lt;br /&gt;
** French&lt;br /&gt;
** Spanish&lt;br /&gt;
** Polish&lt;br /&gt;
** Italian&lt;br /&gt;
** German&lt;br /&gt;
** Dutch&lt;br /&gt;
** Slovak&lt;br /&gt;
** Georgian&lt;br /&gt;
** Russian&lt;br /&gt;
&lt;br /&gt;
== Hardware Device Support ==&lt;br /&gt;
Support for the following hardware devices has been added or updated:&lt;br /&gt;
&lt;br /&gt;
* Honeycomb Alpha Flight Controls&lt;br /&gt;
* Honeycomb Bravo Throttle Quadrant&lt;br /&gt;
* Saitek Pro Flight Rudder Pedals &lt;br /&gt;
* Saitek Pro Flight Switch Panel&lt;br /&gt;
* CH Combatstick&lt;br /&gt;
* Logitech G25 Racing Wheel&lt;br /&gt;
* Thrustmaster T-Flight Rudder Pedals&lt;br /&gt;
&lt;br /&gt;
== AI Traffic &amp;amp; Liveries ==&lt;br /&gt;
&lt;br /&gt;
* Many improvements to make AI aircraft behavior more realistic.&lt;br /&gt;
&lt;br /&gt;
Traffic and/or liveries have been added for the following airlines:&lt;br /&gt;
&lt;br /&gt;
* Delta Airlines&lt;br /&gt;
* United Airlines&lt;br /&gt;
* AeroUnion Mexico&lt;br /&gt;
* AeroMexico&lt;br /&gt;
* AeroMexicoConnect&lt;br /&gt;
* Amerijet Cargo&lt;br /&gt;
* Airest Cargo&lt;br /&gt;
* Air Caraibes&lt;br /&gt;
* DHL&lt;br /&gt;
* Amazon Air&lt;br /&gt;
* EuroWings&lt;br /&gt;
* Polar Air Cargo&lt;br /&gt;
* Northern Air Cargo&lt;br /&gt;
* Eastern Airways UK&lt;br /&gt;
* ANA Wings&lt;br /&gt;
* Ibex Japan&lt;br /&gt;
* Solaseed Japan&lt;br /&gt;
* AirHongKong &lt;br /&gt;
* AirHongKong Cargo&lt;br /&gt;
* AirChina&lt;br /&gt;
* UNI Air Japan&lt;br /&gt;
* Southern Air Cargo&lt;br /&gt;
* SATA Air Acores&lt;br /&gt;
* Azores Airlines&lt;br /&gt;
* European Air Transport Leipzig&lt;br /&gt;
* SykyLeaseCargo&lt;br /&gt;
* Blue Air&lt;br /&gt;
* Cyprus Airways&lt;br /&gt;
* DirectFlight Airtask Shetland&lt;br /&gt;
*&lt;br /&gt;
* Corsair&lt;br /&gt;
* LOT Polish Airlines&lt;br /&gt;
* Braethens&lt;br /&gt;
* Transavia NL&lt;br /&gt;
* Transavia France&lt;br /&gt;
* Tunisair Group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Traffic and/or liveries have been removed for the following airlines:&lt;br /&gt;
&lt;br /&gt;
* GermanWings (defunct)&lt;br /&gt;
&lt;br /&gt;
== Canvas ==&lt;br /&gt;
fc16b827a Fix OSM imagery in the canvas map (fixes #2912)**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt;f0a740333 Remove OpenAIP map support from Canvas Map (see #2913)**&lt;br /&gt;
&lt;br /&gt;
== Nasal ==&lt;br /&gt;
&lt;br /&gt;
== Phi ==&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt;7b36d498f Fix a variety of broken or unsupported maps in Phi&lt;br /&gt;
&lt;br /&gt;
725ce7d3f Phi: Add map option to disable repositioning own aircraft by dragging&lt;br /&gt;
&lt;br /&gt;
fc3b7b8b5 Phi: Highlight &amp;quot;follow aircraft&amp;quot; button if enabled&lt;br /&gt;
&lt;br /&gt;
5626dc51f Phi: Remove unused css rule&lt;br /&gt;
&lt;br /&gt;
88788dc6a Fix attributes for multiplayer and AI airplanes in Phi (fix #2274)&lt;br /&gt;
&lt;br /&gt;
660fda829 Phi: automatically use latest AIRAC cycle for OpenFlightMaps&lt;br /&gt;
&lt;br /&gt;
57483a999 Phi: fix midnight time offset&lt;br /&gt;
&lt;br /&gt;
== Aircraft Carriers ==&lt;br /&gt;
The following [[Aircraft carrier|Aircraft carriers]] have been added:&lt;br /&gt;
&lt;br /&gt;
* Admiral Kuznetsov&lt;br /&gt;
* Liaoning&lt;br /&gt;
&lt;br /&gt;
== Misc. ==&lt;br /&gt;
f9ad4124f Route manager add total dist, dist remaining, ete, flight time&lt;br /&gt;
&lt;br /&gt;
* Highlighting tool enabled by setting /sim/highlighting/enabled=true which highlights any animated objects under the pointed along with any other objects animated by the same or related properties.&lt;br /&gt;
&lt;br /&gt;
== Legacy ==&lt;br /&gt;
&lt;br /&gt;
* Remove [[Rembrandt]] command-line options&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Changelog_2024.1&amp;diff=140919</id>
		<title>Changelog 2024.1</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Changelog_2024.1&amp;diff=140919"/>
		<updated>2024-11-09T09:45:21Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Result of initial simgear and flightgear commit log review&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft}}&lt;br /&gt;
&lt;br /&gt;
{{WIP}}&lt;br /&gt;
&lt;br /&gt;
== General ==&lt;br /&gt;
&lt;br /&gt;
* Many crashes and memory leaks fixed.&lt;br /&gt;
* Synchronization with JSBSim v1.1.11&lt;br /&gt;
* Preview of World Scenery 3.0  This is a new scenery system that uses multiple levels of detail to provide higher frame-rates and lower memory occupancy at bigger visibility ranges.&lt;br /&gt;
* Many improvements to the FlightGear launcher&lt;br /&gt;
&lt;br /&gt;
== Graphics ==&lt;br /&gt;
&lt;br /&gt;
* Compositor (need to describe)&lt;br /&gt;
* Improved photoscenery , available for both WS2.0 and WS3.0&lt;br /&gt;
* Support for defining and rendering large numbers of scenery lights in STG files&lt;br /&gt;
* Support for generic instantiation of objects (e.g. windmills, pylons)&lt;br /&gt;
* Add the Milky Way to the night sky&lt;br /&gt;
* Optional ShaderVG, a shader based version if ShivaVG&lt;br /&gt;
&lt;br /&gt;
== Interfaces ==&lt;br /&gt;
&lt;br /&gt;
* Support for continuous uncompressed save to file&lt;br /&gt;
* Support for video encoding&lt;br /&gt;
* IO channels can be re-initialized&lt;br /&gt;
* IO channels are now exposed on the property tree under /io/channels/&lt;br /&gt;
&lt;br /&gt;
== Environment ==&lt;br /&gt;
&lt;br /&gt;
* Update for world magnetic model data set from WMM2015 to WMM2020&lt;br /&gt;
* Replace season selection (--season) with improved climate modeling, including seasonal variation, ocean temperatures, dew point, snow line and other environmental factors&lt;br /&gt;
&lt;br /&gt;
== Translations ==&lt;br /&gt;
&lt;br /&gt;
* Localisation support for add-ons as well as aircraft&lt;br /&gt;
* Improve translations for the following languages:&lt;br /&gt;
** French&lt;br /&gt;
** Spanish&lt;br /&gt;
** Polish&lt;br /&gt;
** Italian&lt;br /&gt;
** German&lt;br /&gt;
** Dutch&lt;br /&gt;
** Slovak&lt;br /&gt;
** Georgian&lt;br /&gt;
** Russian&lt;br /&gt;
** Turkish?&lt;br /&gt;
&lt;br /&gt;
== Hardware Device Support ==&lt;br /&gt;
Support for the following hardware devices has been added or updated:&lt;br /&gt;
&lt;br /&gt;
* Honeycomb Alpha Flight Controls&lt;br /&gt;
* Honeycomb Bravo Throttle Quadrant&lt;br /&gt;
* Saitek Pro Flight Rudder Pedals &lt;br /&gt;
* Saitek Pro Flight Switch Panel&lt;br /&gt;
* CH Combatstick&lt;br /&gt;
* Logitech G25 Racing Wheel&lt;br /&gt;
* Thrustmaster T-Flight Rudder Pedals&lt;br /&gt;
&lt;br /&gt;
== AI Traffic &amp;amp; Liveries ==&lt;br /&gt;
&lt;br /&gt;
* Many improvements to make AI aircraft behaviour more realistic&lt;br /&gt;
* Wake Turbulence Modeling?&lt;br /&gt;
&lt;br /&gt;
Traffic and/or liveries have been added for the following airlines:&lt;br /&gt;
&lt;br /&gt;
* Delta Airlines&lt;br /&gt;
* United Airlines&lt;br /&gt;
* AeroUnion Mexico&lt;br /&gt;
* AeroMexico&lt;br /&gt;
* AeroMexicoConnect&lt;br /&gt;
* Amerijet Cargo&lt;br /&gt;
* Airest Cargo&lt;br /&gt;
* Air Caraibes&lt;br /&gt;
* DHL&lt;br /&gt;
* Amazon Air&lt;br /&gt;
* EuroWings&lt;br /&gt;
* Polar Air Cargo&lt;br /&gt;
* Northern Air Cargo&lt;br /&gt;
* Eastern Airways UK&lt;br /&gt;
* ANA Wings&lt;br /&gt;
* Ibex Japan&lt;br /&gt;
* Solaseed Japan&lt;br /&gt;
* AirHongKong &lt;br /&gt;
* AirHongKong Cargo&lt;br /&gt;
* AirChina&lt;br /&gt;
* UNI Air Japan&lt;br /&gt;
* Southern Air Cargo&lt;br /&gt;
* SATA Air Acores&lt;br /&gt;
* Azores Airlines&lt;br /&gt;
* European Air Transport Leipzig&lt;br /&gt;
* SykyLeaseCargo&lt;br /&gt;
* Blue Air&lt;br /&gt;
* Cyprus Airways&lt;br /&gt;
* DirectFlight Airtask Shetland&lt;br /&gt;
*&lt;br /&gt;
* Corsair&lt;br /&gt;
* LOT Polish Airlines&lt;br /&gt;
* Braethens&lt;br /&gt;
* Transavia NL&lt;br /&gt;
* Transavia France&lt;br /&gt;
* Tunisair Group&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Traffic and/or liveries have been removed for the following airlines:&lt;br /&gt;
&lt;br /&gt;
* GermanWings (defunct)&lt;br /&gt;
&lt;br /&gt;
== Canvas ==&lt;br /&gt;
fc16b827a Fix OSM imagery in the canvas map (fixes #2912)**&lt;br /&gt;
&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt;f0a740333 Remove OpenAIP map support from Canvas Map (see #2913)**&lt;br /&gt;
&lt;br /&gt;
== FG1000 ==&lt;br /&gt;
&lt;br /&gt;
== Nasal ==&lt;br /&gt;
&lt;br /&gt;
== Phi ==&lt;br /&gt;
&amp;lt;nowiki&amp;gt;**&amp;lt;/nowiki&amp;gt;7b36d498f Fix a variety of broken or unsupported maps in Phi&lt;br /&gt;
&lt;br /&gt;
725ce7d3f Phi: Add map option to disable repositioning own aircraft by dragging&lt;br /&gt;
&lt;br /&gt;
fc3b7b8b5 Phi: Highlight &amp;quot;follow aircraft&amp;quot; button if enabled&lt;br /&gt;
&lt;br /&gt;
5626dc51f Phi: Remove unused css rule&lt;br /&gt;
&lt;br /&gt;
88788dc6a Fix attributes for multiplayer and AI airplanes in Phi (fix #2274)&lt;br /&gt;
&lt;br /&gt;
660fda829 Phi: automatically use latest AIRAC cycle for OpenFlightMaps&lt;br /&gt;
&lt;br /&gt;
57483a999 Phi: fix midnight time offset&lt;br /&gt;
&lt;br /&gt;
== Aircraft Carriers ==&lt;br /&gt;
The following [[Aircraft carrier|Aircraft carriers]] have been added:&lt;br /&gt;
&lt;br /&gt;
* Admiral Kuznetsov&lt;br /&gt;
* Liaoning&lt;br /&gt;
&lt;br /&gt;
== Misc. ==&lt;br /&gt;
f9ad4124f Route manager add total dist, dist remaining, ete, flight time&lt;br /&gt;
&lt;br /&gt;
== Legacy ==&lt;br /&gt;
&lt;br /&gt;
* Remove [[Rembrandt]] command-line options&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=140591</id>
		<title>World Scenery 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=140591"/>
		<updated>2024-09-28T16:25:36Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Terrain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 is a project to replace the tiled single-mesh World Scenery 2.0 with an LoD-based approach using a regular elevation mesh, landclass texture and vector line features.&lt;br /&gt;
&lt;br /&gt;
This leverages OSG's Virtual Planet Builder and OpenStreetmap APIs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
For further information:&lt;br /&gt;
&lt;br /&gt;
* [[World Scenery 3.0 roadmap]]&lt;br /&gt;
* [[World Scenery 3.0 rendering]]&lt;br /&gt;
* [[World Scenery 3.0 coastlines]]&lt;br /&gt;
* [[WS3.0 Performance Testing]]&lt;br /&gt;
* [[Howto:Create WS3.0 terrain]]&lt;br /&gt;
* [[Virtual Planet Builder]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Currently Available Scenery ==&lt;br /&gt;
&lt;br /&gt;
=== Terrain ===&lt;br /&gt;
Scenery is currently not distributed using the official Terrasync, Nia provides a terrasync compatible download, point your terrasync client to https://de1mirror.flightgear.org/ws3/ to make use of it. As of writing (2024-01-15) it contains all of the sceneries below (duplicates removed) and will get updated when a new Airports package is made and when Wayne provides her with new US scenery. If you don't wanna deal with changing your terrasync settings, you can always download sections of scenery via the links individually and added to your [[FG SCENERY|scenery path]].  If you set these in your scenery path ahead of any other scenery, it will pick up osm2city, scenery objects etc. from the underlying scenery as well.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Currently Available World Scenery 3.0&lt;br /&gt;
!Scenery&lt;br /&gt;
!Area&lt;br /&gt;
!Size &lt;br /&gt;
!Bottom Left&lt;br /&gt;
!Top Right&lt;br /&gt;
!Area (degrees^2)&lt;br /&gt;
!Landclass Source&lt;br /&gt;
!Landclass Resolution (m)&lt;br /&gt;
!Raster format&lt;br /&gt;
!Comments&lt;br /&gt;
!Osm2city Scenery for WS3&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1EapHG6qEYU6CWdXnp0_aqjUaX61Lk5EL/view?usp=sharing WS30_UK]&lt;br /&gt;
|UK and Eire&lt;br /&gt;
|1.5GB&lt;br /&gt;
| -11,49&lt;br /&gt;
|1,60&lt;br /&gt;
|121&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes detailed roads and water features.  &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/120QOxfTWEm6EBmjK0eCNb07hrm3clavi/view?usp=sharing NL (terrain only)]&lt;br /&gt;
|Amsterdam and Lelystad&lt;br /&gt;
|716MB (ca. 8GB uncompressed)&lt;br /&gt;
|2,50&lt;br /&gt;
|10,53&lt;br /&gt;
|24&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap.  Check out the canals!&lt;br /&gt;
|[https://drive.google.com/file/d/13inL4UqSyvRh5FVq62quVOYXnlEhxU1G/view?usp=sharing contains osm2city stuff incl. trees etc. also contains the static objects from Terrascync]. NB: contains also the terrain - no need to download the terrain seperatly (as per first column). Use with the new airport download and do NOT run on top of WS2.0 scenery.&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1MrYuDKbMl4WhCEq9gnnt8Tz61lTAScvD/view?usp=share_link WS_Alps]&lt;br /&gt;
|&lt;br /&gt;
|49MB&lt;br /&gt;
|6,45&lt;br /&gt;
|8,47&lt;br /&gt;
|4&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1x-kuCTfyMWddTi0fbr_nl41LR41Ylvwb/view?usp=share_link WS30_MTQ]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|[https://drive.google.com/file/d/1QtojSTbnAAfkMzirQHnDJWbBDGOtnwIK/view?usp=sharing osm2city buildings, trees, maritime, pylons etc.] (ca. 40 MB).&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/14kbbgXbofDmqxho-bMCfOG4jDwcDqwBd/view?usp=share_link WS30_MTQ_25m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1-LS3yQZ0OkWX38Ne89n69wtrT7SreV69/view?usp=sharing WS_MTQ_5m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|8MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap. Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1Um7WC8h8Y4BlwgoVSd2xoVO5gTd3E-bI/view?usp=sharing Switzerland_5m]&lt;br /&gt;
|Switzerland plus small border&lt;br /&gt;
|1.4 GB (ca. 7 GB unzipped)&lt;br /&gt;
| 5.75,45.75&lt;br /&gt;
| 10.75,48&lt;br /&gt;
|10&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|By mistake taken default airports. If you are using Nia's updated airports, then it will most often work fine, but there might be residuals with osm2city (e.g. tree on APRON).&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://de1mirror.flightgear.org/hosting/wayne/ WS3.0 USA]&lt;br /&gt;
|USA&lt;br /&gt;
|200 to 400 KB (zipped)&lt;br /&gt;
| 125,48&lt;br /&gt;
| 81,24&lt;br /&gt;
|&lt;br /&gt;
|NLCD, Tree Canopy Data&lt;br /&gt;
|30&lt;br /&gt;
|&lt;br /&gt;
|by state&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/SP-NTX/PolandWS30/ Poland]&lt;br /&gt;
|Poland&lt;br /&gt;
|1.2GiB&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1hDuTA9DVnAySxQvicqZK9u0JlE8irTqA/view?usp=sharing Scotland_5m]&lt;br /&gt;
|Scotland without Orkney/Shetland&lt;br /&gt;
|1.8 GB (ca. 16 GB unzipped)&lt;br /&gt;
| -8,54&lt;br /&gt;
| -1,59&lt;br /&gt;
|&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/10M-K0XA_MQV8eCx4Xaidfje_4Uw2STQC/view?usp=drive_link WS30_FR]&lt;br /&gt;
|Mainland France&lt;br /&gt;
|3.5GB (ca 3.8GB unzipped)&lt;br /&gt;
| -5,43&lt;br /&gt;
|8,53&lt;br /&gt;
|129&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Terrain, water features and roads only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1NqBq8iEC6oqYCKgsllZfw5sT1lPPY5it/view?usp=sharing WS30_UG]&lt;br /&gt;
|Uganda and Lake Victoria&lt;br /&gt;
|1.3GB&lt;br /&gt;
|28,-4&lt;br /&gt;
|36,3&lt;br /&gt;
|56&lt;br /&gt;
|SENTINEL-2&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Terrain, water features and roads only&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Airports ===&lt;br /&gt;
In addition to the selected areas above, global up-to-date WS3.0 airports have been built. You can find them [https://de1mirror.flightgear.org/ws3/ here]&lt;br /&gt;
&lt;br /&gt;
=== Scenery Files Placement ===&lt;br /&gt;
Uncompress the downloaded scenery files into a folder of your choice, such as E:\MySceneryFolder. To be recognized by FlightGear, the selected scenery (from the table above) must be located in a folder with a &amp;quot;vpb&amp;quot; subfolder, such as (EX: C:\mysceneryfolder\hawaii\vpb). The scenery files above are compressed and include the &amp;quot;vpb&amp;quot; folder.&lt;br /&gt;
&lt;br /&gt;
=== Installing ===&lt;br /&gt;
Using the FlightGear [[FlightGear_Qt_launcher]] both the terrain and the airport are &amp;quot;installed&amp;quot; by going to tab &amp;quot;Add-ons&amp;quot; and then add the respective folders to &amp;quot;Additional scenery folders&amp;quot;. When adding an additional scenery folder, you need to point to the folder immediately above the &amp;quot;vpb&amp;quot; subfolder. &lt;br /&gt;
&lt;br /&gt;
If you add the airports the first time you might have to close the launcher and reopen it again to get the navigation data loaded properly into the session.&lt;br /&gt;
&lt;br /&gt;
== Running World Scenery 3.0 ==&lt;br /&gt;
To run WS3.0 you need to set the &amp;lt;code&amp;gt;/scenery/use-vpb&amp;lt;/code&amp;gt; property to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; at startup.  Either set &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; on your command-line, or in the Launcher in &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Rendering&amp;quot; (you might need to click on &amp;quot;Show more&amp;quot; on the right side to see the choice for &amp;quot;Scenery version&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
WS3.0 can use a lot of memory - significantly more than WS2.0.  You can control the memory usage with the following properties:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/max-paged-lod&amp;lt;/code&amp;gt; controls the minimum number of objects that will be kept in memory.  The default setting is 200.&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/plod-minimum-expiry-time-secs&amp;lt;/code&amp;gt; controls how long objects remain loaded for after they are no-longer in view.  The default value is 180 (3 minutes).&lt;br /&gt;
&lt;br /&gt;
Reducing these properties will reduce the memory footprint of WS3.0.&lt;br /&gt;
&lt;br /&gt;
If you have lots of spare cores, you can run multiple threads to load scenery by setting &amp;lt;code&amp;gt;/sim/rendering/database-pager/threads&amp;lt;/code&amp;gt; to a number greater than 4 on startup.  E.g. &amp;lt;code&amp;gt;--prop:/sim/rendering/database-pager/threads=8&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== WS 2.0 scenery might still be needed ===&lt;br /&gt;
To have airports displayed plus some of the default scenery objects, you might still want to have the WS 2.0 scenery for the same area installed.&lt;br /&gt;
&lt;br /&gt;
However, if you want updated airports, checkout the global WS3.0 airports above. To avoid collisions you need to not have any WS2.0 airports enabled if you use these.&lt;br /&gt;
&lt;br /&gt;
=== Using osm2city ===&lt;br /&gt;
WS3.0 has built-in support for OpenStreetMap roads, so you should not have it enabled in rendering settings.&lt;br /&gt;
&lt;br /&gt;
You have 2 options:&lt;br /&gt;
&lt;br /&gt;
* If you have WS2.0 world scenery, then it already contains osm2city buildings etc. You can just use these and live with slight elevation offsets.&lt;br /&gt;
* The other option is to use the provided osm2city scenery in the table above instead. If doing so you need to makes sure that WS2.0 osm2city has not been downloaded (or delete the folders manually). E.g. if you are using [[TerraMaster]] then you can remove the ticks in Settings for &amp;quot;Buildings&amp;quot;, &amp;quot;Pylons&amp;quot; and &amp;quot;Roads&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Using the explicitly provided osm2city scenery gives you trees in gardens/parks and some improvements only available on NEXT.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=140527</id>
		<title>World Scenery 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=140527"/>
		<updated>2024-09-27T17:18:53Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Terrain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 is a project to replace the tiled single-mesh World Scenery 2.0 with an LoD-based approach using a regular elevation mesh, landclass texture and vector line features.&lt;br /&gt;
&lt;br /&gt;
This leverages OSG's Virtual Planet Builder and OpenStreetmap APIs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
For further information:&lt;br /&gt;
&lt;br /&gt;
* [[World Scenery 3.0 roadmap]]&lt;br /&gt;
* [[World Scenery 3.0 rendering]]&lt;br /&gt;
* [[World Scenery 3.0 coastlines]]&lt;br /&gt;
* [[WS3.0 Performance Testing]]&lt;br /&gt;
* [[Howto:Create WS3.0 terrain]]&lt;br /&gt;
* [[Virtual Planet Builder]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Currently Available Scenery ==&lt;br /&gt;
&lt;br /&gt;
=== Terrain ===&lt;br /&gt;
Scenery is currently not distributed using the official Terrasync, Nia provides a terrasync compatible download, point your terrasync client to https://de1mirror.flightgear.org/ws3/ to make use of it. As of writing (2024-01-15) it contains all of the sceneries below (duplicates removed) and will get updated when a new Airports package is made and when Wayne provides her with new US scenery. If you don't wanna deal with changing your terrasync settings, you can always download sections of scenery via the links individually and added to your [[FG SCENERY|scenery path]].  If you set these in your scenery path ahead of any other scenery, it will pick up osm2city, scenery objects etc. from the underlying scenery as well.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Currently Available World Scenery 3.0&lt;br /&gt;
!Scenery&lt;br /&gt;
!Area&lt;br /&gt;
!Size &lt;br /&gt;
!Bottom Left&lt;br /&gt;
!Top Right&lt;br /&gt;
!Area (degrees^2)&lt;br /&gt;
!Landclass Source&lt;br /&gt;
!Landclass Resolution (m)&lt;br /&gt;
!Raster format&lt;br /&gt;
!Comments&lt;br /&gt;
!Osm2city Scenery for WS3&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1EapHG6qEYU6CWdXnp0_aqjUaX61Lk5EL/view?usp=sharing WS30_UK]&lt;br /&gt;
|UK and Eire&lt;br /&gt;
|1.5GB&lt;br /&gt;
| -11,49&lt;br /&gt;
|1,60&lt;br /&gt;
|121&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes detailed roads and water features.  &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/120QOxfTWEm6EBmjK0eCNb07hrm3clavi/view?usp=sharing NL (terrain only)]&lt;br /&gt;
|Amsterdam and Lelystad&lt;br /&gt;
|716MB (ca. 8GB uncompressed)&lt;br /&gt;
|2,50&lt;br /&gt;
|10,53&lt;br /&gt;
|24&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap.  Check out the canals!&lt;br /&gt;
|[https://drive.google.com/file/d/13inL4UqSyvRh5FVq62quVOYXnlEhxU1G/view?usp=sharing contains osm2city stuff incl. trees etc. also contains the static objects from Terrascync]. NB: contains also the terrain - no need to download the terrain seperatly (as per first column). Use with the new airport download and do NOT run on top of WS2.0 scenery.&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1MrYuDKbMl4WhCEq9gnnt8Tz61lTAScvD/view?usp=share_link WS_Alps]&lt;br /&gt;
|&lt;br /&gt;
|49MB&lt;br /&gt;
|6,45&lt;br /&gt;
|8,47&lt;br /&gt;
|4&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1x-kuCTfyMWddTi0fbr_nl41LR41Ylvwb/view?usp=share_link WS30_MTQ]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|[https://drive.google.com/file/d/1QtojSTbnAAfkMzirQHnDJWbBDGOtnwIK/view?usp=sharing osm2city buildings, trees, maritime, pylons etc.] (ca. 40 MB).&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/14kbbgXbofDmqxho-bMCfOG4jDwcDqwBd/view?usp=share_link WS30_MTQ_25m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1-LS3yQZ0OkWX38Ne89n69wtrT7SreV69/view?usp=sharing WS_MTQ_5m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|8MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap. Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1Um7WC8h8Y4BlwgoVSd2xoVO5gTd3E-bI/view?usp=sharing Switzerland_5m]&lt;br /&gt;
|Switzerland plus small border&lt;br /&gt;
|1.4 GB (ca. 7 GB unzipped)&lt;br /&gt;
| 5.75,45.75&lt;br /&gt;
| 10.75,48&lt;br /&gt;
|10&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|By mistake taken default airports. If you are using Nia's updated airports, then it will most often work fine, but there might be residuals with osm2city (e.g. tree on APRON).&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://de1mirror.flightgear.org/hosting/wayne/ WS3.0 USA]&lt;br /&gt;
|USA&lt;br /&gt;
|200 to 400 KB (zipped)&lt;br /&gt;
| 125,48&lt;br /&gt;
| 81,24&lt;br /&gt;
|&lt;br /&gt;
|NLCD, Tree Canopy Data&lt;br /&gt;
|30&lt;br /&gt;
|&lt;br /&gt;
|by state&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/SP-NTX/PolandWS30/ Poland]&lt;br /&gt;
|Poland&lt;br /&gt;
|1.2GiB&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1hDuTA9DVnAySxQvicqZK9u0JlE8irTqA/view?usp=sharing Scotland_5m]&lt;br /&gt;
|Scotland without Orkney/Shetland&lt;br /&gt;
|1.8 GB (ca. 16 GB unzipped)&lt;br /&gt;
| -8,54&lt;br /&gt;
| -1,59&lt;br /&gt;
|&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/10M-K0XA_MQV8eCx4Xaidfje_4Uw2STQC/view?usp=drive_link WS30_FR]&lt;br /&gt;
|Mainland France&lt;br /&gt;
|3.5GB (ca 3.8GB unzipped)&lt;br /&gt;
| -5,43&lt;br /&gt;
|8,53&lt;br /&gt;
|129&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Terrain, water features and roads only&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|WS30_UG&lt;br /&gt;
|Uganda and Lake Victoria&lt;br /&gt;
|1.3GB&lt;br /&gt;
|28,-4&lt;br /&gt;
|36,3&lt;br /&gt;
|56&lt;br /&gt;
|SENTINEL-2&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Terrain, water features and roads only&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Airports ===&lt;br /&gt;
In addition to the selected areas above, global up-to-date WS3.0 airports have been built. You can find them [https://de1mirror.flightgear.org/ws3/ here]&lt;br /&gt;
&lt;br /&gt;
=== Scenery Files Placement ===&lt;br /&gt;
Uncompress the downloaded scenery files into a folder of your choice, such as E:\MySceneryFolder. To be recognized by FlightGear, the selected scenery (from the table above) must be located in a folder with a &amp;quot;vpb&amp;quot; subfolder, such as (EX: C:\mysceneryfolder\hawaii\vpb). The scenery files above are compressed and include the &amp;quot;vpb&amp;quot; folder.&lt;br /&gt;
&lt;br /&gt;
=== Installing ===&lt;br /&gt;
Using the FlightGear [[FlightGear_Qt_launcher]] both the terrain and the airport are &amp;quot;installed&amp;quot; by going to tab &amp;quot;Add-ons&amp;quot; and then add the respective folders to &amp;quot;Additional scenery folders&amp;quot;. When adding an additional scenery folder, you need to point to the folder immediately above the &amp;quot;vpb&amp;quot; subfolder. &lt;br /&gt;
&lt;br /&gt;
If you add the airports the first time you might have to close the launcher and reopen it again to get the navigation data loaded properly into the session.&lt;br /&gt;
&lt;br /&gt;
== Running World Scenery 3.0 ==&lt;br /&gt;
To run WS3.0 you need to set the &amp;lt;code&amp;gt;/scenery/use-vpb&amp;lt;/code&amp;gt; property to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; at startup.  Either set &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; on your command-line, or in the Launcher in &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Rendering&amp;quot; (you might need to click on &amp;quot;Show more&amp;quot; on the right side to see the choice for &amp;quot;Scenery version&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
WS3.0 can use a lot of memory - significantly more than WS2.0.  You can control the memory usage with the following properties:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/max-paged-lod&amp;lt;/code&amp;gt; controls the minimum number of objects that will be kept in memory.  The default setting is 200.&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/plod-minimum-expiry-time-secs&amp;lt;/code&amp;gt; controls how long objects remain loaded for after they are no-longer in view.  The default value is 180 (3 minutes).&lt;br /&gt;
&lt;br /&gt;
Reducing these properties will reduce the memory footprint of WS3.0.&lt;br /&gt;
&lt;br /&gt;
If you have lots of spare cores, you can run multiple threads to load scenery by setting &amp;lt;code&amp;gt;/sim/rendering/database-pager/threads&amp;lt;/code&amp;gt; to a number greater than 4 on startup.  E.g. &amp;lt;code&amp;gt;--prop:/sim/rendering/database-pager/threads=8&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== WS 2.0 scenery might still be needed ===&lt;br /&gt;
To have airports displayed plus some of the default scenery objects, you might still want to have the WS 2.0 scenery for the same area installed.&lt;br /&gt;
&lt;br /&gt;
However, if you want updated airports, checkout the global WS3.0 airports above. To avoid collisions you need to not have any WS2.0 airports enabled if you use these.&lt;br /&gt;
&lt;br /&gt;
=== Using osm2city ===&lt;br /&gt;
WS3.0 has built-in support for OpenStreetMap roads, so you should not have it enabled in rendering settings.&lt;br /&gt;
&lt;br /&gt;
You have 2 options:&lt;br /&gt;
&lt;br /&gt;
* If you have WS2.0 world scenery, then it already contains osm2city buildings etc. You can just use these and live with slight elevation offsets.&lt;br /&gt;
* The other option is to use the provided osm2city scenery in the table above instead. If doing so you need to makes sure that WS2.0 osm2city has not been downloaded (or delete the folders manually). E.g. if you are using [[TerraMaster]] then you can remove the ticks in Settings for &amp;quot;Buildings&amp;quot;, &amp;quot;Pylons&amp;quot; and &amp;quot;Roads&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Using the explicitly provided osm2city scenery gives you trees in gardens/parks and some improvements only available on NEXT.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=140458</id>
		<title>World Scenery 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=140458"/>
		<updated>2024-09-15T14:52:38Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Terrain */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 is a project to replace the tiled single-mesh World Scenery 2.0 with an LoD-based approach using a regular elevation mesh, landclass texture and vector line features.&lt;br /&gt;
&lt;br /&gt;
This leverages OSG's Virtual Planet Builder and OpenStreetmap APIs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
For further information:&lt;br /&gt;
&lt;br /&gt;
* [[World Scenery 3.0 roadmap]]&lt;br /&gt;
* [[World Scenery 3.0 rendering]]&lt;br /&gt;
* [[World Scenery 3.0 coastlines]]&lt;br /&gt;
* [[WS3.0 Performance Testing]]&lt;br /&gt;
* [[Howto:Create WS3.0 terrain]]&lt;br /&gt;
* [[Virtual Planet Builder]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Currently Available Scenery ==&lt;br /&gt;
&lt;br /&gt;
=== Terrain ===&lt;br /&gt;
Scenery is currently not distributed using the official Terrasync, Nia provides a terrasync compatible download, point your terrasync client to https://de1mirror.flightgear.org/ws3/ to make use of it. As of writing (2024-01-15) it contains all of the sceneries below (duplicates removed) and will get updated when a new Airports package is made and when Wayne provides her with new US scenery. If you don't wanna deal with changing your terrasync settings, you can always download sections of scenery via the links individually and added to your [[FG SCENERY|scenery path]].  If you set these in your scenery path ahead of any other scenery, it will pick up osm2city, scenery objects etc. from the underlying scenery as well.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Currently Available World Scenery 3.0&lt;br /&gt;
!Scenery&lt;br /&gt;
!Area&lt;br /&gt;
!Size &lt;br /&gt;
!Bottom Left&lt;br /&gt;
!Top Right&lt;br /&gt;
!Area (degrees^2)&lt;br /&gt;
!Landclass Source&lt;br /&gt;
!Landclass Resolution (m)&lt;br /&gt;
!Raster format&lt;br /&gt;
!Comments&lt;br /&gt;
!Osm2city Scenery for WS3&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1EapHG6qEYU6CWdXnp0_aqjUaX61Lk5EL/view?usp=sharing WS30_UK]&lt;br /&gt;
|UK and Eire&lt;br /&gt;
|1.5GB&lt;br /&gt;
| -11,49&lt;br /&gt;
|1,60&lt;br /&gt;
|121&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes detailed roads and water features.  &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/120QOxfTWEm6EBmjK0eCNb07hrm3clavi/view?usp=sharing NL (terrain only)]&lt;br /&gt;
|Amsterdam and Lelystad&lt;br /&gt;
|716MB (ca. 8GB uncompressed)&lt;br /&gt;
|2,50&lt;br /&gt;
|10,53&lt;br /&gt;
|24&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap.  Check out the canals!&lt;br /&gt;
|[https://drive.google.com/file/d/13inL4UqSyvRh5FVq62quVOYXnlEhxU1G/view?usp=sharing contains osm2city stuff incl. trees etc. also contains the static objects from Terrascync]. NB: contains also the terrain - no need to download the terrain seperatly (as per first column). Use with the new airport download and do NOT run on top of WS2.0 scenery.&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1MrYuDKbMl4WhCEq9gnnt8Tz61lTAScvD/view?usp=share_link WS_Alps]&lt;br /&gt;
|&lt;br /&gt;
|49MB&lt;br /&gt;
|6,45&lt;br /&gt;
|8,47&lt;br /&gt;
|4&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1x-kuCTfyMWddTi0fbr_nl41LR41Ylvwb/view?usp=share_link WS30_MTQ]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|[https://drive.google.com/file/d/1QtojSTbnAAfkMzirQHnDJWbBDGOtnwIK/view?usp=sharing osm2city buildings, trees, maritime, pylons etc.] (ca. 40 MB).&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/14kbbgXbofDmqxho-bMCfOG4jDwcDqwBd/view?usp=share_link WS30_MTQ_25m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1-LS3yQZ0OkWX38Ne89n69wtrT7SreV69/view?usp=sharing WS_MTQ_5m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|8MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap. Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1Um7WC8h8Y4BlwgoVSd2xoVO5gTd3E-bI/view?usp=sharing Switzerland_5m]&lt;br /&gt;
|Switzerland plus small border&lt;br /&gt;
|1.4 GB (ca. 7 GB unzipped)&lt;br /&gt;
| 5.75,45.75&lt;br /&gt;
| 10.75,48&lt;br /&gt;
|10&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|By mistake taken default airports. If you are using Nia's updated airports, then it will most often work fine, but there might be residuals with osm2city (e.g. tree on APRON).&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://de1mirror.flightgear.org/hosting/wayne/ WS3.0 USA]&lt;br /&gt;
|USA&lt;br /&gt;
|200 to 400 KB (zipped)&lt;br /&gt;
| 125,48&lt;br /&gt;
| 81,24&lt;br /&gt;
|&lt;br /&gt;
|NLCD, Tree Canopy Data&lt;br /&gt;
|30&lt;br /&gt;
|&lt;br /&gt;
|by state&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/SP-NTX/PolandWS30/ Poland]&lt;br /&gt;
|Poland&lt;br /&gt;
|1.2GiB&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1hDuTA9DVnAySxQvicqZK9u0JlE8irTqA/view?usp=sharing Scotland_5m]&lt;br /&gt;
|Scotland without Orkney/Shetland&lt;br /&gt;
|1.8 GB (ca. 16 GB unzipped)&lt;br /&gt;
| -8,54&lt;br /&gt;
| -1,59&lt;br /&gt;
|&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/10M-K0XA_MQV8eCx4Xaidfje_4Uw2STQC/view?usp=drive_link WS30_FR]&lt;br /&gt;
|Mainland France&lt;br /&gt;
|3.5GB (ca 3.8GB unzipped)&lt;br /&gt;
| -5,43&lt;br /&gt;
|8,53&lt;br /&gt;
|129&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Terrain, water features and roads only&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Airports ===&lt;br /&gt;
In addition to the selected areas above, global up-to-date WS3.0 airports have been built. You can find them [https://de1mirror.flightgear.org/ws3/ here]&lt;br /&gt;
&lt;br /&gt;
=== Scenery Files Placement ===&lt;br /&gt;
Uncompress the downloaded scenery files into a folder of your choice, such as E:\MySceneryFolder. To be recognized by FlightGear, the selected scenery (from the table above) must be located in a folder with a &amp;quot;vpb&amp;quot; subfolder, such as (EX: C:\mysceneryfolder\hawaii\vpb). The scenery files above are compressed and include the &amp;quot;vpb&amp;quot; folder.&lt;br /&gt;
&lt;br /&gt;
=== Installing ===&lt;br /&gt;
Using the FlightGear [[FlightGear_Qt_launcher]] both the terrain and the airport are &amp;quot;installed&amp;quot; by going to tab &amp;quot;Add-ons&amp;quot; and then add the respective folders to &amp;quot;Additional scenery folders&amp;quot;. When adding an additional scenery folder, you need to point to the folder immediately above the &amp;quot;vpb&amp;quot; subfolder. &lt;br /&gt;
&lt;br /&gt;
If you add the airports the first time you might have to close the launcher and reopen it again to get the navigation data loaded properly into the session.&lt;br /&gt;
&lt;br /&gt;
== Running World Scenery 3.0 ==&lt;br /&gt;
To run WS3.0 you need to set the &amp;lt;code&amp;gt;/scenery/use-vpb&amp;lt;/code&amp;gt; property to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; at startup.  Either set &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; on your command-line, or in the Launcher in &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Rendering&amp;quot; (you might need to click on &amp;quot;Show more&amp;quot; on the right side to see the choice for &amp;quot;Scenery version&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
WS3.0 can use a lot of memory - significantly more than WS2.0.  You can control the memory usage with the following properties:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/max-paged-lod&amp;lt;/code&amp;gt; controls the minimum number of objects that will be kept in memory.  The default setting is 200.&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/plod-minimum-expiry-time-secs&amp;lt;/code&amp;gt; controls how long objects remain loaded for after they are no-longer in view.  The default value is 180 (3 minutes).&lt;br /&gt;
&lt;br /&gt;
Reducing these properties will reduce the memory footprint of WS3.0.&lt;br /&gt;
&lt;br /&gt;
If you have lots of spare cores, you can run multiple threads to load scenery by setting &amp;lt;code&amp;gt;/sim/rendering/database-pager/threads&amp;lt;/code&amp;gt; to a number greater than 4 on startup.  E.g. &amp;lt;code&amp;gt;--prop:/sim/rendering/database-pager/threads=8&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== WS 2.0 scenery might still be needed ===&lt;br /&gt;
To have airports displayed plus some of the default scenery objects, you might still want to have the WS 2.0 scenery for the same area installed.&lt;br /&gt;
&lt;br /&gt;
However, if you want updated airports, checkout the global WS3.0 airports above. To avoid collisions you need to not have any WS2.0 airports enabled if you use these.&lt;br /&gt;
&lt;br /&gt;
=== Using osm2city ===&lt;br /&gt;
WS3.0 has built-in support for OpenStreetMap roads, so you should not have it enabled in rendering settings.&lt;br /&gt;
&lt;br /&gt;
You have 2 options:&lt;br /&gt;
&lt;br /&gt;
* If you have WS2.0 world scenery, then it already contains osm2city buildings etc. You can just use these and live with slight elevation offsets.&lt;br /&gt;
* The other option is to use the provided osm2city scenery in the table above instead. If doing so you need to makes sure that WS2.0 osm2city has not been downloaded (or delete the folders manually). E.g. if you are using [[TerraMaster]] then you can remove the ticks in Settings for &amp;quot;Buildings&amp;quot;, &amp;quot;Pylons&amp;quot; and &amp;quot;Roads&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Using the explicitly provided osm2city scenery gives you trees in gardens/parks and some improvements only available on NEXT.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_LoD&amp;diff=139979</id>
		<title>Scenery LoD</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Scenery_LoD&amp;diff=139979"/>
		<updated>2024-06-17T19:14:47Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* WS3.0 LoD */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Given the large distances that need to drawn in FlightGear, we use '''Level of Detail (LoD)''' to control how much of the scenery that is rendered at what distance to ensure frame-rates are reasonable.&lt;br /&gt;
&lt;br /&gt;
== How LoD is Controlled ==&lt;br /&gt;
{{See also|Level Of Detail (LOD) Ranges}}&lt;br /&gt;
&lt;br /&gt;
There are three ranges that can be configured:&lt;br /&gt;
&lt;br /&gt;
; Detailed&lt;br /&gt;
: The range at which detailed scenery objects are displayed.  Default value is 1500 m.&lt;br /&gt;
&lt;br /&gt;
; Rough&lt;br /&gt;
: The range at which trees are displayed.  Note that to avoid forests suddenly appearing, trees are slowly faded in from 2xRough range.  Default value 9 km.&lt;br /&gt;
&lt;br /&gt;
; Bare&lt;br /&gt;
: The range at which the underlying terrain mesh is displayed.  Default value 30 km.&lt;br /&gt;
&lt;br /&gt;
Scenery LoD is controlled from the '''View-&amp;gt;Adjust LOD Ranges''' menu item in the simulator.  &lt;br /&gt;
&lt;br /&gt;
It should always be the case that Detailed &amp;lt; Rough &amp;lt; Bare.  So in the dialog the Rough and Bare ranges are controlled as a delta on top of the Detailed range.  Specifically the following properties &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/detailed&amp;lt;/code&amp;gt; - Defaults value 1500m&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/rough-delta&amp;lt;/code&amp;gt; - Defaults value 7500&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/bare-delta&amp;lt;/code&amp;gt; - underlying terrain mesh.  Default value 21000&lt;br /&gt;
&lt;br /&gt;
So the ranges are calculated as follows:&lt;br /&gt;
* Detailed = &amp;lt;code&amp;gt;/sim/rendering/static-lod/detailed&amp;lt;/code&amp;gt;&lt;br /&gt;
* Rough = &amp;lt;code&amp;gt;/sim/rendering/static-lod/rough&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;/sim/rendering/static-lod/detailed&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;/sim/rendering/static-lod/rough-delta&amp;lt;/code&amp;gt;&lt;br /&gt;
* Bare = &amp;lt;code&amp;gt;/sim/rendering/static-lod/bare&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;/sim/rendering/static-lod/detailed&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;/sim/rendering/static-lod/rough-delta&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;/sim/rendering/static-lod/bare-delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How LoD works ==&lt;br /&gt;
{{See also|PagedLOD}}&lt;br /&gt;
&lt;br /&gt;
A scenery tile contains all three components - an underlying terrain mesh, trees (defined by the materials definition), and objects defined by the STG file for the tile.&lt;br /&gt;
&lt;br /&gt;
The set of scenery tiles that are to be loaded/unloaded are re-calculated each time the view changes to a different tile location (aka &amp;quot;bucket&amp;quot;), and based on the Bare range.  If &amp;lt;code&amp;gt;/sim/tile-cache/enable=true&amp;lt;/code&amp;gt;, then a cache is used to keep the 100 most recent tiles loaded.  Otherwise, they are unloaded as soon a they go out of range.&lt;br /&gt;
&lt;br /&gt;
The terrain mesh is loaded in a separate thread, and FlightGear creates PagedLoD objects for the trees and objects.  The PagedLoD is a piece of OSG code that will automatically load the required scenery when it comes into view and within the required range, then unload it if required when it goes out of view/range.  So as you approach a tile, firstly the terrain mesh will be loaded, then the trees and then the scenery objects. &lt;br /&gt;
&lt;br /&gt;
Obviously we need to unload objects otherwise memory usage will increase continually.  OSG keeps this in check by limiting the number of PagedLoDs that are loaded at any time.  To keep below the limit, it has a concept of object &amp;quot;expiring&amp;quot; after they have been out of view/range for a period of time.  Once an object has expired&lt;br /&gt;
&lt;br /&gt;
The way in which PagedLoD objects are unloaded is controlled through two properties:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/plod-minimum-expiry-time-secs&amp;lt;/code&amp;gt; - This is the minimum time before a PagedLoD will be unloaded (expired).  Default value is 180 seconds.&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/max-paged-lod&amp;lt;/code&amp;gt; - This is the maximum number of loaded PagedLoD nodes that OSG will keep.  Once this limit is reached, OSG will unload expired PagedLoD nodes, starting with &amp;quot;inactive&amp;quot; ones - those out of view.  Default value is 200.&lt;br /&gt;
&lt;br /&gt;
Note that PagedLoD nodes are also used for AI aircraft, so there can be interactions in behaviour with high numbers of AI aircraft and scenery tiles.&lt;br /&gt;
&lt;br /&gt;
== WS3.0 LoD ==&lt;br /&gt;
WS3.0 tiles have and in-build LoD hierarchy using PagedLoD.  The top level tile is 1x1 degree in size, and below that are 4 tiles of 0.5x0.5 degree and so on, down to the lowest LoD level.  Different scenery features are available at different LoD levels.  &lt;br /&gt;
&lt;br /&gt;
The table below shows the default values for the WS3.0 tiles.  As the earth is a sphere, the size of a 1x1 degree tile will vary with latitude.  The table below assumes 45 degrees of latitude.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!LoD Level&lt;br /&gt;
!Tile Size &lt;br /&gt;
(degrees)&lt;br /&gt;
!Tile Size &lt;br /&gt;
(km)&lt;br /&gt;
!Tile radius &lt;br /&gt;
(km)&lt;br /&gt;
!LoD Range &lt;br /&gt;
(km)&lt;br /&gt;
!Road/Railways displayed?&lt;br /&gt;
!Minimum road/railway width&lt;br /&gt;
(m)&lt;br /&gt;
!Random Vegetation?&lt;br /&gt;
!Detailed water?&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1x1&lt;br /&gt;
|79x111&lt;br /&gt;
|68&lt;br /&gt;
|n/a&lt;br /&gt;
|No&lt;br /&gt;
|9999&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|0.5x0.5&lt;br /&gt;
|40x56&lt;br /&gt;
|34&lt;br /&gt;
|204&lt;br /&gt;
|No&lt;br /&gt;
|9999&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|0.25x0.25&lt;br /&gt;
|20x28&lt;br /&gt;
|17&lt;br /&gt;
|102&lt;br /&gt;
|No&lt;br /&gt;
|9999&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|0.125x0.125&lt;br /&gt;
|10x14&lt;br /&gt;
|8.5&lt;br /&gt;
|51&lt;br /&gt;
|No&lt;br /&gt;
|20&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|0.0625x0.0625&lt;br /&gt;
|5x7&lt;br /&gt;
|4.3&lt;br /&gt;
|26&lt;br /&gt;
|No&lt;br /&gt;
|10&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|0.0313&lt;br /&gt;
|2.5x3.5&lt;br /&gt;
|2.1&lt;br /&gt;
|13&lt;br /&gt;
|Yes&lt;br /&gt;
|7&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|0.0156&lt;br /&gt;
|1.2x1.7&lt;br /&gt;
|1.1&lt;br /&gt;
|7&lt;br /&gt;
|Yes&lt;br /&gt;
|3&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/line-features-lod-level&amp;lt;/code&amp;gt; sets the minimum LoD level at which roads and railways are displayed.  At LoD levels less than this, no line feature are generated.  The default value is 5.  &lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/vegetation-lod-level&amp;lt;/code&amp;gt; sets the minimum LoD level at which random vegetation is generated.  At LoD levels less than this no vegetation is generated.  The default value is 6.&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/lod-level[n]/line-features-min-width&amp;lt;/code&amp;gt; set the minimum width of line features that will be generated for LoD Level &amp;quot;n&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This LoD configuration can be configured from the &amp;lt;code&amp;gt;View -&amp;gt; Adjust LoD Ranges&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery|LoD]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_LoD&amp;diff=139978</id>
		<title>Scenery LoD</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Scenery_LoD&amp;diff=139978"/>
		<updated>2024-06-17T18:52:10Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Given the large distances that need to drawn in FlightGear, we use '''Level of Detail (LoD)''' to control how much of the scenery that is rendered at what distance to ensure frame-rates are reasonable.&lt;br /&gt;
&lt;br /&gt;
== How LoD is Controlled ==&lt;br /&gt;
{{See also|Level Of Detail (LOD) Ranges}}&lt;br /&gt;
&lt;br /&gt;
There are three ranges that can be configured:&lt;br /&gt;
&lt;br /&gt;
; Detailed&lt;br /&gt;
: The range at which detailed scenery objects are displayed.  Default value is 1500 m.&lt;br /&gt;
&lt;br /&gt;
; Rough&lt;br /&gt;
: The range at which trees are displayed.  Note that to avoid forests suddenly appearing, trees are slowly faded in from 2xRough range.  Default value 9 km.&lt;br /&gt;
&lt;br /&gt;
; Bare&lt;br /&gt;
: The range at which the underlying terrain mesh is displayed.  Default value 30 km.&lt;br /&gt;
&lt;br /&gt;
Scenery LoD is controlled from the '''View-&amp;gt;Adjust LOD Ranges''' menu item in the simulator.  &lt;br /&gt;
&lt;br /&gt;
It should always be the case that Detailed &amp;lt; Rough &amp;lt; Bare.  So in the dialog the Rough and Bare ranges are controlled as a delta on top of the Detailed range.  Specifically the following properties &lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/detailed&amp;lt;/code&amp;gt; - Defaults value 1500m&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/rough-delta&amp;lt;/code&amp;gt; - Defaults value 7500&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/bare-delta&amp;lt;/code&amp;gt; - underlying terrain mesh.  Default value 21000&lt;br /&gt;
&lt;br /&gt;
So the ranges are calculated as follows:&lt;br /&gt;
* Detailed = &amp;lt;code&amp;gt;/sim/rendering/static-lod/detailed&amp;lt;/code&amp;gt;&lt;br /&gt;
* Rough = &amp;lt;code&amp;gt;/sim/rendering/static-lod/rough&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;/sim/rendering/static-lod/detailed&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;/sim/rendering/static-lod/rough-delta&amp;lt;/code&amp;gt;&lt;br /&gt;
* Bare = &amp;lt;code&amp;gt;/sim/rendering/static-lod/bare&amp;lt;/code&amp;gt; = &amp;lt;code&amp;gt;/sim/rendering/static-lod/detailed&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;/sim/rendering/static-lod/rough-delta&amp;lt;/code&amp;gt; + &amp;lt;code&amp;gt;/sim/rendering/static-lod/bare-delta&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How LoD works ==&lt;br /&gt;
{{See also|PagedLOD}}&lt;br /&gt;
&lt;br /&gt;
A scenery tile contains all three components - an underlying terrain mesh, trees (defined by the materials definition), and objects defined by the STG file for the tile.&lt;br /&gt;
&lt;br /&gt;
The set of scenery tiles that are to be loaded/unloaded are re-calculated each time the view changes to a different tile location (aka &amp;quot;bucket&amp;quot;), and based on the Bare range.  If &amp;lt;code&amp;gt;/sim/tile-cache/enable=true&amp;lt;/code&amp;gt;, then a cache is used to keep the 100 most recent tiles loaded.  Otherwise, they are unloaded as soon a they go out of range.&lt;br /&gt;
&lt;br /&gt;
The terrain mesh is loaded in a separate thread, and FlightGear creates PagedLoD objects for the trees and objects.  The PagedLoD is a piece of OSG code that will automatically load the required scenery when it comes into view and within the required range, then unload it if required when it goes out of view/range.  So as you approach a tile, firstly the terrain mesh will be loaded, then the trees and then the scenery objects. &lt;br /&gt;
&lt;br /&gt;
Obviously we need to unload objects otherwise memory usage will increase continually.  OSG keeps this in check by limiting the number of PagedLoDs that are loaded at any time.  To keep below the limit, it has a concept of object &amp;quot;expiring&amp;quot; after they have been out of view/range for a period of time.  Once an object has expired&lt;br /&gt;
&lt;br /&gt;
The way in which PagedLoD objects are unloaded is controlled through two properties:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/plod-minimum-expiry-time-secs&amp;lt;/code&amp;gt; - This is the minimum time before a PagedLoD will be unloaded (expired).  Default value is 180 seconds.&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/max-paged-lod&amp;lt;/code&amp;gt; - This is the maximum number of loaded PagedLoD nodes that OSG will keep.  Once this limit is reached, OSG will unload expired PagedLoD nodes, starting with &amp;quot;inactive&amp;quot; ones - those out of view.  Default value is 200.&lt;br /&gt;
&lt;br /&gt;
Note that PagedLoD nodes are also used for AI aircraft, so there can be interactions in behaviour with high numbers of AI aircraft and scenery tiles.&lt;br /&gt;
&lt;br /&gt;
== WS3.0 LoD ==&lt;br /&gt;
WS3.0 tiles have and in-build LoD hierarchy using PagedLoD.  The top level tile is 1x1 degree in size, and below that are 4 tiles of 0.5x0.5 degree and so on, down to the lowest LoD level.  Different scenery features are available at different LoD levels.  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The table below shows the default values for the WS3.0 tiles&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!LoD Level&lt;br /&gt;
!Tile Size (degrees)&lt;br /&gt;
!Tile Size at 45 degrees latitude &lt;br /&gt;
(km)&lt;br /&gt;
!Tile radius &lt;br /&gt;
(km)&lt;br /&gt;
!LoD Range &lt;br /&gt;
(km)&lt;br /&gt;
!Road/Railways displayed?&lt;br /&gt;
!Minimum road/railway width&lt;br /&gt;
(m)&lt;br /&gt;
!Random Vegetation?&lt;br /&gt;
!Detailed water?&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|1x1&lt;br /&gt;
|79x111&lt;br /&gt;
|68&lt;br /&gt;
|n/a&lt;br /&gt;
|No&lt;br /&gt;
|9999&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|0.5x0.5&lt;br /&gt;
|40x56&lt;br /&gt;
|34&lt;br /&gt;
|204&lt;br /&gt;
|No&lt;br /&gt;
|9999&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|0.25x0.25&lt;br /&gt;
|20x28&lt;br /&gt;
|17&lt;br /&gt;
|102&lt;br /&gt;
|No&lt;br /&gt;
|9999&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|0.125x0.125&lt;br /&gt;
|10x14&lt;br /&gt;
|8.5&lt;br /&gt;
|51&lt;br /&gt;
|No&lt;br /&gt;
|20&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|0.0625x0.0625&lt;br /&gt;
|5x7&lt;br /&gt;
|4.3&lt;br /&gt;
|26&lt;br /&gt;
|No&lt;br /&gt;
|10&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|5&lt;br /&gt;
|0.0313&lt;br /&gt;
|2.5x3.5&lt;br /&gt;
|2.1&lt;br /&gt;
|13&lt;br /&gt;
|Yes&lt;br /&gt;
|7&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|6&lt;br /&gt;
|0.0156&lt;br /&gt;
|1.2x1.7&lt;br /&gt;
|1.1&lt;br /&gt;
|7&lt;br /&gt;
|Yes&lt;br /&gt;
|3&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/line-features-lod-level&amp;lt;/code&amp;gt; sets the minimum LoD level at which roads and railways are displayed.  At LoD levels less than this, no line feature are generated.  The default value is 5.  &lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/vegetation-lod-level&amp;lt;/code&amp;gt; sets the minimum LoD level at which random vegetation is generated.  At LoD levels less than this no vegetation is generated.  The default value is 6.&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/static-lod/lod-level[n]/line-features-min-width&amp;lt;/code&amp;gt; set the minimum width of line features that will be generated for LoD Level &amp;quot;n&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This LoD configuration can be configured from the &amp;lt;code&amp;gt;View -&amp;gt; Adjust LoD Ranges&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery|LoD]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139969</id>
		<title>World Scenery 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139969"/>
		<updated>2024-06-13T22:43:21Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 is a project to replace the tiled single-mesh World Scenery 2.0 with an LoD-based approach using a regular elevation mesh, landclass texture and vector line features.&lt;br /&gt;
&lt;br /&gt;
This leverages OSG's Virtual Planet Builder and OpenStreetmap APIs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
For further information:&lt;br /&gt;
&lt;br /&gt;
* [[World Scenery 3.0 roadmap]]&lt;br /&gt;
* [[World Scenery 3.0 rendering]]&lt;br /&gt;
* [[World Scenery 3.0 coastlines]]&lt;br /&gt;
* [[WS3.0 Performance Testing]]&lt;br /&gt;
* [[Howto:Create WS3.0 terrain]]&lt;br /&gt;
* [[Virtual Planet Builder]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Currently Available Scenery ==&lt;br /&gt;
&lt;br /&gt;
=== Terrain ===&lt;br /&gt;
Scenery is currently not distributed using the official Terrasync, Nia provides a terrasync compatible download, point your terrasync client to https://de1mirror.flightgear.org/ws3/ to make use of it. As of writing (2024-01-15) it contains all of the sceneries below (duplicates removed) and will get updated when a new Airports package is made and when Wayne provides her with new US scenery. If you don't wanna deal with changing your terrasync settings, you can always download sections of scenery via the links individually and added to your [[FG SCENERY|scenery path]].  If you set these in your scenery path ahead of any other scenery, it will pick up osm2city, scenery objects etc. from the underlying scenery as well.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Currently Available World Scenery 3.0&lt;br /&gt;
!Scenery&lt;br /&gt;
!Area&lt;br /&gt;
!Size &lt;br /&gt;
!Bottom Left&lt;br /&gt;
!Top Right&lt;br /&gt;
!Area (degrees^2)&lt;br /&gt;
!Landclass Source&lt;br /&gt;
!Landclass Resolution (m)&lt;br /&gt;
!Raster format&lt;br /&gt;
!Comments&lt;br /&gt;
!Osm2city Scenery for WS3&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1EapHG6qEYU6CWdXnp0_aqjUaX61Lk5EL/view?usp=sharing WS30_UK]&lt;br /&gt;
|UK and Eire&lt;br /&gt;
|1.5GB&lt;br /&gt;
| -11,49&lt;br /&gt;
|1,60&lt;br /&gt;
|121&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes detailed roads and water features.  &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/120QOxfTWEm6EBmjK0eCNb07hrm3clavi/view?usp=sharing NL (terrain only)]&lt;br /&gt;
|Amsterdam and Lelystad&lt;br /&gt;
|716MB (ca. 8GB uncompressed)&lt;br /&gt;
|2,50&lt;br /&gt;
|10,53&lt;br /&gt;
|24&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap.  Check out the canals!&lt;br /&gt;
|[https://drive.google.com/file/d/13inL4UqSyvRh5FVq62quVOYXnlEhxU1G/view?usp=sharing contains osm2city stuff incl. trees etc. also contains the static objects from Terrascync]. NB: contains also the terrain - no need to download the terrain seperatly (as per first column). Use with the new airport download and do NOT run on top of WS2.0 scenery.&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1MrYuDKbMl4WhCEq9gnnt8Tz61lTAScvD/view?usp=share_link WS_Alps]&lt;br /&gt;
|&lt;br /&gt;
|49MB&lt;br /&gt;
|6,45&lt;br /&gt;
|8,47&lt;br /&gt;
|4&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1x-kuCTfyMWddTi0fbr_nl41LR41Ylvwb/view?usp=share_link WS30_MTQ]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|[https://drive.google.com/file/d/1QtojSTbnAAfkMzirQHnDJWbBDGOtnwIK/view?usp=sharing osm2city buildings, trees, maritime, pylons etc.] (ca. 40 MB).&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/14kbbgXbofDmqxho-bMCfOG4jDwcDqwBd/view?usp=share_link WS30_MTQ_25m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1-LS3yQZ0OkWX38Ne89n69wtrT7SreV69/view?usp=sharing WS_MTQ_5m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|8MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap. Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1Um7WC8h8Y4BlwgoVSd2xoVO5gTd3E-bI/view?usp=sharing Switzerland_5m]&lt;br /&gt;
|Switzerland plus small border&lt;br /&gt;
|1.4 GB (ca. 7 GB unzipped)&lt;br /&gt;
| 5.75,45.75&lt;br /&gt;
| 10.75,48&lt;br /&gt;
|10&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|By mistake taken default airports. If you are using Nia's updated airports, then it will most often work fine, but there might be residuals with osm2city (e.g. tree on APRON).&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://de1mirror.flightgear.org/hosting/wayne/ WS3.0 USA]&lt;br /&gt;
|USA&lt;br /&gt;
|200 to 400 KB (zipped)&lt;br /&gt;
| 125,48&lt;br /&gt;
| 81,24&lt;br /&gt;
|&lt;br /&gt;
|NLCD, Tree Canopy Data&lt;br /&gt;
|30&lt;br /&gt;
|&lt;br /&gt;
|by state&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/SP-NTX/PolandWS30/ Poland]&lt;br /&gt;
|Poland&lt;br /&gt;
|1.2GiB&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Airports ===&lt;br /&gt;
In addition to the selected areas above, global up-to-date WS3.0 airports have been built. You can find them [https://cdn.merspieler.tk/airports/ here]&lt;br /&gt;
&lt;br /&gt;
=== Scenery Files Placement ===&lt;br /&gt;
Uncompress the downloaded scenery files into a folder of your choice, such as E:\MySceneryFolder. To be recognized by FlightGear, the selected scenery (from the table above) must be located in a folder with a &amp;quot;vpb&amp;quot; subfolder, such as (EX: C:\mysceneryfolder\hawaii\vpb). The scenery files above are compressed and include the &amp;quot;vpb&amp;quot; folder.&lt;br /&gt;
&lt;br /&gt;
=== Installing ===&lt;br /&gt;
Using the FlightGear [[FlightGear_Qt_launcher]] both the terrain and the airport are &amp;quot;installed&amp;quot; by going to tab &amp;quot;Add-ons&amp;quot; and then add the respective folders to &amp;quot;Additional scenery folders&amp;quot;. When adding an additional scenery folder, you need to point to the folder immediately above the &amp;quot;vpb&amp;quot; subfolder. &lt;br /&gt;
&lt;br /&gt;
If you add the airports the first time you might have to close the launcher and reopen it again to get the navigation data loaded properly into the session.&lt;br /&gt;
&lt;br /&gt;
== Running World Scenery 3.0 ==&lt;br /&gt;
To run WS3.0 you need to set the &amp;lt;code&amp;gt;/scenery/use-vpb&amp;lt;/code&amp;gt; property to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; at startup.  Either set &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; on your command-line, or in the Launcher in &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Rendering&amp;quot; (you might need to click on &amp;quot;Show more&amp;quot; on the right side to see the choice for &amp;quot;Scenery version&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
WS3.0 can use a lot of memory - significantly more than WS2.0.  You can control the memory usage with the following properties:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/max-paged-lod&amp;lt;/code&amp;gt; controls the minimum number of objects that will be kept in memory.  The default setting is 200.&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/plod-minimum-expiry-time-secs&amp;lt;/code&amp;gt; controls how long objects remain loaded for after they are no-longer in view.  The default value is 180 (3 minutes).&lt;br /&gt;
&lt;br /&gt;
Reducing these properties will reduce the memory footprint of WS3.0.&lt;br /&gt;
&lt;br /&gt;
If you have lots of spare cores, you can run multiple threads to load scenery by setting &amp;lt;code&amp;gt;/sim/rendering/database-pager/threads&amp;lt;/code&amp;gt; to a number greater than 4 on startup.  E.g. &amp;lt;code&amp;gt;--prop:/sim/rendering/database-pager/threads=8&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== WS 2.0 scenery might still be needed ===&lt;br /&gt;
To have airports displayed plus some of the default scenery objects, you might still want to have the WS 2.0 scenery for the same area installed.&lt;br /&gt;
&lt;br /&gt;
However, if you want updated airports, checkout the global WS3.0 airports above. To avoid collisions you need to not have any WS2.0 airports enabled if you use these.&lt;br /&gt;
&lt;br /&gt;
=== Using osm2city ===&lt;br /&gt;
WS3.0 has built-in support for OpenStreetMap roads, so you should not have it enabled in rendering settings.&lt;br /&gt;
&lt;br /&gt;
You have 2 options:&lt;br /&gt;
&lt;br /&gt;
* If you have WS2.0 world scenery, then it already contains osm2city buildings etc. You can just use these and live with slight elevation offsets.&lt;br /&gt;
* The other option is to use the provided osm2city scenery in the table above instead. If doing so you need to makes sure that WS2.0 osm2city has not been downloaded (or delete the folders manually). E.g. if you are using [[TerraMaster]] then you can remove the ticks in Settings for &amp;quot;Buildings&amp;quot;, &amp;quot;Pylons&amp;quot; and &amp;quot;Roads&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Using the explicitly provided osm2city scenery gives you trees in gardens/parks and some improvements only available on NEXT.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139968</id>
		<title>World Scenery 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139968"/>
		<updated>2024-06-13T22:42:47Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 is a project to replace the tiled single-mesh World Scenery 2.0 with an LoD-based approach using a regular elevation mesh, landclass texture and vector line features.&lt;br /&gt;
&lt;br /&gt;
This leverages OSG's Virtual Planet Builder and OpenStreetmap APIs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
For further information:&lt;br /&gt;
&lt;br /&gt;
* [[World Scenery 3.0 roadmap]]&lt;br /&gt;
* [[World Scenery 3.0 rendering]]&lt;br /&gt;
* [[World Scenery 3.0 coastlines]]&lt;br /&gt;
* [[WS3.0 Performance Testing]]&lt;br /&gt;
* [[Howto:Create WS3.0 terrain]]&lt;br /&gt;
* [[Virtual Planet Builder]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Currently Available Scenery ==&lt;br /&gt;
&lt;br /&gt;
=== Terrain ===&lt;br /&gt;
Scenery is currently not distributed using the official Terrasync, Nia provides a terrasync compatible download, point your terrasync client to https://de1mirror.flightgear.org/ws3/ to make use of it. As of writing (2024-01-15) it contains all of the sceneries below (duplicates removed) and will get updated when a new Airports package is made and when Wayne provides her with new US scenery. If you don't wanna deal with changing your terrasync settings, you can always download sections of scenery via the links individually and added to your [[FG SCENERY|scenery path]].  If you set these in your scenery path ahead of any other scenery, it will pick up osm2city, scenery objects etc. from the underlying scenery as well.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Currently Available World Scenery 3.0&lt;br /&gt;
!Scenery&lt;br /&gt;
!Area&lt;br /&gt;
!Size &lt;br /&gt;
!Bottom Left&lt;br /&gt;
!Top Right&lt;br /&gt;
!Area (degrees^2)&lt;br /&gt;
!Landclass Source&lt;br /&gt;
!Landclass Resolution (m)&lt;br /&gt;
!Raster format&lt;br /&gt;
!Comments&lt;br /&gt;
!Osm2city Scenery for WS3&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1EapHG6qEYU6CWdXnp0_aqjUaX61Lk5EL/view?usp=sharing WS30_UK]&lt;br /&gt;
|UK and Eire&lt;br /&gt;
|1.5GB&lt;br /&gt;
| -11,49&lt;br /&gt;
|1,60&lt;br /&gt;
|121&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes detailed roads and water features.&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/120QOxfTWEm6EBmjK0eCNb07hrm3clavi/view?usp=sharing NL (terrain only)]&lt;br /&gt;
|Amsterdam and Lelystad&lt;br /&gt;
|716MB (ca. 8GB uncompressed)&lt;br /&gt;
|2,50&lt;br /&gt;
|10,53&lt;br /&gt;
|24&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap.  Check out the canals!&lt;br /&gt;
|[https://drive.google.com/file/d/13inL4UqSyvRh5FVq62quVOYXnlEhxU1G/view?usp=sharing contains osm2city stuff incl. trees etc. also contains the static objects from Terrascync]. NB: contains also the terrain - no need to download the terrain seperatly (as per first column). Use with the new airport download and do NOT run on top of WS2.0 scenery.&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1MrYuDKbMl4WhCEq9gnnt8Tz61lTAScvD/view?usp=share_link WS_Alps]&lt;br /&gt;
|&lt;br /&gt;
|49MB&lt;br /&gt;
|6,45&lt;br /&gt;
|8,47&lt;br /&gt;
|4&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1x-kuCTfyMWddTi0fbr_nl41LR41Ylvwb/view?usp=share_link WS30_MTQ]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|[https://drive.google.com/file/d/1QtojSTbnAAfkMzirQHnDJWbBDGOtnwIK/view?usp=sharing osm2city buildings, trees, maritime, pylons etc.] (ca. 40 MB).&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/14kbbgXbofDmqxho-bMCfOG4jDwcDqwBd/view?usp=share_link WS30_MTQ_25m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|PNG&lt;br /&gt;
|Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1-LS3yQZ0OkWX38Ne89n69wtrT7SreV69/view?usp=sharing WS_MTQ_5m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|8MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|Includes high resolution water raster from OpenStreetMap. Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1Um7WC8h8Y4BlwgoVSd2xoVO5gTd3E-bI/view?usp=sharing Switzerland_5m]&lt;br /&gt;
|Switzerland plus small border&lt;br /&gt;
|1.4 GB (ca. 7 GB unzipped)&lt;br /&gt;
| 5.75,45.75&lt;br /&gt;
| 10.75,48&lt;br /&gt;
|10&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG&lt;br /&gt;
|By mistake taken default airports. If you are using Nia's updated airports, then it will most often work fine, but there might be residuals with osm2city (e.g. tree on APRON).&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://de1mirror.flightgear.org/hosting/wayne/ WS3.0 USA]&lt;br /&gt;
|USA&lt;br /&gt;
|200 to 400 KB (zipped)&lt;br /&gt;
| 125,48&lt;br /&gt;
| 81,24&lt;br /&gt;
|&lt;br /&gt;
|NLCD, Tree Canopy Data&lt;br /&gt;
|30&lt;br /&gt;
|&lt;br /&gt;
|by state&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/SP-NTX/PolandWS30/ Poland]&lt;br /&gt;
|Poland&lt;br /&gt;
|1.2GiB&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Airports ===&lt;br /&gt;
In addition to the selected areas above, global up-to-date WS3.0 airports have been built. You can find them [https://cdn.merspieler.tk/airports/ here]&lt;br /&gt;
&lt;br /&gt;
=== Scenery Files Placement ===&lt;br /&gt;
Uncompress the downloaded scenery files into a folder of your choice, such as E:\MySceneryFolder. To be recognized by FlightGear, the selected scenery (from the table above) must be located in a folder with a &amp;quot;vpb&amp;quot; subfolder, such as (EX: C:\mysceneryfolder\hawaii\vpb). The scenery files above are compressed and include the &amp;quot;vpb&amp;quot; folder.&lt;br /&gt;
&lt;br /&gt;
=== Installing ===&lt;br /&gt;
Using the FlightGear [[FlightGear_Qt_launcher]] both the terrain and the airport are &amp;quot;installed&amp;quot; by going to tab &amp;quot;Add-ons&amp;quot; and then add the respective folders to &amp;quot;Additional scenery folders&amp;quot;. When adding an additional scenery folder, you need to point to the folder immediately above the &amp;quot;vpb&amp;quot; subfolder. &lt;br /&gt;
&lt;br /&gt;
If you add the airports the first time you might have to close the launcher and reopen it again to get the navigation data loaded properly into the session.&lt;br /&gt;
&lt;br /&gt;
== Running World Scenery 3.0 ==&lt;br /&gt;
To run WS3.0 you need to set the &amp;lt;code&amp;gt;/scenery/use-vpb&amp;lt;/code&amp;gt; property to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; at startup.  Either set &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; on your command-line, or in the Launcher in &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Rendering&amp;quot; (you might need to click on &amp;quot;Show more&amp;quot; on the right side to see the choice for &amp;quot;Scenery version&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
WS3.0 can use a lot of memory - significantly more than WS2.0.  You can control the memory usage with the following properties:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/max-paged-lod&amp;lt;/code&amp;gt; controls the minimum number of objects that will be kept in memory.  The default setting is 200.&lt;br /&gt;
* &amp;lt;code&amp;gt;/sim/rendering/plod-minimum-expiry-time-secs&amp;lt;/code&amp;gt; controls how long objects remain loaded for after they are no-longer in view.  The default value is 180 (3 minutes).&lt;br /&gt;
&lt;br /&gt;
Reducing these properties will reduce the memory footprint of WS3.0.&lt;br /&gt;
&lt;br /&gt;
If you have lots of spare cores, you can run multiple threads to load scenery by setting &amp;lt;code&amp;gt;/sim/rendering/database-pager/threads&amp;lt;/code&amp;gt; to a number greater than 4 on startup.  E.g. &amp;lt;code&amp;gt;--prop:/sim/rendering/database-pager/threads=8&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== WS 2.0 scenery might still be needed ===&lt;br /&gt;
To have airports displayed plus some of the default scenery objects, you might still want to have the WS 2.0 scenery for the same area installed.&lt;br /&gt;
&lt;br /&gt;
However, if you want updated airports, checkout the global WS3.0 airports above. To avoid collisions you need to not have any WS2.0 airports enabled if you use these.&lt;br /&gt;
&lt;br /&gt;
=== Using osm2city ===&lt;br /&gt;
WS3.0 has built-in support for OpenStreetMap roads, so you should not have it enabled in rendering settings.&lt;br /&gt;
&lt;br /&gt;
You have 2 options:&lt;br /&gt;
&lt;br /&gt;
* If you have WS2.0 world scenery, then it already contains osm2city buildings etc. You can just use these and live with slight elevation offsets.&lt;br /&gt;
* The other option is to use the provided osm2city scenery in the table above instead. If doing so you need to makes sure that WS2.0 osm2city has not been downloaded (or delete the folders manually). E.g. if you are using [[TerraMaster]] then you can remove the ticks in Settings for &amp;quot;Buildings&amp;quot;, &amp;quot;Pylons&amp;quot; and &amp;quot;Roads&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Using the explicitly provided osm2city scenery gives you trees in gardens/parks and some improvements only available on NEXT.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139965</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139965"/>
		<updated>2024-06-11T20:24:41Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Running the docker container */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate basic WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of three parts:&lt;br /&gt;
&lt;br /&gt;
# A terrain mesh consisting of a landclass texture draped over an elevation model.  &lt;br /&gt;
# A high resolution water raster used to show water features such as rivers, lakes and coastline with more definition&lt;br /&gt;
# Line features such as roads and railways.&lt;br /&gt;
&lt;br /&gt;
The terrain is generated by a set of tools that are packaged in a docker image for convenience.[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Set up a Workspace ===&lt;br /&gt;
Create a directory with the following sub-directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;cache&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/vpb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/Terrain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Docker ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#Pull the docker image by running the following command&lt;br /&gt;
&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run &amp;lt;code&amp;gt;docker login&amp;lt;/code&amp;gt; before the '''docker pull''' command above&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
You need two pieces of data for the area of scenery you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  This indicates what altitude each point of the surface is.&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster (effectively a texture), or vector data.  &lt;br /&gt;
&lt;br /&gt;
=== Elevation Model ===&lt;br /&gt;
Download the NASADEM elevation model for the area of scenery you wish to generate.  This is available in 1x1 degree blocks from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].  &lt;br /&gt;
&lt;br /&gt;
Unzip the files into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== Landclass Raster ===&lt;br /&gt;
Download an landclass raster for the area of scenery you wish to generate.&lt;br /&gt;
&lt;br /&gt;
* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
* For the USA [https://www.mrlc.gov/viewer/ NLCD] is recommended&lt;br /&gt;
* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
&lt;br /&gt;
Put these into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
More detailed terrain can be created by modifying the landclass raster, and/or generating a new raster from vector data.  These processes are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Generating Terrain ==&lt;br /&gt;
To generate terrain you need to run the tools within the docker container we installed above.  The docker image is like a small, independent virtual computing environment running within your system.  This particular docker image has all the scenery generation tools already installed.&lt;br /&gt;
&lt;br /&gt;
=== Running the docker container ===&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;cache&amp;lt;/code&amp;gt;,  &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/cache,target=/home/flightgear/cache&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 cache data output&lt;br /&gt;
&lt;br /&gt;
=== Building the terrain ===&lt;br /&gt;
To build the terrain mesh, use the &amp;lt;code&amp;gt;genVPB.py&amp;lt;/code&amp;gt; tool from inside the docker container.&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
For example, to generate a piece of terrain around Edinburgh (latitude 55.5, longitude 3 degrees West)&lt;br /&gt;
 ./scripts/genVPB.py -3 55 -2 56 ./data/uk_wgs84_10m_N54.tif &lt;br /&gt;
If you are using anything other than a CORINE raster you will need to reclassify the data to match the landclasses used by FlightGear.  Those classes are defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].  You can reclassify them using the files in the [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/ scripts/mappings] directory. E.g. to reclassify NLCD2019 data you can use &amp;lt;code&amp;gt;--reclassify ./scripts/mappings/nlcd2019.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
genVPB.py will output the data to the output/vpb directory, in which you should find a series of files and directories.&lt;br /&gt;
&lt;br /&gt;
=== Adding water ===&lt;br /&gt;
The terrain mesh does not have highly detailed water features - as typically the source data has a resolution of 10-25m.  Water features are generated from OpenStreetMap data.  To generate water features simply run the genwaterraster.py command.&lt;br /&gt;
 Usage: ./scripts/genwaterraster.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt; [Cache]&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
   [Cache]            Optional directory to cache OpenStreetMap data to reduce API requests&lt;br /&gt;
The scenery directory should be your output/vpb directory created above.  For example, to generate water for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/vpb -4 55 -3 56 ./cache&lt;br /&gt;
Inside the ./output/vpb directory there should be a set of directories and .png files.&lt;br /&gt;
&lt;br /&gt;
=== Adding roads and railways ===&lt;br /&gt;
The terrain mesh does not have any line features - things like roads.  These are generated separately from OpenStreetMap data.  To generate line features simply run the genroads.py command:&lt;br /&gt;
 Usage: ./scripts/genroads.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt; [Cache]&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
   [Cache]            Optional directory to cache OpenStreetMap data to reduce API requests&lt;br /&gt;
&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate roads for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56 ./cache&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and, .STG files text files.&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the output directory in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
The following sections describe more complex techniques to generate higher quality WS3.0 terrain.  Almost all of them involve using different data sources to generate a more detailed landclass raster before running the final scenery generation processes described above.  Generating a highly detailed landclass raster is where the magic happens.  &lt;br /&gt;
&lt;br /&gt;
Most techniques use gdal or grass to modify the raster/vector data, typically using the QGIS program.&lt;br /&gt;
&lt;br /&gt;
=== Using a different elevation model ===&lt;br /&gt;
If you are using another elevation model other than NASAEM, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).  &lt;br /&gt;
&lt;br /&gt;
=== Landclass Data Requirements ===&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  We use a set of values based on the CORINE raster set, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS84 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.&lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.  &lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;Toggle Editing Mode&amp;lt;/code&amp;gt; (Ctrl + E), on the top left of the dialog&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box (without the comment lines starting with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;).  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.  Best practise is to create long thin strips of 1 degree latitude in height, as this makes subsequent processing much easier.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  genVPB.py has an option to do this, but you may wish to do so manually.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
Use the prevailing tree type, for Deciduous use * 41, for Evergreen use  * 42, for MixedForest use 43.&lt;br /&gt;
&lt;br /&gt;
Later we add this Tree Canopy layer to the raster where there is currently no trees in the NLCD&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - &lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step adds the Tree Canopy layer to the existing NLCD raster only where there is currently no existing tree land cover.&lt;br /&gt;
&lt;br /&gt;
((&amp;quot;California-Southern_4326-84@1&amp;quot; &amp;gt; 0 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 41 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 42 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 43) AND &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;gt; 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; + (&amp;quot;California-Southern_4326-84@1&amp;quot; = 41 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 42 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 43 OR &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt;= 0) * &amp;quot;California-Southern_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 2x, 4x or 8x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
2x Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
2x Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
4x Horizontal = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
4x Vertical = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
8x Horizontal = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
8x Vertical = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
===Generating the Terrain using osgdem===&lt;br /&gt;
Instead of using genVPB.py, you may wish to run osgdem directly.&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Packaging the Scenery===&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139964</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139964"/>
		<updated>2024-06-11T20:23:38Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Add cache information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate basic WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of three parts:&lt;br /&gt;
&lt;br /&gt;
# A terrain mesh consisting of a landclass texture draped over an elevation model.  &lt;br /&gt;
# A high resolution water raster used to show water features such as rivers, lakes and coastline with more definition&lt;br /&gt;
# Line features such as roads and railways.&lt;br /&gt;
&lt;br /&gt;
The terrain is generated by a set of tools that are packaged in a docker image for convenience.[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Set up a Workspace ===&lt;br /&gt;
Create a directory with the following sub-directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;cache&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/vpb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/Terrain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Docker ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#Pull the docker image by running the following command&lt;br /&gt;
&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run &amp;lt;code&amp;gt;docker login&amp;lt;/code&amp;gt; before the '''docker pull''' command above&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
You need two pieces of data for the area of scenery you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  This indicates what altitude each point of the surface is.&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster (effectively a texture), or vector data.  &lt;br /&gt;
&lt;br /&gt;
=== Elevation Model ===&lt;br /&gt;
Download the NASADEM elevation model for the area of scenery you wish to generate.  This is available in 1x1 degree blocks from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].  &lt;br /&gt;
&lt;br /&gt;
Unzip the files into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== Landclass Raster ===&lt;br /&gt;
Download an landclass raster for the area of scenery you wish to generate.&lt;br /&gt;
&lt;br /&gt;
* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
* For the USA [https://www.mrlc.gov/viewer/ NLCD] is recommended&lt;br /&gt;
* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
&lt;br /&gt;
Put these into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
More detailed terrain can be created by modifying the landclass raster, and/or generating a new raster from vector data.  These processes are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Generating Terrain ==&lt;br /&gt;
To generate terrain you need to run the tools within the docker container we installed above.  The docker image is like a small, independent virtual computing environment running within your system.  This particular docker image has all the scenery generation tools already installed.&lt;br /&gt;
&lt;br /&gt;
=== Running the docker container ===&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/cache,target=/home/flightgear/cache&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 cache data output&lt;br /&gt;
&lt;br /&gt;
=== Building the terrain ===&lt;br /&gt;
To build the terrain mesh, use the &amp;lt;code&amp;gt;genVPB.py&amp;lt;/code&amp;gt; tool from inside the docker container.&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
For example, to generate a piece of terrain around Edinburgh (latitude 55.5, longitude 3 degrees West)&lt;br /&gt;
 ./scripts/genVPB.py -3 55 -2 56 ./data/uk_wgs84_10m_N54.tif &lt;br /&gt;
If you are using anything other than a CORINE raster you will need to reclassify the data to match the landclasses used by FlightGear.  Those classes are defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].  You can reclassify them using the files in the [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/ scripts/mappings] directory. E.g. to reclassify NLCD2019 data you can use &amp;lt;code&amp;gt;--reclassify ./scripts/mappings/nlcd2019.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
genVPB.py will output the data to the output/vpb directory, in which you should find a series of files and directories.&lt;br /&gt;
&lt;br /&gt;
=== Adding water ===&lt;br /&gt;
The terrain mesh does not have highly detailed water features - as typically the source data has a resolution of 10-25m.  Water features are generated from OpenStreetMap data.  To generate water features simply run the genwaterraster.py command.&lt;br /&gt;
 Usage: ./scripts/genwaterraster.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt; [Cache]&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
   [Cache]            Optional directory to cache OpenStreetMap data to reduce API requests&lt;br /&gt;
The scenery directory should be your output/vpb directory created above.  For example, to generate water for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/vpb -4 55 -3 56 ./cache&lt;br /&gt;
Inside the ./output/vpb directory there should be a set of directories and .png files.&lt;br /&gt;
&lt;br /&gt;
=== Adding roads and railways ===&lt;br /&gt;
The terrain mesh does not have any line features - things like roads.  These are generated separately from OpenStreetMap data.  To generate line features simply run the genroads.py command:&lt;br /&gt;
 Usage: ./scripts/genroads.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt; [Cache]&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
   [Cache]            Optional directory to cache OpenStreetMap data to reduce API requests&lt;br /&gt;
&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate roads for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56 ./cache&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and, .STG files text files.&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the output directory in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
The following sections describe more complex techniques to generate higher quality WS3.0 terrain.  Almost all of them involve using different data sources to generate a more detailed landclass raster before running the final scenery generation processes described above.  Generating a highly detailed landclass raster is where the magic happens.  &lt;br /&gt;
&lt;br /&gt;
Most techniques use gdal or grass to modify the raster/vector data, typically using the QGIS program.&lt;br /&gt;
&lt;br /&gt;
=== Using a different elevation model ===&lt;br /&gt;
If you are using another elevation model other than NASAEM, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).  &lt;br /&gt;
&lt;br /&gt;
=== Landclass Data Requirements ===&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  We use a set of values based on the CORINE raster set, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS84 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.&lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.  &lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;Toggle Editing Mode&amp;lt;/code&amp;gt; (Ctrl + E), on the top left of the dialog&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box (without the comment lines starting with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;).  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.  Best practise is to create long thin strips of 1 degree latitude in height, as this makes subsequent processing much easier.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  genVPB.py has an option to do this, but you may wish to do so manually.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
Use the prevailing tree type, for Deciduous use * 41, for Evergreen use  * 42, for MixedForest use 43.&lt;br /&gt;
&lt;br /&gt;
Later we add this Tree Canopy layer to the raster where there is currently no trees in the NLCD&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - &lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step adds the Tree Canopy layer to the existing NLCD raster only where there is currently no existing tree land cover.&lt;br /&gt;
&lt;br /&gt;
((&amp;quot;California-Southern_4326-84@1&amp;quot; &amp;gt; 0 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 41 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 42 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 43) AND &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;gt; 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; + (&amp;quot;California-Southern_4326-84@1&amp;quot; = 41 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 42 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 43 OR &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt;= 0) * &amp;quot;California-Southern_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 2x, 4x or 8x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
2x Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
2x Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
4x Horizontal = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
4x Vertical = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
8x Horizontal = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
8x Vertical = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
===Generating the Terrain using osgdem===&lt;br /&gt;
Instead of using genVPB.py, you may wish to run osgdem directly.&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Packaging the Scenery===&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139963</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139963"/>
		<updated>2024-06-11T20:08:06Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate basic WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of two parts:&lt;br /&gt;
&lt;br /&gt;
# A terrain mesh consisting of a landclass texture draped over an elevation model.  &lt;br /&gt;
# Line features such as roads, railways, rivers and coastline.  &lt;br /&gt;
The terrain is generated by a set of tools that are packaged in a docker image for convenience.[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Set up a Workspace ===&lt;br /&gt;
Create a directory with the following sub-directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/vpb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/Terrain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Docker ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#Pull the docker image by running the following command&lt;br /&gt;
&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run &amp;lt;code&amp;gt;docker login&amp;lt;/code&amp;gt; before the '''docker pull''' command above&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
You need two pieces of data for the area of scenery you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  This indicates what altitude each point of the surface is.&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster (effectively a texture), or vector data.  &lt;br /&gt;
&lt;br /&gt;
=== Elevation Model ===&lt;br /&gt;
Download the NASADEM elevation model for the area of scenery you wish to generate.  This is available in 1x1 degree blocks from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].  &lt;br /&gt;
&lt;br /&gt;
Unzip the files into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== Landclass Raster ===&lt;br /&gt;
Download an landclass raster for the area of scenery you wish to generate.&lt;br /&gt;
&lt;br /&gt;
* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
* For the USA [https://www.mrlc.gov/viewer/ NLCD] is recommended&lt;br /&gt;
* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
&lt;br /&gt;
Put these into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
More detailed terrain can be created by modifying the landclass raster, and/or generating a new raster from vector data.  These processes are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Generating Terrain ==&lt;br /&gt;
To generate terrain you need to run the tools within the docker container we installed above.  The docker image is like a small, independent virtual computing environment running within your system.  This particular docker image has all the scenery generation tools already installed.&lt;br /&gt;
&lt;br /&gt;
=== Running the docker container ===&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 data  output&lt;br /&gt;
&lt;br /&gt;
=== Building the terrain ===&lt;br /&gt;
To build the terrain mesh, use the &amp;lt;code&amp;gt;genVPB.py&amp;lt;/code&amp;gt; tool from inside the docker container.&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
For example, to generate a piece of terrain around Edinburgh (latitude 55.5, longitude 3 degrees West)&lt;br /&gt;
 ./scripts/genVPB.py -3 55 -2 56 ./data/uk_wgs84_10m_N54.tif &lt;br /&gt;
If you are using anything other than a CORINE raster you will need to reclassify the data to match the landclasses used by FlightGear.  Those classes are defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].  You can reclassify them using the files in the [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/ scripts/mappings] directory. E.g. to reclassify NLCD2019 data you can use &amp;lt;code&amp;gt;--reclassify ./scripts/mappings/nlcd2019.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
genVPB.py will output the data to the output/vpb directory, in which you should find a series of files and directories.&lt;br /&gt;
&lt;br /&gt;
=== Adding water ===&lt;br /&gt;
The terrain mesh does not have highly detailed water features - as typically the source data has a resolution of 10-25m.  Water features are generated from OpenStreetMap data.  To generate water features simply run the genwaterraster.py command.&lt;br /&gt;
 Usage: ./scripts/genwaterraster.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt; [Cache]&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
   [Cache]            Optional directory to cache OpenStreetMap data to reduce API requests&lt;br /&gt;
The scenery directory should be your output/vpb directory created above.  For example, to generate water for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/vpb -4 55 -3 56&lt;br /&gt;
Inside the ./output/vpb directory there should be a set of directories and .png files.&lt;br /&gt;
&lt;br /&gt;
=== Adding roads and railways ===&lt;br /&gt;
The terrain mesh does not have any line features - things like roads.  These are generated separately from OpenStreetMap data.  To generate line features simply run the genroads.py command:&lt;br /&gt;
 Usage: ./scripts/genroads.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt; [Cache]&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
   [Cache]            Optional directory to cache OpenStreetMap data to reduce API requests&lt;br /&gt;
&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate roads for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and, .STG files text files.&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the output directory in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
The following sections describe more complex techniques to generate higher quality WS3.0 terrain.  Almost all of them involve using different data sources to generate a more detailed landclass raster before running the final scenery generation processes described above.  Generating a highly detailed landclass raster is where the magic happens.  &lt;br /&gt;
&lt;br /&gt;
Most techniques use gdal or grass to modify the raster/vector data, typically using the QGIS program.&lt;br /&gt;
&lt;br /&gt;
=== Using a different elevation model ===&lt;br /&gt;
If you are using another elevation model other than NASAEM, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).  &lt;br /&gt;
&lt;br /&gt;
=== Landclass Data Requirements ===&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  We use a set of values based on the CORINE raster set, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS84 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.&lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.  &lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;Toggle Editing Mode&amp;lt;/code&amp;gt; (Ctrl + E), on the top left of the dialog&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box (without the comment lines starting with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;).  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.  Best practise is to create long thin strips of 1 degree latitude in height, as this makes subsequent processing much easier.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  genVPB.py has an option to do this, but you may wish to do so manually.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
Use the prevailing tree type, for Deciduous use * 41, for Evergreen use  * 42, for MixedForest use 43.&lt;br /&gt;
&lt;br /&gt;
Later we add this Tree Canopy layer to the raster where there is currently no trees in the NLCD&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - &lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step adds the Tree Canopy layer to the existing NLCD raster only where there is currently no existing tree land cover.&lt;br /&gt;
&lt;br /&gt;
((&amp;quot;California-Southern_4326-84@1&amp;quot; &amp;gt; 0 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 41 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 42 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 43) AND &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;gt; 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; + (&amp;quot;California-Southern_4326-84@1&amp;quot; = 41 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 42 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 43 OR &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt;= 0) * &amp;quot;California-Southern_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 2x, 4x or 8x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
2x Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
2x Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
4x Horizontal = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
4x Vertical = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
8x Horizontal = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
8x Vertical = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
===Generating the Terrain using osgdem===&lt;br /&gt;
Instead of using genVPB.py, you may wish to run osgdem directly.&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Packaging the Scenery===&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=File:Diagram-export-21-12-2023-16_29_37.png&amp;diff=139962</id>
		<title>File:Diagram-export-21-12-2023-16 29 37.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=File:Diagram-export-21-12-2023-16_29_37.png&amp;diff=139962"/>
		<updated>2024-06-10T19:33:22Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Stuart uploaded a new version of File:Diagram-export-21-12-2023-16 29 37.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Basic WS3.0 Scenery Generation Process&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139961</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139961"/>
		<updated>2024-06-10T19:06:27Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Add genwaterraster.py command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate basic WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of two parts:&lt;br /&gt;
&lt;br /&gt;
# A terrain mesh consisting of a landclass texture draped over an elevation model.  &lt;br /&gt;
# Line features such as roads, railways, rivers and coastline.  &lt;br /&gt;
The terrain is generated by a set of tools that are packaged in a docker image for convenience.[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Set up a Workspace ===&lt;br /&gt;
Create a directory with the following sub-directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/vpb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/Terrain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Docker ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#Pull the docker image by running the following command&lt;br /&gt;
&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run &amp;lt;code&amp;gt;docker login&amp;lt;/code&amp;gt; before the '''docker pull''' command above&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
You need two pieces of data for the area of scenery you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  This indicates what altitude each point of the surface is.&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster (effectively a texture), or vector data.  &lt;br /&gt;
&lt;br /&gt;
=== Elevation Model ===&lt;br /&gt;
Download the NASADEM elevation model for the area of scenery you wish to generate.  This is available in 1x1 degree blocks from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].  &lt;br /&gt;
&lt;br /&gt;
Unzip the files into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== Landclass Raster ===&lt;br /&gt;
Download an landclass raster for the area of scenery you wish to generate.&lt;br /&gt;
&lt;br /&gt;
* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
* For the USA [https://www.mrlc.gov/viewer/ NLCD] is recommended&lt;br /&gt;
* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
&lt;br /&gt;
Put these into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
More detailed terrain can be created by modifying the landclass raster, and/or generating a new raster from vector data.  These processes are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Generating Terrain ==&lt;br /&gt;
To generate terrain you need to run the tools within the docker container we installed above.  The docker image is like a small, independent virtual computing environment running within your system.  This particular docker image has all the scenery generation tools already installed.&lt;br /&gt;
&lt;br /&gt;
=== Running the docker container ===&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 data  output&lt;br /&gt;
&lt;br /&gt;
=== Building the terrain ===&lt;br /&gt;
To build the terrain mesh, use the &amp;lt;code&amp;gt;genVPB.py&amp;lt;/code&amp;gt; tool from inside the docker container.&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
For example, to generate a piece of terrain around Edinburgh (latitude 55.5, longitude 3 degrees West)&lt;br /&gt;
 ./scripts/genVPB.py -3 55 -2 56 ./data/uk_wgs84_10m_N54.tif &lt;br /&gt;
If you are using anything other than a CORINE raster you will need to reclassify the data to match the landclasses used by FlightGear.  Those classes are defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].  You can reclassify them using the files in the [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/ scripts/mappings] directory. E.g. to reclassify NLCD2019 data you can use &amp;lt;code&amp;gt;--reclassify ./scripts/mappings/nlcd2019.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
genVPB.py will output the data to the output/vpb directory, in which you should find a series of files and directories.&lt;br /&gt;
&lt;br /&gt;
=== Adding water ===&lt;br /&gt;
The terrain mesh does not have highly detailed water features - as typically the source data has a resolution of 10-25m.  Water features are generated from OpenStreetMap data.  To generate water features simply run the genwaterraster.py command.&lt;br /&gt;
 Usage: ./scripts/genwaterraster.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt; [Cache]&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
   [Cache]            Optional directory to cache OpenStreetMap data to reduce API requests&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate water for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/vpb -4 55 -3 56&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and .png files.&lt;br /&gt;
&lt;br /&gt;
=== Adding roads and railways ===&lt;br /&gt;
The terrain mesh does not have any line features - things like roads.  These are generated separately from OpenStreetMap data.  To generate line features simply run the genroads.py command:&lt;br /&gt;
 Usage: ./scripts/genroads.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt; [Cache]&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
   [Cache]            Optional directory to cache OpenStreetMap data to reduce API requests&lt;br /&gt;
&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate roads for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and, .STG files text files.&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the output directory in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
The following sections describe more complex techniques to generate higher quality WS3.0 terrain.  Almost all of them involve using different data sources to generate a more detailed landclass raster before running the final scenery generation processes described above.  Generating a highly detailed landclass raster is where the magic happens.  &lt;br /&gt;
&lt;br /&gt;
Most techniques use gdal or grass to modify the raster/vector data, typically using the QGIS program.&lt;br /&gt;
&lt;br /&gt;
=== Using a different elevation model ===&lt;br /&gt;
If you are using another elevation model other than NASAEM, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).  &lt;br /&gt;
&lt;br /&gt;
=== Landclass Data Requirements ===&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  We use a set of values based on the CORINE raster set, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS84 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.&lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.  &lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;Toggle Editing Mode&amp;lt;/code&amp;gt; (Ctrl + E), on the top left of the dialog&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box (without the comment lines starting with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;).  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.  Best practise is to create long thin strips of 1 degree latitude in height, as this makes subsequent processing much easier.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  genVPB.py has an option to do this, but you may wish to do so manually.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
Use the prevailing tree type, for Deciduous use * 41, for Evergreen use  * 42, for MixedForest use 43.&lt;br /&gt;
&lt;br /&gt;
Later we add this Tree Canopy layer to the raster where there is currently no trees in the NLCD&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - &lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step adds the Tree Canopy layer to the existing NLCD raster only where there is currently no existing tree land cover.&lt;br /&gt;
&lt;br /&gt;
((&amp;quot;California-Southern_4326-84@1&amp;quot; &amp;gt; 0 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 41 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 42 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 43) AND &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;gt; 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; + (&amp;quot;California-Southern_4326-84@1&amp;quot; = 41 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 42 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 43 OR &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt;= 0) * &amp;quot;California-Southern_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 2x, 4x or 8x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
2x Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
2x Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
4x Horizontal = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
4x Vertical = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
8x Horizontal = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
8x Vertical = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
===Generating the Terrain using osgdem===&lt;br /&gt;
Instead of using genVPB.py, you may wish to run osgdem directly.&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Packaging the Scenery===&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Ubuntu_24.04_Package_List_and_Build_Hints&amp;diff=139944</id>
		<title>Ubuntu 24.04 Package List and Build Hints</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Ubuntu_24.04_Package_List_and_Build_Hints&amp;diff=139944"/>
		<updated>2024-06-07T16:01:35Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Packages required to build openscenegraph, simgear and flightgear next on Ubuntu 24.04 LTS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install g++ build-essential libpng12-dev libgl1-mesa-dev libnvtt-dev libboost-dev libopenal-dev libcurl3-dev qtbase5-private-dev qtdeclarative5-private-dev libplib-dev qt5 qttools5-dev libqt5svg5-dev qml-module-qtquick-controls2&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Ubuntu_24.04_Package_List_and_Build_Hints&amp;diff=139943</id>
		<title>Ubuntu 24.04 Package List and Build Hints</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Ubuntu_24.04_Package_List_and_Build_Hints&amp;diff=139943"/>
		<updated>2024-06-07T15:55:37Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Created page with &amp;quot;Packages required to build openscenegraph, simgear and flightgear next on Ubuntu 24.04 LTS.   &amp;lt;code&amp;gt;sudo apt-get install g++ build-essential libpng12-dev libgl1-mesa-dev libnvtt-dev libboost-dev libopenal-dev libcurl3-dev qtbase5-private-dev qtdeclarative5-private-dev libplib-dev qt5 qttools5-dev libqt5svg5-dev&amp;lt;/code&amp;gt;&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Packages required to build openscenegraph, simgear and flightgear next on Ubuntu 24.04 LTS.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;sudo apt-get install g++ build-essential libpng12-dev libgl1-mesa-dev libnvtt-dev libboost-dev libopenal-dev libcurl3-dev qtbase5-private-dev qtdeclarative5-private-dev libplib-dev qt5 qttools5-dev libqt5svg5-dev&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139214</id>
		<title>World Scenery 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139214"/>
		<updated>2024-02-29T21:10:23Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 is a project to replace the tiled single-mesh World Scenery 2.0 with an LoD-based approach using a regular elevation mesh, landclass texture and vector line features.&lt;br /&gt;
&lt;br /&gt;
This leverages OSG's Virtual Planet Builder and OpenStreetmap APIs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
For further information:&lt;br /&gt;
&lt;br /&gt;
* [[World Scenery 3.0 roadmap]]&lt;br /&gt;
* [[World Scenery 3.0 rendering]]&lt;br /&gt;
* [[World Scenery 3.0 coastlines]]&lt;br /&gt;
* [[WS3.0 Performance Testing]]&lt;br /&gt;
* [[Howto:Create WS3.0 terrain]]&lt;br /&gt;
* [[Virtual Planet Builder]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Currently Available Scenery ==&lt;br /&gt;
&lt;br /&gt;
=== Terrain ===&lt;br /&gt;
Scenery is currently not distributed using the official Terrasync, Nia provides a terrasync compatible download, point your terrasync client to https://cdn.merspieler.tk/ws3/ to make use of it. As of writing (2024-01-15) it contains all of the sceneries below (duplicates removed) and will get updated when a new Airports package is made and when Wayne provides her with new US scenery. If you don't wanna deal with changing your terrasync settings, you can always download sections of scenery via the links individually and added to your [[FG SCENERY|scenery path]].  If you set these in your scenery path ahead of any other scenery, it will pick up osm2city, scenery objects etc. from the underlying scenery as well.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Currently Available World Scenery 3.0&lt;br /&gt;
!Scenery&lt;br /&gt;
!Area&lt;br /&gt;
!Size &lt;br /&gt;
!Bottom Left&lt;br /&gt;
!Top Right&lt;br /&gt;
!Area (degrees^2)&lt;br /&gt;
!Landclass Source&lt;br /&gt;
!Landclass Resolution (m)&lt;br /&gt;
!Comments&lt;br /&gt;
!Osm2city Scenery&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1tGXSI8RwQxFL0_AFhXaFRVA6go-u7YBW/view?usp=share_link WS30_UK]&lt;br /&gt;
|Most of the UK&lt;br /&gt;
|1GB&lt;br /&gt;
| -11,49&lt;br /&gt;
|1,61&lt;br /&gt;
|121&lt;br /&gt;
|CORINE&lt;br /&gt;
|30&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/120QOxfTWEm6EBmjK0eCNb07hrm3clavi/view?usp=sharing NL]&lt;br /&gt;
|Amsterdam and Lelystad&lt;br /&gt;
|716MB (ca. 8GB uncompressed)&lt;br /&gt;
|2,50&lt;br /&gt;
|10,53&lt;br /&gt;
|24&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG; Includes high resolution water raster from OpenStreetMap.  Check out the canals!&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1MrYuDKbMl4WhCEq9gnnt8Tz61lTAScvD/view?usp=share_link WS_Alps]&lt;br /&gt;
|&lt;br /&gt;
|49MB&lt;br /&gt;
|6,45&lt;br /&gt;
|8,47&lt;br /&gt;
|4&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1V4AgqRcVo_7oFly8xCOZMPK7Gvb_X1HB/view?usp=share_link WS30_CA]&lt;br /&gt;
|Northern California&lt;br /&gt;
|350MB&lt;br /&gt;
| -124,34&lt;br /&gt;
| -119,39&lt;br /&gt;
|25&lt;br /&gt;
|NLCD&lt;br /&gt;
|30&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1j91qImcU28jrt290O5sUHbRZe7-fQJf-/view?usp=share_link WS30_CA2]&lt;br /&gt;
|Northern California, PNG&lt;br /&gt;
|454MB&lt;br /&gt;
| -124,34&lt;br /&gt;
| -119,40&lt;br /&gt;
|30&lt;br /&gt;
|NLCD&lt;br /&gt;
|30&lt;br /&gt;
|PNG; for most pilots this is the only scenery that works without troubles.&lt;br /&gt;
|[https://drive.google.com/file/d/1jrs7x4LOsdhn7IrISQIrHayu0yMQHaE1/view?usp=share_link osm2city buildings, trees, maritime, pylons etc.] (ca. 230 MB) - San Francisco Bay and San Pablo Bay&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1x-kuCTfyMWddTi0fbr_nl41LR41Ylvwb/view?usp=share_link WS30_MTQ]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG; Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|[https://drive.google.com/file/d/1QtojSTbnAAfkMzirQHnDJWbBDGOtnwIK/view?usp=sharing osm2city buildings, trees, maritime, pylons etc.] (ca. 40 MB).&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/14kbbgXbofDmqxho-bMCfOG4jDwcDqwBd/view?usp=share_link WS30_MTQ_25m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|PNG; Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1-LS3yQZ0OkWX38Ne89n69wtrT7SreV69/view?usp=sharing WS_MTQ_5m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|8MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG; Includes high resolution water raster from OpenStreetMap. Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1Um7WC8h8Y4BlwgoVSd2xoVO5gTd3E-bI/view?usp=sharing Switzerland_5m]&lt;br /&gt;
|Switzerland plus small border&lt;br /&gt;
|1.4 GB (ca. 7 GB unzipped)&lt;br /&gt;
| 5.75,45.75&lt;br /&gt;
| 10.75,48&lt;br /&gt;
|10&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG; By mistake taken default airports. If you are using merspieler's updated airports, then it will most often work fine, but there might be residuals (e.g. tree on APRON).&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://cdn.merspieler.tk/hosting/wayne/ WS3.0 USA]&lt;br /&gt;
|USA&lt;br /&gt;
|200 to 400 KB (zipped)&lt;br /&gt;
| 125,48&lt;br /&gt;
| 81,24&lt;br /&gt;
|&lt;br /&gt;
|NLCD, Tree Canopy Data&lt;br /&gt;
|30&lt;br /&gt;
|by state&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/SP-NTX/PolandWS30/ Poland]&lt;br /&gt;
|Poland&lt;br /&gt;
|1.2GiB&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Airports ===&lt;br /&gt;
In addition to the selected areas above, global up-to-date WS3.0 airports have been built. You can find them [https://cdn.merspieler.tk/airports/ here]&lt;br /&gt;
&lt;br /&gt;
=== Scenery Files Placement ===&lt;br /&gt;
Uncompress the downloaded scenery files into a folder of your choice, such as E:\MySceneryFolder. To be recognized by FlightGear, the selected scenery (from the table above) must be located in a folder with a &amp;quot;vpb&amp;quot; subfolder, such as (EX: C:\mysceneryfolder\hawaii\vpb). The scenery files above are compressed and include the &amp;quot;vpb&amp;quot; folder.&lt;br /&gt;
&lt;br /&gt;
=== Installing ===&lt;br /&gt;
Using the FlightGear [[FlightGear_Qt_launcher]] both the terrain and the airport are &amp;quot;installed&amp;quot; by going to tab &amp;quot;Add-ons&amp;quot; and then add the respective folders to &amp;quot;Additional scenery folders&amp;quot;. When adding an additional scenery folder, you need to point to the folder immediately above the &amp;quot;vpb&amp;quot; subfolder. &lt;br /&gt;
&lt;br /&gt;
If you add the airports the first time you might have to close the launcher and reopen it again to get the navigation data loaded properly into the session.&lt;br /&gt;
&lt;br /&gt;
== Running World Scenery 3.0 ==&lt;br /&gt;
To run WS3.0 you need to set the &amp;lt;code&amp;gt;/scenery/use-vpb&amp;lt;/code&amp;gt; property to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; at startup.  Either set &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; on your command-line, or in the Additional Settings part of the Settings pane of the launcher.&lt;br /&gt;
&lt;br /&gt;
WS3.0 can use a lot of memory - significantly more than WS2.0.  You can control the memory usage with the following properties:&lt;br /&gt;
&lt;br /&gt;
* /sim/rendering/max-paged-lod controls the minimum number of objects that will be kept in memory.  The default setting is 200.&lt;br /&gt;
* /sim/rendering/plod-minimum-expiry-time-secs controls how long objects remain loaded for after they are no-longer in view.  The default value is 180 (3 minutes).&lt;br /&gt;
&lt;br /&gt;
Reducing these properties will reduce the memory footprint of WS3.0.&lt;br /&gt;
&lt;br /&gt;
If you have lots of spare cores, you can run multiple threads to load scenery by setting &amp;lt;code&amp;gt;/sim/rendering/database-pager/threads&amp;lt;/code&amp;gt; to a number greater than 4 on startup.  E.g. &amp;lt;code&amp;gt;--prop:/sim/rendering/database-pager/threads=8&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== WS 2.0 scenery might still be needed ===&lt;br /&gt;
To have airports displayed plus some of the default scenery objects, you might still want to have the WS 2.0 scenery for the same area installed.&lt;br /&gt;
&lt;br /&gt;
However, if you want updated airports, checkout the global WS3.0 airports above. To avoid collisions you need to not have any WS2.0 airports enabled if you use these.&lt;br /&gt;
&lt;br /&gt;
=== Using osm2city ===&lt;br /&gt;
WS3.0 has built-in support for OpenStreetMap roads, so you should not have it enabled in rendering settings.&lt;br /&gt;
&lt;br /&gt;
You have 2 options:&lt;br /&gt;
&lt;br /&gt;
* If you have WS2.0 world scenery, then it already contains osm2city buildings etc. You can just use these and live with slight elevation offsets.&lt;br /&gt;
* The other option is to use the provided osm2city scenery in the table above instead. If doing so you need to makes sure that WS2.0 osm2city has not been downloaded (or delete the folders manually). E.g. if you are using [[TerraMaster]] then you can remove the ticks in Settings for &amp;quot;Buildings&amp;quot;, &amp;quot;Pylons&amp;quot; and &amp;quot;Roads&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Using the explicitly provided osm2city scenery gives you trees in gardens/parks and some improvements only available on NEXT.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139173</id>
		<title>World Scenery 3.0</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139173"/>
		<updated>2024-02-25T14:27:18Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 is a project to replace the tiled single-mesh World Scenery 2.0 with an LoD-based approach using a regular elevation mesh, landclass texture and vector line features.&lt;br /&gt;
&lt;br /&gt;
This leverages OSG's Virtual Planet Builder and OpenStreetmap APIs. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--&lt;br /&gt;
For further information:&lt;br /&gt;
&lt;br /&gt;
* [[World Scenery 3.0 roadmap]]&lt;br /&gt;
* [[World Scenery 3.0 rendering]]&lt;br /&gt;
* [[World Scenery 3.0 coastlines]]&lt;br /&gt;
* [[WS3.0 Performance Testing]]&lt;br /&gt;
* [[Howto:Create WS3.0 terrain]]&lt;br /&gt;
* [[Virtual Planet Builder]]&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
== Currently Available Scenery ==&lt;br /&gt;
&lt;br /&gt;
=== Terrain ===&lt;br /&gt;
Scenery is currently not distributed using the official Terrasync, Nia provides a terrasync compatible download, point your terrasync client to https://cdn.merspieler.tk/ws3/ to make use of it. As of writing (2024-01-15) it contains all of the sceneries below (duplicates removed) and will get updated when a new Airports package is made and when Wayne provides her with new US scenery. If you don't wanna deal with changing your terrasync settings, you can always download sections of scenery via the links individually and added to your [[FG SCENERY|scenery path]].  If you set these in your scenery path ahead of any other scenery, it will pick up osm2city, scenery objects etc. from the underlying scenery as well.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
Currently Available World Scenery 3.0&lt;br /&gt;
!Scenery&lt;br /&gt;
!Area&lt;br /&gt;
!Size &lt;br /&gt;
!Bottom Left&lt;br /&gt;
!Top Right&lt;br /&gt;
!Area (degrees^2)&lt;br /&gt;
!Landclass Source&lt;br /&gt;
!Landclass Resolution (m)&lt;br /&gt;
!Comments&lt;br /&gt;
!Osm2city Scenery&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1tGXSI8RwQxFL0_AFhXaFRVA6go-u7YBW/view?usp=share_link WS30_UK]&lt;br /&gt;
|Most of the UK&lt;br /&gt;
|1GB&lt;br /&gt;
| -11,49&lt;br /&gt;
|1,61&lt;br /&gt;
|121&lt;br /&gt;
|CORINE&lt;br /&gt;
|30&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/120QOxfTWEm6EBmjK0eCNb07hrm3clavi/view?usp=sharing NL]&lt;br /&gt;
|Amsterdam and Lelystad&lt;br /&gt;
|716MB (ca. 8GB uncompressed)&lt;br /&gt;
|2,50&lt;br /&gt;
|10,53&lt;br /&gt;
|24&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG; Includes high resolution water raster from OpenStreetMap.  Check out the canals!&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1MrYuDKbMl4WhCEq9gnnt8Tz61lTAScvD/view?usp=share_link WS_Alps]&lt;br /&gt;
|&lt;br /&gt;
|49MB&lt;br /&gt;
|6,45&lt;br /&gt;
|8,47&lt;br /&gt;
|4&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1V4AgqRcVo_7oFly8xCOZMPK7Gvb_X1HB/view?usp=share_link WS30_CA]&lt;br /&gt;
|Northern California&lt;br /&gt;
|350MB&lt;br /&gt;
| -124,34&lt;br /&gt;
| -119,39&lt;br /&gt;
|25&lt;br /&gt;
|NLCD&lt;br /&gt;
|30&lt;br /&gt;
|DDS&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1j91qImcU28jrt290O5sUHbRZe7-fQJf-/view?usp=share_link WS30_CA2]&lt;br /&gt;
|Northern California, PNG&lt;br /&gt;
|454MB&lt;br /&gt;
| -124,34&lt;br /&gt;
| -119,40&lt;br /&gt;
|30&lt;br /&gt;
|NLCD&lt;br /&gt;
|30&lt;br /&gt;
|PNG; for most pilots this is the only scenery that works without troubles.&lt;br /&gt;
|[https://drive.google.com/file/d/1jrs7x4LOsdhn7IrISQIrHayu0yMQHaE1/view?usp=share_link osm2city buildings, trees, maritime, pylons etc.] (ca. 230 MB) - San Francisco Bay and San Pablo Bay&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1x-kuCTfyMWddTi0fbr_nl41LR41Ylvwb/view?usp=share_link WS30_MTQ]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|10&lt;br /&gt;
|PNG; Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|[https://drive.google.com/file/d/1QtojSTbnAAfkMzirQHnDJWbBDGOtnwIK/view?usp=sharing osm2city buildings, trees, maritime, pylons etc.] (ca. 40 MB).&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/14kbbgXbofDmqxho-bMCfOG4jDwcDqwBd/view?usp=share_link WS30_MTQ_25m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|25&lt;br /&gt;
|PNG; Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1NwBjtISPAoTS0vqbV8idvu64CzKJNDQ-/view?usp=share_link WS_MTQ_5m]&lt;br /&gt;
|Martinique&lt;br /&gt;
|7MB&lt;br /&gt;
| -62,14&lt;br /&gt;
| -60,15&lt;br /&gt;
|2&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG; Small French Caribbean island.  One airport (TFFF)&lt;br /&gt;
|(see above)&lt;br /&gt;
|-&lt;br /&gt;
|[https://drive.google.com/file/d/1Um7WC8h8Y4BlwgoVSd2xoVO5gTd3E-bI/view?usp=sharing Switzerland_5m]&lt;br /&gt;
|Switzerland plus small border&lt;br /&gt;
|1.4 GB (ca. 7 GB unzipped)&lt;br /&gt;
| 5.75,45.75&lt;br /&gt;
| 10.75,48&lt;br /&gt;
|10&lt;br /&gt;
|CORINE&lt;br /&gt;
|5&lt;br /&gt;
|PNG; By mistake taken default airports. If you are using merspieler's updated airports, then it will most often work fine, but there might be residuals (e.g. tree on APRON).&lt;br /&gt;
|included&lt;br /&gt;
|-&lt;br /&gt;
|[https://cdn.merspieler.tk/hosting/wayne/ WS3.0 USA]&lt;br /&gt;
|USA&lt;br /&gt;
|200 to 400 KB (zipped)&lt;br /&gt;
| 125,48&lt;br /&gt;
| 81,24&lt;br /&gt;
|&lt;br /&gt;
|NLCD, Tree Canopy Data&lt;br /&gt;
|30&lt;br /&gt;
|by state&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|[https://github.com/SP-NTX/PolandWS30/ Poland]&lt;br /&gt;
|Poland&lt;br /&gt;
|1.2GiB&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Airports ===&lt;br /&gt;
In addition to the selected areas above, global up-to-date WS3.0 airports have been built. You can find them [https://cdn.merspieler.tk/airports/ here]&lt;br /&gt;
&lt;br /&gt;
=== Scenery Files Placement ===&lt;br /&gt;
Uncompress the downloaded scenery files into a folder of your choice, such as E:\MySceneryFolder. To be recognized by FlightGear, the selected scenery (from the table above) must be located in a folder with a &amp;quot;vpb&amp;quot; subfolder, such as (EX: C:\mysceneryfolder\hawaii\vpb). The scenery files above are compressed and include the &amp;quot;vpb&amp;quot; folder.&lt;br /&gt;
&lt;br /&gt;
=== Installing ===&lt;br /&gt;
Using the FlightGear [[FlightGear_Qt_launcher]] both the terrain and the airport are &amp;quot;installed&amp;quot; by going to tab &amp;quot;Add-ons&amp;quot; and then add the respective folders to &amp;quot;Additional scenery folders&amp;quot;. When adding an additional scenery folder, you need to point to the folder immediately above the &amp;quot;vpb&amp;quot; subfolder. &lt;br /&gt;
&lt;br /&gt;
If you add the airports the first time you might have to close the launcher and reopen it again to get the navigation data loaded properly into the session.&lt;br /&gt;
&lt;br /&gt;
== Running World Scenery 3.0 ==&lt;br /&gt;
To run WS3.0 you need to set the &amp;lt;code&amp;gt;/scenery/use-vpb&amp;lt;/code&amp;gt; property to &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; at startup.  Either set &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; on your command-line, or in the Additional Settings part of the Settings pane of the launcher.&lt;br /&gt;
&lt;br /&gt;
WS3.0 can use a lot of memory - significantly more than WS2.0.  You can control the memory usage with the following properties:&lt;br /&gt;
&lt;br /&gt;
* /sim/rendering/max-paged-lod controls the minimum number of objects that will be kept in memory.  The default setting is 200.&lt;br /&gt;
* /sim/rendering/plod-minimum-expiry-time-secs controls how long objects remain loaded for after they are no-longer in view.  The default value is 180 (3 minutes).&lt;br /&gt;
&lt;br /&gt;
Reducing these properties will reduce the memory footprint of WS3.0.&lt;br /&gt;
&lt;br /&gt;
If you have lots of spare cores, you can run multiple threads to load scenery by setting &amp;lt;code&amp;gt;/sim/rendering/database-pager/threads&amp;lt;/code&amp;gt; to a number greater than 4 on startup.  E.g. &amp;lt;code&amp;gt;--prop:/sim/rendering/database-pager/threads=8&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== WS 2.0 scenery might still be needed ===&lt;br /&gt;
To have airports displayed plus some of the default scenery objects, you might still want to have the WS 2.0 scenery for the same area installed.&lt;br /&gt;
&lt;br /&gt;
However, if you want updated airports, checkout the global WS3.0 airports above. To avoid collisions you need to not have any WS2.0 airports enabled if you use these.&lt;br /&gt;
&lt;br /&gt;
=== Using osm2city ===&lt;br /&gt;
WS3.0 has built-in support for OpenStreetMap roads, so you should not have it enabled in rendering settings.&lt;br /&gt;
&lt;br /&gt;
You have 2 options:&lt;br /&gt;
&lt;br /&gt;
* If you have WS2.0 world scenery, then it already contains osm2city buildings etc. You can just use these and live with slight elevation offsets.&lt;br /&gt;
* The other option is to use the provided osm2city scenery in the table above instead. If doing so you need to makes sure that WS2.0 osm2city has not been downloaded (or delete the folders manually). E.g. if you are using [[TerraMaster]] then you can remove the ticks in Settings for &amp;quot;Buildings&amp;quot;, &amp;quot;Pylons&amp;quot; and &amp;quot;Roads&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
Using the explicitly provided osm2city scenery gives you trees in gardens/parks and some improvements only available on NEXT.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139108</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139108"/>
		<updated>2024-02-10T11:29:12Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Creating a Raster from a Vector Layer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate basic WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of two parts:&lt;br /&gt;
&lt;br /&gt;
# A terrain mesh consisting of a landclass texture draped over an elevation model.  &lt;br /&gt;
# Line features such as roads, railways, rivers and coastline.  &lt;br /&gt;
The terrain is generated by a set of tools that are packaged in a docker image for convenience.[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Set up a Workspace ===&lt;br /&gt;
Create a directory with the following sub-directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/vpb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/Terrain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Docker ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#Pull the docker image by running the following command&lt;br /&gt;
&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run &amp;lt;code&amp;gt;docker login&amp;lt;/code&amp;gt; before the '''docker pull''' command above&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
You need two pieces of data for the area of scenery you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  This indicates what altitude each point of the surface is.&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster (effectively a texture), or vector data.  &lt;br /&gt;
&lt;br /&gt;
=== Elevation Model ===&lt;br /&gt;
Download the NASADEM elevation model for the area of scenery you wish to generate.  This is available in 1x1 degree blocks from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].  &lt;br /&gt;
&lt;br /&gt;
Unzip the files into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== Landclass Raster ===&lt;br /&gt;
Download an landclass raster for the area of scenery you wish to generate.&lt;br /&gt;
&lt;br /&gt;
* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
* For the USA [https://www.mrlc.gov/viewer/ NLCD] is recommended&lt;br /&gt;
* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
&lt;br /&gt;
Put these into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
More detailed terrain can be created by modifying the landclass raster, and/or generating a new raster from vector data.  These processes are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Generating Terrain ==&lt;br /&gt;
To generate terrain you need to run the tools within the docker container we installed above.  The docker image is like a small, independent virtual computing environment running within your system.  This particular docker image has all the scenery generation tools already installed.&lt;br /&gt;
&lt;br /&gt;
=== Running the docker container ===&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 data  output&lt;br /&gt;
&lt;br /&gt;
=== Building the terrain ===&lt;br /&gt;
To build the terrain mesh, use the &amp;lt;code&amp;gt;genVPB.py&amp;lt;/code&amp;gt; tool from inside the docker container.&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
For example, to generate a piece of terrain around Edinburgh (latitude 55.5, longitude 3 degrees West)&lt;br /&gt;
 ./scripts/genVPB.py -3 55 -2 56 ./data/uk_wgs84_10m_N54.tif &lt;br /&gt;
If you are using anything other than a CORINE raster you will need to reclassify the data to match the landclasses used by FlightGear.  Those classes are defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].  You can reclassify them using the files in the [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/ scripts/mappings] directory. E.g. to reclassify NLCD2019 data you can use &amp;lt;code&amp;gt;--reclassify ./scripts/mappings/nlcd2019.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
genVPB.py will output the data to the output/vpb directory, in which you should find a series of files and directories.&lt;br /&gt;
&lt;br /&gt;
=== Adding roads, railways and rivers ===&lt;br /&gt;
The terrain mesh does not have any line features - things like roads.  These are generated separately by the genRoads.py command by downloading data from OpenStreetMap.  To generate line features simply run the genroads.py command:&lt;br /&gt;
 Usage: ./scripts/genroads.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate roads for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and, .STG files text files.&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the output directory in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
The following sections describe more complex techniques to generate higher quality WS3.0 terrain.  Almost all of them involve using different data sources to generate a more detailed landclass raster before running the final scenery generation processes described above.  Generating a highly detailed landclass raster is where the magic happens.  &lt;br /&gt;
&lt;br /&gt;
Most techniques use gdal or grass to modify the raster/vector data, typically using the QGIS program.&lt;br /&gt;
&lt;br /&gt;
=== Using a different elevation model ===&lt;br /&gt;
If you are using another elevation model other than NASAEM, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).  &lt;br /&gt;
&lt;br /&gt;
=== Landclass Data Requirements ===&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  We use a set of values based on the CORINE raster set, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS84 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.&lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.  &lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;Toggle Editing Mode&amp;lt;/code&amp;gt; (Ctrl + E), on the top left of the dialog&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box (without the comment lines starting with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;).  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.  Best practise is to create long thin strips of 1 degree latitude in height, as this makes subsequent processing much easier.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  genVPB.py has an option to do this, but you may wish to do so manually.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
Use the prevailing tree type, for Deciduous use * 41, for Evergreen use  * 42, for MixedForest use 43.&lt;br /&gt;
&lt;br /&gt;
Later we add this Tree Canopy layer to the raster where there is currently no trees in the NLCD&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - &lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step adds the Tree Canopy layer to the existing NLCD raster only where there is currently no existing tree land cover.&lt;br /&gt;
&lt;br /&gt;
((&amp;quot;California-Southern_4326-84@1&amp;quot; &amp;gt; 0 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 41 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 42 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 43) AND &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;gt; 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; + (&amp;quot;California-Southern_4326-84@1&amp;quot; = 41 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 42 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 43 OR &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt;= 0) * &amp;quot;California-Southern_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 2x, 4x or 8x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
2x Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
2x Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
4x Horizontal = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
4x Vertical = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
8x Horizontal = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
8x Vertical = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
===Generating the Terrain using osgdem===&lt;br /&gt;
Instead of using genVPB.py, you may wish to run osgdem directly.&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Packaging the Scenery===&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139107</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139107"/>
		<updated>2024-02-10T10:42:10Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Reclassifying Vector Layers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate basic WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of two parts:&lt;br /&gt;
&lt;br /&gt;
# A terrain mesh consisting of a landclass texture draped over an elevation model.  &lt;br /&gt;
# Line features such as roads, railways, rivers and coastline.  &lt;br /&gt;
The terrain is generated by a set of tools that are packaged in a docker image for convenience.[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Set up a Workspace ===&lt;br /&gt;
Create a directory with the following sub-directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/vpb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/Terrain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Docker ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#Pull the docker image by running the following command&lt;br /&gt;
&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run &amp;lt;code&amp;gt;docker login&amp;lt;/code&amp;gt; before the '''docker pull''' command above&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
You need two pieces of data for the area of scenery you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  This indicates what altitude each point of the surface is.&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster (effectively a texture), or vector data.  &lt;br /&gt;
&lt;br /&gt;
=== Elevation Model ===&lt;br /&gt;
Download the NASADEM elevation model for the area of scenery you wish to generate.  This is available in 1x1 degree blocks from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].  &lt;br /&gt;
&lt;br /&gt;
Unzip the files into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== Landclass Raster ===&lt;br /&gt;
Download an landclass raster for the area of scenery you wish to generate.&lt;br /&gt;
&lt;br /&gt;
* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
* For the USA [https://www.mrlc.gov/viewer/ NLCD] is recommended&lt;br /&gt;
* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
&lt;br /&gt;
Put these into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
More detailed terrain can be created by modifying the landclass raster, and/or generating a new raster from vector data.  These processes are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Generating Terrain ==&lt;br /&gt;
To generate terrain you need to run the tools within the docker container we installed above.  The docker image is like a small, independent virtual computing environment running within your system.  This particular docker image has all the scenery generation tools already installed.&lt;br /&gt;
&lt;br /&gt;
=== Running the docker container ===&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 data  output&lt;br /&gt;
&lt;br /&gt;
=== Building the terrain ===&lt;br /&gt;
To build the terrain mesh, use the &amp;lt;code&amp;gt;genVPB.py&amp;lt;/code&amp;gt; tool from inside the docker container.&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
For example, to generate a piece of terrain around Edinburgh (latitude 55.5, longitude 3 degrees West)&lt;br /&gt;
 ./scripts/genVPB.py -3 55 -2 56 ./data/uk_wgs84_10m_N54.tif &lt;br /&gt;
If you are using anything other than a CORINE raster you will need to reclassify the data to match the landclasses used by FlightGear.  Those classes are defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].  You can reclassify them using the files in the [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/ scripts/mappings] directory. E.g. to reclassify NLCD2019 data you can use &amp;lt;code&amp;gt;--reclassify ./scripts/mappings/nlcd2019.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
genVPB.py will output the data to the output/vpb directory, in which you should find a series of files and directories.&lt;br /&gt;
&lt;br /&gt;
=== Adding roads, railways and rivers ===&lt;br /&gt;
The terrain mesh does not have any line features - things like roads.  These are generated separately by the genRoads.py command by downloading data from OpenStreetMap.  To generate line features simply run the genroads.py command:&lt;br /&gt;
 Usage: ./scripts/genroads.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate roads for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and, .STG files text files.&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the output directory in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
The following sections describe more complex techniques to generate higher quality WS3.0 terrain.  Almost all of them involve using different data sources to generate a more detailed landclass raster before running the final scenery generation processes described above.  Generating a highly detailed landclass raster is where the magic happens.  &lt;br /&gt;
&lt;br /&gt;
Most techniques use gdal or grass to modify the raster/vector data, typically using the QGIS program.&lt;br /&gt;
&lt;br /&gt;
=== Using a different elevation model ===&lt;br /&gt;
If you are using another elevation model other than NASAEM, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).  &lt;br /&gt;
&lt;br /&gt;
=== Landclass Data Requirements ===&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  We use a set of values based on the CORINE raster set, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS84 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.&lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.  &lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;Toggle Editing Mode&amp;lt;/code&amp;gt; (Ctrl + E), on the top left of the dialog&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box (without the comment lines starting with &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt;).  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  genVPB.py has an option to do this, but you may wish to do so manually.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
Use the prevailing tree type, for Deciduous use * 41, for Evergreen use  * 42, for MixedForest use 43.&lt;br /&gt;
&lt;br /&gt;
Later we add this Tree Canopy layer to the raster where there is currently no trees in the NLCD&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - &lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step adds the Tree Canopy layer to the existing NLCD raster only where there is currently no existing tree land cover.&lt;br /&gt;
&lt;br /&gt;
((&amp;quot;California-Southern_4326-84@1&amp;quot; &amp;gt; 0 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 41 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 42 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 43) AND &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;gt; 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; + (&amp;quot;California-Southern_4326-84@1&amp;quot; = 41 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 42 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 43 OR &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt;= 0) * &amp;quot;California-Southern_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 2x, 4x or 8x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
2x Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
2x Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
4x Horizontal = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
4x Vertical = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
8x Horizontal = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
8x Vertical = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
===Generating the Terrain using osgdem===&lt;br /&gt;
Instead of using genVPB.py, you may wish to run osgdem directly.&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Packaging the Scenery===&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139106</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139106"/>
		<updated>2024-02-10T10:39:21Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Reclassifying Vector Layers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate basic WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of two parts:&lt;br /&gt;
&lt;br /&gt;
# A terrain mesh consisting of a landclass texture draped over an elevation model.  &lt;br /&gt;
# Line features such as roads, railways, rivers and coastline.  &lt;br /&gt;
The terrain is generated by a set of tools that are packaged in a docker image for convenience.[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Set up a Workspace ===&lt;br /&gt;
Create a directory with the following sub-directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/vpb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/Terrain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Docker ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#Pull the docker image by running the following command&lt;br /&gt;
&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run &amp;lt;code&amp;gt;docker login&amp;lt;/code&amp;gt; before the '''docker pull''' command above&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
You need two pieces of data for the area of scenery you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  This indicates what altitude each point of the surface is.&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster (effectively a texture), or vector data.  &lt;br /&gt;
&lt;br /&gt;
=== Elevation Model ===&lt;br /&gt;
Download the NASADEM elevation model for the area of scenery you wish to generate.  This is available in 1x1 degree blocks from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].  &lt;br /&gt;
&lt;br /&gt;
Unzip the files into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== Landclass Raster ===&lt;br /&gt;
Download an landclass raster for the area of scenery you wish to generate.&lt;br /&gt;
&lt;br /&gt;
* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
* For the USA [https://www.mrlc.gov/viewer/ NLCD] is recommended&lt;br /&gt;
* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
&lt;br /&gt;
Put these into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
More detailed terrain can be created by modifying the landclass raster, and/or generating a new raster from vector data.  These processes are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Generating Terrain ==&lt;br /&gt;
To generate terrain you need to run the tools within the docker container we installed above.  The docker image is like a small, independent virtual computing environment running within your system.  This particular docker image has all the scenery generation tools already installed.&lt;br /&gt;
&lt;br /&gt;
=== Running the docker container ===&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 data  output&lt;br /&gt;
&lt;br /&gt;
=== Building the terrain ===&lt;br /&gt;
To build the terrain mesh, use the &amp;lt;code&amp;gt;genVPB.py&amp;lt;/code&amp;gt; tool from inside the docker container.&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
For example, to generate a piece of terrain around Edinburgh (latitude 55.5, longitude 3 degrees West)&lt;br /&gt;
 ./scripts/genVPB.py -3 55 -2 56 ./data/uk_wgs84_10m_N54.tif &lt;br /&gt;
If you are using anything other than a CORINE raster you will need to reclassify the data to match the landclasses used by FlightGear.  Those classes are defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].  You can reclassify them using the files in the [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/ scripts/mappings] directory. E.g. to reclassify NLCD2019 data you can use &amp;lt;code&amp;gt;--reclassify ./scripts/mappings/nlcd2019.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
genVPB.py will output the data to the output/vpb directory, in which you should find a series of files and directories.&lt;br /&gt;
&lt;br /&gt;
=== Adding roads, railways and rivers ===&lt;br /&gt;
The terrain mesh does not have any line features - things like roads.  These are generated separately by the genRoads.py command by downloading data from OpenStreetMap.  To generate line features simply run the genroads.py command:&lt;br /&gt;
 Usage: ./scripts/genroads.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate roads for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and, .STG files text files.&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the output directory in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
The following sections describe more complex techniques to generate higher quality WS3.0 terrain.  Almost all of them involve using different data sources to generate a more detailed landclass raster before running the final scenery generation processes described above.  Generating a highly detailed landclass raster is where the magic happens.  &lt;br /&gt;
&lt;br /&gt;
Most techniques use gdal or grass to modify the raster/vector data, typically using the QGIS program.&lt;br /&gt;
&lt;br /&gt;
=== Using a different elevation model ===&lt;br /&gt;
If you are using another elevation model other than NASAEM, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).  &lt;br /&gt;
&lt;br /&gt;
=== Landclass Data Requirements ===&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  We use a set of values based on the CORINE raster set, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS84 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.&lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.  &lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;Toggle Editing Mode&amp;lt;/code&amp;gt; (Ctrl + E), on the top left of the dialog&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box.  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  genVPB.py has an option to do this, but you may wish to do so manually.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
Use the prevailing tree type, for Deciduous use * 41, for Evergreen use  * 42, for MixedForest use 43.&lt;br /&gt;
&lt;br /&gt;
Later we add this Tree Canopy layer to the raster where there is currently no trees in the NLCD&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - &lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step adds the Tree Canopy layer to the existing NLCD raster only where there is currently no existing tree land cover.&lt;br /&gt;
&lt;br /&gt;
((&amp;quot;California-Southern_4326-84@1&amp;quot; &amp;gt; 0 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 41 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 42 AND &amp;quot;California-Southern_4326-84@1&amp;quot; != 43) AND &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;gt; 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; + (&amp;quot;California-Southern_4326-84@1&amp;quot; = 41 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 42 OR &amp;quot;California-Southern_4326-84@1&amp;quot; = 43 OR &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt;= 0) * &amp;quot;California-Southern_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 2x, 4x or 8x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
2x Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
2x Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
4x Horizontal = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
4x Vertical = 0.00010637625&lt;br /&gt;
&lt;br /&gt;
8x Horizontal = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
8x Vertical = 0.00005318812&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
===Generating the Terrain using osgdem===&lt;br /&gt;
Instead of using genVPB.py, you may wish to run osgdem directly.&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Packaging the Scenery===&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139066</id>
		<title>Scenery status meet Feb 2024</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139066"/>
		<updated>2024-02-04T16:31:29Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Notes and Links on Projects */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Notes for a casual meeting for Scenery interested people held online on Feb 4th 2024. The contents just reflects status of different initiatives without specific commitments.&lt;br /&gt;
&lt;br /&gt;
== Agenda ==&lt;br /&gt;
* Introduction to each other (who, areas of interest in FG, ...).&lt;br /&gt;
* Present purpose and/or status and/or future direction and/or dependencies on different projects (ca. 10 min per project - not mandatory)&lt;br /&gt;
* Discussion of common topics.&lt;br /&gt;
* Possible influence on NEXT.&lt;br /&gt;
&lt;br /&gt;
== Notes and Links on Projects ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Project/Initiative !! Links !! Owner(s) !! Status / Notes&lt;br /&gt;
|-&lt;br /&gt;
| osm2city || [[Osm2city.py|Osm2city on wiki]], [https://gitlab.com/osm2city repos on GitLab] || [https://forum.flightgear.org/memberlist.php?mode=viewprofile&amp;amp;u=9140 vanosten], HB-VANO on FG Discord || &lt;br /&gt;
* Support for WS 3.0 / NEXT = up-to-date&lt;br /&gt;
* Migration of land-use from Python to C++ = plausible generation of lacking buildings ongoing, rest done&lt;br /&gt;
* Docker image = available&lt;br /&gt;
* FGElev API and memory reduction = not started&lt;br /&gt;
* Integration of instanced scenery object = waiting&lt;br /&gt;
* Better textures for buildings = only conceptual level started&lt;br /&gt;
* Roads/railway bridges, embankments etc. = waiting for WS3.0 settle&lt;br /&gt;
|-&lt;br /&gt;
|Random Buildings update&lt;br /&gt;
|https://sourceforge.net/p/flightgear/fgdata/ci/random_buildings/tree/&lt;br /&gt;
|Volador on FG forum, volador_uk on FG Discord&lt;br /&gt;
|Summary of progress:&lt;br /&gt;
&lt;br /&gt;
* TheFGFSEagle has a random buildings development fork with the current work&lt;br /&gt;
&lt;br /&gt;
* Fahim solved roof texture coordinates that were skewing textures. We can now have skylights and solar panels on pitched roofs as well as tiles/surfaces with improved detail (more work required to avoid clipping roof features).&lt;br /&gt;
* Eagle and Gabo solved lightmap, reflection and normal map problems but still some final tweaks required.&lt;br /&gt;
* A new 4k regional texture atlas available based on the layout of the current atlas for simplicity (now 4k agreed with Stuart and  Rick) for UK / maybe Northern Europe?, working on one for Southern Europe but need photo contributions.&lt;br /&gt;
&lt;br /&gt;
Next steps: &lt;br /&gt;
&lt;br /&gt;
* Enable normal maps (and maybe reflection maps) for roofs (to discuss effort vs return)&lt;br /&gt;
* Fahim to port texture coordinate solutions to the HDR shaders.&lt;br /&gt;
* Gather contributions from the community around the world to create regional textures (should be coordinated to avoid duplication) suggesting only a few key regions to start with.&lt;br /&gt;
* Assign new textures (once complete) to areas of the globe: Help required to implement this.&lt;br /&gt;
&lt;br /&gt;
Resources available for other contributors: &lt;br /&gt;
&lt;br /&gt;
* Blender project to automatically create roof planes of given tile shape collections with geometry nodes. Output can be texture and also a separate normal map. Basic Blender skills required.&lt;br /&gt;
* Photoshop .psd and gimp templates for rows of houses and shop/apartments ready to share with contributors who can take pics locally, tweak perspective, follow a grid and send them in for integration and slot into larger texture atlases.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| WS3.0 Water Features || [[World Scenery 3.0 coastlines]]|| Stuart ||Summary of Progress&lt;br /&gt;
&lt;br /&gt;
* Created a python script (genwaterraster.py) to create a high resolution (1m/px) water feature PNG raster including coastlines, lakes, rivers for L6 LoD tiles.  &lt;br /&gt;
* The PNG files are compressed and approx 4MB total per 1x1 degree tile.&lt;br /&gt;
* This is read at runtime by FG and for Medium/High/Ultra rendering settings overlays the terrain raster&lt;br /&gt;
&lt;br /&gt;
Next Steps&lt;br /&gt;
&lt;br /&gt;
* Add to docker image&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Discussion Topics ==&lt;br /&gt;
Proposed topics:&lt;br /&gt;
* Scenery build for 2024.1: &lt;br /&gt;
    * If based on WS2.0: use FGMS data to select areas with actual traffic to cut down on processing needs (e.g. for osm2city)? &lt;br /&gt;
    * Do we change the default airport?&lt;br /&gt;
    * Update airports list?&lt;br /&gt;
* Scenery build for NEXT/WS3.0: &lt;br /&gt;
    * Which area(s) to pick with a commitment to &amp;quot;often&amp;quot; rebuild / adapt to latest changes in code/features? (Should probably cover different types of base data like Corine vs. US stuff vs. ...)&lt;br /&gt;
    * Do we go for a new future default airport? Are there any new &amp;quot;features&amp;quot; (like previous carrier, volcanos) in NEXT?&lt;br /&gt;
    * Update airports list?&lt;br /&gt;
    * Also kept up to date for 2024.1? &lt;br /&gt;
&lt;br /&gt;
=== Topic X ===&lt;br /&gt;
* (Notes go here)&lt;br /&gt;
&lt;br /&gt;
=== Topic Y ===&lt;br /&gt;
* (Notes go here)&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery|Scenery]]&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0_coastlines&amp;diff=138924</id>
		<title>World Scenery 3.0 coastlines</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0_coastlines&amp;diff=138924"/>
		<updated>2024-01-03T01:37:53Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 uses a texture of landclass information, typically with 10-25m resolution.  For coastlines in particular, this creates an obvious sharp edge with right angles.&lt;br /&gt;
[[File:Fgfs-20220208201349.jpg|thumb|WS3.0 coastline just using a 10m raster with no vector data, showing the coastline problem]]&lt;br /&gt;
[[File:Fgfs-20230219173559.jpg|thumb|WS3.0 coastline using OSM vector data.  Note the artifacts where the data doesn't line up.]]&lt;br /&gt;
[[File:Fgfs-20230227220551.jpg|alt=|thumb|Current state-of-the-art coast rendering, using OSM data for both raster and coastline definition.  Martinique]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page describes various techniques/experiments to find a better solution.&lt;br /&gt;
&lt;br /&gt;
=== Current Rendering ===&lt;br /&gt;
The current &amp;quot;state of the art&amp;quot; is to is to create a second texture at much higher resolution and paint the coastline onto this.  The fragment shader then mixes the standard resolution landclass and the much higher resolution coastline texture.  This has the advantage of being able to mix the data together nicely.    &lt;br /&gt;
&lt;br /&gt;
We currently support both generating this higher resolution raster at scenery generation time and also at runtime.  Both the generation of the texture and the shader are currently quite basic and would benefit from further development from anyone interested in this area.&lt;br /&gt;
&lt;br /&gt;
The significant downside is the increased memory occupancy of the additional texture and the added complexity of the shader.&lt;br /&gt;
&lt;br /&gt;
This still leaves an issue that the elevation mesh is completely regular, so where steep slopes meet the sea, the high water mark can be a half way up a slope!  The shader creates cliffs and beaches instead of water depending on the steepness of the elevation mesh.  We also force any vertex that is in the sea to 0 elevation.&lt;br /&gt;
&lt;br /&gt;
=== OpenStreetMap or other vector coastline data ===&lt;br /&gt;
OpenStreetMap has line data for coastlines and water bodies.  This is vector data, so can be rendered at higher apparent resolution than the landclass data.  The gencoastline.py script in fgmeta/ws30 uses this to generate a series of lat/lon points that FlightGear can then use.&lt;br /&gt;
&lt;br /&gt;
There is a problem where the OSM coastline (defined as the mean high water mark) doesn't exactly match the landclass raster due to projection discrepancies or simply because of state of the tide at the time that a satellite image was taken.    &lt;br /&gt;
&lt;br /&gt;
Ideally the coastline of the raster will match the OSM coastline as closely as possible, and perhaps overlap slightly.  &lt;br /&gt;
&lt;br /&gt;
To do this:  &lt;br /&gt;
&lt;br /&gt;
# Reclassify the Ocean as NODATA (0.0)&lt;br /&gt;
#* r.reclass using https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/remove_sea.txt.  This reclassifies 44 (Sea) as NODATA&lt;br /&gt;
&lt;br /&gt;
# Use the GDAL Fill nodata to fill out the edges for radius 10.  You will now have a raster as if the sea level has dropped.  Use one of the following&lt;br /&gt;
#*&amp;lt;code&amp;gt;gdal_fillnodata.py -md 10 -b 1 -of GTiff &amp;lt;original_file&amp;gt; &amp;lt;new_file&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
#* r.fill.stats using the mode as the statistical method&lt;br /&gt;
# Get a shapefile of the coastline from OSM.  The simplest way is to download the WGS84 split polygons from here: https://osmdata.openstreetmap.de/data/land-polygons.html.  You may wish to pre-process these to clip to the rough extents of your scenery to reduce the size of the file.&lt;br /&gt;
&lt;br /&gt;
# Load the OSM shapefile and Use Clip raster by mask layer this will cut out the landmass much more accurately than before.&lt;br /&gt;
#* gdalwarp -overwrite -of GTiff -tr 0.00015600000000000002 -9.000000000000003e-05 -tap -cutline &amp;lt;vector.osm&amp;gt; -cl multipolygons &amp;lt;input&amp;gt; &amp;lt;output&amp;gt;&lt;br /&gt;
# Use the GDAL Fill nodata to fill out the edges for radius 1.  This ensures that there is &amp;quot;land&amp;quot; underneath the shoreline itself.&lt;br /&gt;
#* gdal_fillnodata.py -md 1 -b 1 -of GTiff &amp;lt;input&amp;gt; &amp;lt;output&amp;gt;&lt;br /&gt;
# Use the standard Fill NoData cells to fill the NoData with the correct Ocean landclass.&lt;br /&gt;
#* gdal_calc.py -A &amp;lt;input&amp;gt; --NoDataValue=44 --calc=&amp;quot;A&amp;quot; --outfile &amp;lt;output&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The genVPB.py script performs these steps.&lt;br /&gt;
&lt;br /&gt;
=== Experiments ===&lt;br /&gt;
&lt;br /&gt;
==== Direct model generation ====&lt;br /&gt;
Initial experiments using the same approach as roads (overlaying an additional tri-strip for the coastline) did not blend well with the underlying landclass mesh.&lt;br /&gt;
&lt;br /&gt;
'''Scenery-time generation of detailed coastline raster'''&lt;br /&gt;
&lt;br /&gt;
fgmeta/ws30/gencoastlineraster.py generates a raster file that can be loaded by FG at runtime.  This is quite effective and leverages python raster packages.  The downside is the additional disk space.&lt;br /&gt;
&lt;br /&gt;
=== Thought Experiments ===&lt;br /&gt;
&lt;br /&gt;
==== Nearest Neighbour Encoding ====&lt;br /&gt;
The landclass texture currently has unused channels.  It would be possible to use one of those channels to encode information about the neighbouring texels.  This could be used for mixing coastline fragments better.  For example, encoding whether the 8 surrounding texels are water or land could be done in 8 bits, conveniently 256 different values.  A separate texture could be conceived that defined a different shape of coastline for each of the 256 combinations, probably with some perturbations to avoid obvious repetition.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0_coastlines&amp;diff=138923</id>
		<title>World Scenery 3.0 coastlines</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0_coastlines&amp;diff=138923"/>
		<updated>2024-01-03T01:33:34Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* OpenStreetMap or other vector coastline data */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 uses a texture of landclass information, typically with 10-25m resolution.  For coastlines in particular, this creates an obvious sharp edge with right angles.&lt;br /&gt;
[[File:Fgfs-20220208201349.jpg|thumb|WS3.0 coastline just using a 10m raster with no vector data, showing the coastline problem]]&lt;br /&gt;
[[File:Fgfs-20230219173559.jpg|thumb|WS3.0 coastline using OSM vector data.  Note the artifacts where the data doesn't line up.]]&lt;br /&gt;
[[File:Fgfs-20230227220551.jpg|alt=|thumb|Current state-of-the-art coast rendering, using OSM data for both raster and coastline definition.  Martinique]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page describes various techniques/experiments to find a better solution.&lt;br /&gt;
&lt;br /&gt;
=== Current Rendering ===&lt;br /&gt;
The current &amp;quot;state of the art&amp;quot; is to is to create a second texture at much higher resolution and paint the coastline onto this.  The fragment shader then mixes the standard resolution landclass and the much higher resolution coastline texture.  This has the advantage of being able to mix the data together nicely.    &lt;br /&gt;
&lt;br /&gt;
We currently support both generating this higher resolution raster at scenery generation time and also at runtime.  Both the generation of the texture and the shader are currently quite basic and would benefit from further development from anyone interested in this area.&lt;br /&gt;
&lt;br /&gt;
The significant downside is the increased memory occupancy of the additional texture and the added complexity of the shader.&lt;br /&gt;
&lt;br /&gt;
This still leaves an issue that the elevation mesh is completely regular, so where steep slopes meet the sea, the high water mark can be a half way up a slope!  The shader creates cliffs and beaches instead of water depending on the steepness of the elevation mesh.&lt;br /&gt;
&lt;br /&gt;
=== OpenStreetMap or other vector coastline data ===&lt;br /&gt;
OpenStreetMap has line data for coastlines and water bodies.  This is vector data, so can be rendered at higher apparent resolution than the landclass data.  The gencoastline.py script in fgmeta/ws30 uses this to generate a series of lat/lon points that FlightGear can then use.&lt;br /&gt;
&lt;br /&gt;
There is a problem where the OSM coastline (defined as the mean high water mark) doesn't exactly match the landclass raster due to projection discrepancies or simply because of state of the tide at the time that a satellite image was taken.    &lt;br /&gt;
&lt;br /&gt;
Ideally the coastline of the raster will match the OSM coastline as closely as possible, and perhaps overlap slightly.  &lt;br /&gt;
&lt;br /&gt;
To do this:  &lt;br /&gt;
&lt;br /&gt;
# Reclassify the Ocean as NODATA (0.0)&lt;br /&gt;
#* r.reclass using https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/remove_sea.txt.  This reclassifies 44 (Sea) as NODATA&lt;br /&gt;
&lt;br /&gt;
# Use the GDAL Fill nodata to fill out the edges for radius 10.  You will now have a raster as if the sea level has dropped.  Use one of the following&lt;br /&gt;
#*&amp;lt;code&amp;gt;gdal_fillnodata.py -md 10 -b 1 -of GTiff &amp;lt;original_file&amp;gt; &amp;lt;new_file&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
#* r.fill.stats using the mode as the statistical method&lt;br /&gt;
# Get a shapefile of the coastline from OSM.  The simplest way is to download the WGS84 split polygons from here: https://osmdata.openstreetmap.de/data/land-polygons.html.  You may wish to pre-process these to clip to the rough extents of your scenery to reduce the size of the file.&lt;br /&gt;
&lt;br /&gt;
# Load the OSM shapefile and Use Clip raster by mask layer this will cut out the landmass much more accurately than before.&lt;br /&gt;
#* gdalwarp -overwrite -of GTiff -tr 0.00015600000000000002 -9.000000000000003e-05 -tap -cutline &amp;lt;vector.osm&amp;gt; -cl multipolygons &amp;lt;input&amp;gt; &amp;lt;output&amp;gt;&lt;br /&gt;
# Use the GDAL Fill nodata to fill out the edges for radius 1.  This ensures that there is &amp;quot;land&amp;quot; underneath the shoreline itself.&lt;br /&gt;
#* gdal_fillnodata.py -md 1 -b 1 -of GTiff &amp;lt;input&amp;gt; &amp;lt;output&amp;gt;&lt;br /&gt;
# Use the standard Fill NoData cells to fill the NoData with the correct Ocean landclass.&lt;br /&gt;
#* gdal_calc.py -A &amp;lt;input&amp;gt; --NoDataValue=44 --calc=&amp;quot;A&amp;quot; --outfile &amp;lt;output&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The genVPB.py script performs these steps.&lt;br /&gt;
&lt;br /&gt;
=== Experiments ===&lt;br /&gt;
&lt;br /&gt;
==== Direct model generation ====&lt;br /&gt;
Initial experiments using the same approach as roads (overlaying an additional tri-strip for the coastline) did not blend well with the underlying landclass mesh.&lt;br /&gt;
&lt;br /&gt;
'''Scenery-time generation of detailed coastline raster'''&lt;br /&gt;
&lt;br /&gt;
fgmeta/ws30/gencoastlineraster.py generates a raster file that can be loaded by FG at runtime.  This is quite effective and leverages python raster packages.  The downside is the additional disk space.&lt;br /&gt;
&lt;br /&gt;
=== Thought Experiments ===&lt;br /&gt;
&lt;br /&gt;
==== Nearest Neighbour Encoding ====&lt;br /&gt;
The landclass texture currently has unused channels.  It would be possible to use one of those channels to encode information about the neighbouring texels.  This could be used for mixing coastline fragments better.  For example, encoding whether the 8 surrounding texels are water or land could be done in 8 bits, conveniently 256 different values.  A separate texture could be conceived that defined a different shape of coastline for each of the 256 combinations, probably with some perturbations to avoid obvious repetition.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0_coastlines&amp;diff=138922</id>
		<title>World Scenery 3.0 coastlines</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0_coastlines&amp;diff=138922"/>
		<updated>2024-01-03T01:28:24Z</updated>

		<summary type="html">&lt;p&gt;Stuart: /* Current Rendering */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
World Scenery 3.0 uses a texture of landclass information, typically with 10-25m resolution.  For coastlines in particular, this creates an obvious sharp edge with right angles.&lt;br /&gt;
[[File:Fgfs-20220208201349.jpg|thumb|WS3.0 coastline just using a 10m raster with no vector data, showing the coastline problem]]&lt;br /&gt;
[[File:Fgfs-20230219173559.jpg|thumb|WS3.0 coastline using OSM vector data.  Note the artifacts where the data doesn't line up.]]&lt;br /&gt;
[[File:Fgfs-20230227220551.jpg|alt=|thumb|Current state-of-the-art coast rendering, using OSM data for both raster and coastline definition.  Martinique]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page describes various techniques/experiments to find a better solution.&lt;br /&gt;
&lt;br /&gt;
=== Current Rendering ===&lt;br /&gt;
The current &amp;quot;state of the art&amp;quot; is to is to create a second texture at much higher resolution and paint the coastline onto this.  The fragment shader then mixes the standard resolution landclass and the much higher resolution coastline texture.  This has the advantage of being able to mix the data together nicely.    &lt;br /&gt;
&lt;br /&gt;
We currently support both generating this higher resolution raster at scenery generation time and also at runtime.  Both the generation of the texture and the shader are currently quite basic and would benefit from further development from anyone interested in this area.&lt;br /&gt;
&lt;br /&gt;
The significant downside is the increased memory occupancy of the additional texture and the added complexity of the shader.&lt;br /&gt;
&lt;br /&gt;
This still leaves an issue that the elevation mesh is completely regular, so where steep slopes meet the sea, the high water mark can be a half way up a slope!  The shader creates cliffs and beaches instead of water depending on the steepness of the elevation mesh.&lt;br /&gt;
&lt;br /&gt;
=== OpenStreetMap or other vector coastline data ===&lt;br /&gt;
OpenStreetMap has line data for coastlines and water bodies.  This is vector data, so can be rendered at higher apparent resolution than the landclass data.  The gencoastline.py script in fgmeta/ws30 uses this to generate a series of lat/lon points that FlightGear can then use.&lt;br /&gt;
&lt;br /&gt;
There is a problem where the OSM coastline (defined as the mean high water mark) doesn't exactly match the landclass raster due to projection discrepancies or simply because of state of the tide at the time that a satellite image was taken.    &lt;br /&gt;
&lt;br /&gt;
Ideally the coastline of the raster will match the OSM coastline as closely as possible, and perhaps overlap slightly.  &lt;br /&gt;
&lt;br /&gt;
To do this:  &lt;br /&gt;
&lt;br /&gt;
# Reclassify the Ocean as NODATA (0.0)&lt;br /&gt;
#* r.reclass using https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/remove_sea.txt.  This reclassifies 44 (Sea) as NODATA&lt;br /&gt;
&lt;br /&gt;
# Use the GDAL Fill nodata to fill out the edges for radius 10.  You will now have a raster as if the sea level has dropped.  Use one of the following&lt;br /&gt;
#*&amp;lt;code&amp;gt;gdal_fillnodata.py -md 10 -b 1 -of GTiff &amp;lt;original_file&amp;gt; &amp;lt;new_file&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
#* r.fill.stats using the mode as the statistical method&lt;br /&gt;
# Get a shapefile of the coastline from OSM.  The simplest way is to download the WGS84 split polygons from here: https://osmdata.openstreetmap.de/data/land-polygons.html.  You may wish to pre-process these to clip to the rough extents of your scenery to reduce the size of the file.&lt;br /&gt;
&lt;br /&gt;
# Load the OSM shapefile and Use Clip raster by mask layer this will cut out the landmass much more accurately than before.&lt;br /&gt;
#* gdalwarp -overwrite -of GTiff -tr 0.00015600000000000002 -9.000000000000003e-05 -tap -cutline &amp;lt;vector.osm&amp;gt; -cl multipolygons &amp;lt;input&amp;gt; &amp;lt;output&amp;gt;&lt;br /&gt;
# Use the GDAL Fill nodata to fill out the edges for radius 1.  This ensures that there is &amp;quot;land&amp;quot; underneath the shoreline itself.&lt;br /&gt;
#* gdal_fillnodata.py -md 1 -b 1 -of GTiff &amp;lt;input&amp;gt; &amp;lt;output&amp;gt;&lt;br /&gt;
# Use the standard Fill NoData cells to fill the NoData with the correct Ocean landclass.&lt;br /&gt;
#* gdal_calc.py -A &amp;lt;input&amp;gt; --NoDataValue=44 --calc=&amp;quot;A&amp;quot; --outfile &amp;lt;output&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Experiments ===&lt;br /&gt;
&lt;br /&gt;
==== Direct model generation ====&lt;br /&gt;
Initial experiments using the same approach as roads (overlaying an additional tri-strip for the coastline) did not blend well with the underlying landclass mesh.&lt;br /&gt;
&lt;br /&gt;
=== Thought Experiments ===&lt;br /&gt;
&lt;br /&gt;
==== Nearest Neighbour Encoding ====&lt;br /&gt;
The landclass texture currently has unused channels.  It would be possible to use one of those channels to encode information about the neighbouring texels.  This could be used for mixing coastline fragments better.  For example, encoding whether the 8 surrounding texels are water or land could be done in 8 bits, conveniently 256 different values.  A separate texture could be conceived that defined a different shape of coastline for each of the 256 combinations, probably with some perturbations to avoid obvious repetition.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=138835</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=138835"/>
		<updated>2023-12-21T17:36:58Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Minor changing of heading levels&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate basic WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of two parts:&lt;br /&gt;
&lt;br /&gt;
# A terrain mesh consisting of a landclass texture draped over an elevation model.  &lt;br /&gt;
# Line features such as roads, railways, rivers and coastline.  &lt;br /&gt;
The terrain is generated by a set of tools that are packaged in a docker image for convenience.[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Set up a Workspace ===&lt;br /&gt;
Create a directory with the following sub-directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/vpb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/Terrain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Docker ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#Pull the docker image by running the following command&lt;br /&gt;
&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run &amp;lt;code&amp;gt;docker login&amp;lt;/code&amp;gt; before the '''docker pull''' command above&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
You need two pieces of data for the area of scenery you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  This indicates what altitude each point of the surface is.&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster (effectively a texture), or vector data.  &lt;br /&gt;
&lt;br /&gt;
=== Elevation Model ===&lt;br /&gt;
Download the NASADEM elevation model for the area of scenery you wish to generate.  This is available in 1x1 degree blocks from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].  &lt;br /&gt;
&lt;br /&gt;
Unzip the files into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== Landclass Raster ===&lt;br /&gt;
Download an landclass raster for the area of scenery you wish to generate.&lt;br /&gt;
&lt;br /&gt;
* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
* For the USA [https://www.mrlc.gov/viewer/ NLCD] is recommended&lt;br /&gt;
* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
&lt;br /&gt;
Put these into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
More detailed terrain can be created by modifying the landclass raster, and/or generating a new raster from vector data.  These processes are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Generating Terrain ==&lt;br /&gt;
To generate terrain you need to run the tools within the docker container we installed above.  The docker image is like a small, independent virtual computing environment running within your system.  This particular docker image has all the scenery generation tools already installed.&lt;br /&gt;
&lt;br /&gt;
=== Running the docker container ===&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 data  output&lt;br /&gt;
&lt;br /&gt;
=== Building the terrain ===&lt;br /&gt;
To build the terrain mesh, use the &amp;lt;code&amp;gt;genVPB.py&amp;lt;/code&amp;gt; tool from inside the docker container.&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
For example, to generate a piece of terrain around Edinburgh (latitude 55.5, longitude 3 degrees West)&lt;br /&gt;
 ./scripts/genVPB.py -3 55 -2 56 ./data/uk_wgs84_10m_N54.tif &lt;br /&gt;
If you are using anything other than a CORINE raster you will need to reclassify the data to match the landclasses used by FlightGear.  Those classes are defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].  You can reclassify them using the files in the [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/ scripts/mappings] directory. E.g. to reclassify NLCD2019 data you can use &amp;lt;code&amp;gt;--reclassify ./scripts/mappings/nlcd2019.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
genVPB.py will output the data to the output/vpb directory, in which you should find a series of files and directories.&lt;br /&gt;
&lt;br /&gt;
=== Adding roads, railways and rivers ===&lt;br /&gt;
The terrain mesh does not have any line features - things like roads.  These are generated separately by the genRoads.py command by downloading data from OpenStreetMap.  To generate line features simply run the genroads.py command:&lt;br /&gt;
 Usage: ./scripts/genroads.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate roads for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and, .STG files text files.&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the output directory in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
The following sections describe more complex techniques to generate higher quality WS3.0 terrain.  Almost all of them involve using different data sources to generate a more detailed landclass raster before running the final scenery generation processes described above.  Generating a highly detailed landclass raster is where the magic happens.  &lt;br /&gt;
&lt;br /&gt;
Most techniques use gdal or grass to modify the raster/vector data, typically using the QGIS program.&lt;br /&gt;
&lt;br /&gt;
=== Using a different elevation model ===&lt;br /&gt;
If you are using another elevation model other than NASAEM, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).  &lt;br /&gt;
&lt;br /&gt;
=== Landclass Data Requirements ===&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  We use a set of values based on the CORINE raster set, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS84 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.&lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
genVPB.py will automatically convert to WGS84 if it detects a landclass raster with a different Coordinate System.  However, you may wish to do so manually instead so all your data is on the same coordinate system.  &lt;br /&gt;
&lt;br /&gt;
In QGIS you can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box.  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  genVPB.py has an option to do this, but you may wish to do so manually.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - For Deciduous use * 41, for Evergreen use  * 42, for Mixed Forest use 43&lt;br /&gt;
&lt;br /&gt;
Some areas may require the Tree Canopy Layer to be re-classified to multiple tree tree types.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_4326-84@1&amp;quot; + (&amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; != 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 4x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
===Generating the Terrain using osgdem===&lt;br /&gt;
Instead of using genVPB.py, you may wish to run osgdem directly.&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Packaging the Scenery===&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=138834</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=138834"/>
		<updated>2023-12-21T17:28:07Z</updated>

		<summary type="html">&lt;p&gt;Stuart: Create was WS3.0 tutorial at top of page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate basic WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of two parts:&lt;br /&gt;
&lt;br /&gt;
# A terrain mesh consisting of a landclass texture draped over an elevation model.  &lt;br /&gt;
# Line features such as roads, railways, rivers and coastline.  &lt;br /&gt;
The terrain is generated by a set of tools that are packaged in a docker image for convenience.[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Set up a Workspace ===&lt;br /&gt;
Create a directory with the following sub-directories:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/vpb&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;output/Terrain&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Docker ===&lt;br /&gt;
&lt;br /&gt;
# Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#Pull the docker image by running the following command&lt;br /&gt;
&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run &amp;lt;code&amp;gt;docker login&amp;lt;/code&amp;gt; before the '''docker pull''' command above&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
You need two pieces of data for the area of scenery you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  This indicates what altitude each point of the surface is.&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster (effectively a texture), or vector data.  &lt;br /&gt;
&lt;br /&gt;
=== Elevation Model ===&lt;br /&gt;
Download the NASADEM elevation model for the area of scenery you wish to generate.  This is available in 1x1 degree blocks from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].  &lt;br /&gt;
&lt;br /&gt;
Unzip the files into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
=== Landclass Raster ===&lt;br /&gt;
Download an landclass raster for the area of scenery you wish to generate.&lt;br /&gt;
&lt;br /&gt;
* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
* For the USA [https://www.mrlc.gov/viewer/ NLCD] is recommended&lt;br /&gt;
* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
&lt;br /&gt;
Put these into the &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
More detailed terrain can be created by modifying the landclass raster, and/or generating a new raster from vector data.  These processes are discussed below.&lt;br /&gt;
&lt;br /&gt;
== Generating Terrain ==&lt;br /&gt;
To generate terrain you need to run the tools within the docker container we installed above.  The docker image is like a small, independent virtual computing environment running within your system.  This particular docker image has all the scenery generation tools already installed.&lt;br /&gt;
&lt;br /&gt;
=== Running the docker container ===&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 data  output&lt;br /&gt;
&lt;br /&gt;
=== Building the terrain ===&lt;br /&gt;
To build the terrain mesh, use the &amp;lt;code&amp;gt;genVPB.py&amp;lt;/code&amp;gt; tool from inside the docker container.&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
For example, to generate a piece of terrain around Edinburgh (latitude 55.5, longitude 3 degrees West)&lt;br /&gt;
 ./scripts/genVPB.py -3 55 -2 56 ./data/uk_wgs84_10m_N54.tif &lt;br /&gt;
If you are using anything other than a CORINE raster you will need to reclassify the data to match the landclasses used by FlightGear.  Those classes are defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].  You can reclassify them using the files in the [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/ scripts/mappings] directory. E.g. to reclassify NLCD2019 data you can use &amp;lt;code&amp;gt;--reclassify ./scripts/mappings/nlcd2019.txt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
genVPB.py will output the data to the output/vpb directory, in which you should find a series of files and directories.&lt;br /&gt;
&lt;br /&gt;
=== Adding roads, railways and rivers ===&lt;br /&gt;
The terrain mesh does not have any line features - things like roads.  These are generated separately by the genRoads.py command by downloading data from OpenStreetMap.  To generate line features simply run the genroads.py command:&lt;br /&gt;
 Usage: ./scripts/genroads.py &amp;lt;scenery_dir&amp;gt; &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;&lt;br /&gt;
   &amp;lt;scenery_dir&amp;gt;      Scenery directory to write to&lt;br /&gt;
   &amp;lt;lon1&amp;gt; &amp;lt;lat1&amp;gt;      Bottom left lon/lat of bounding box&lt;br /&gt;
   &amp;lt;lon2&amp;gt; &amp;lt;lat2&amp;gt;      Top right lon/lat of bounding box&lt;br /&gt;
&lt;br /&gt;
The scenery directory should be your output/Terrain directory created above.  For example, to generate roads for the area around Edinburgh:&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56&lt;br /&gt;
Inside the ./output/Terrain directory there should be a set of directories and, .STG files text files.&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the output directory in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;br /&gt;
&lt;br /&gt;
== Advanced Techniques ==&lt;br /&gt;
The following sections describe more complex techniques to generate higher quality WS3.0 terrain.  Almost all of them involve using different data sources to generate a more detailed landclass raster before running the final scenery generation processes described above.  Generating a highly detailed landclass raster is where the magic happens.  &lt;br /&gt;
&lt;br /&gt;
Most techniques use gdal or grass to modify the raster/vector data, typically using the QGIS program.&lt;br /&gt;
&lt;br /&gt;
== Pre-processing the Elevation Model ==&lt;br /&gt;
If you are using NASADEM, then the elevation model is already using WGS84 and is ready to use as-is.  &lt;br /&gt;
&lt;br /&gt;
If you are using another elevation model, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).&lt;br /&gt;
&lt;br /&gt;
== Pre-processing the Landclass Data ==&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  Different landclass systems use different values.  At present we use the CORINE values, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS82 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
This is applicable to CORINE Raster data&lt;br /&gt;
&lt;br /&gt;
You can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
You can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box.  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - For Deciduous use * 41, for Evergreen use  * 42, for Mixed Forest use 43&lt;br /&gt;
&lt;br /&gt;
Some areas may require the Tree Canopy Layer to be re-classified to multiple tree tree types.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_4326-84@1&amp;quot; + (&amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; != 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 4x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
==Running the Container==&lt;br /&gt;
To generate terrain you need to run the Virtual Planet Builder tool within the container.&lt;br /&gt;
&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
In a Windows environment the following can be used to build in the folder structure of&lt;br /&gt;
&lt;br /&gt;
data&lt;br /&gt;
&lt;br /&gt;
output/vpb&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/SRTM-3,target=/home/flightgear/SRTM-3,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output/vpb,target=/home/flightgear/output/vpb&amp;quot; -it flightgear/ws30-vbp-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 data  output&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Generating the Terrain==&lt;br /&gt;
The genVPB.py script will generate tiles of terrain from a landclass raster:&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Creating line features==&lt;br /&gt;
Line features such as roads, railways and rivers are simply stored as a series of lat/lon points in an STG file using a specific STG verb.  We get the data of this from Openstreetmap, and we have some simple scripts to generate the files.&lt;br /&gt;
&lt;br /&gt;
The scripts are already included in the docker image at &amp;lt;code&amp;gt;/home/flightgear/scripts/&amp;lt;/code&amp;gt;.&lt;br /&gt;
===Running the scripts===&lt;br /&gt;
The genroads.py script generates all line features.  Simply set the output directory and the lat/lon box.  Note that the output directory should be a &amp;quot;Terrain&amp;quot; directory.  E.g.&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56&lt;br /&gt;
&lt;br /&gt;
== Packaging the Scenery==&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the appropriate scenery directory (e.g. MyCoolScenery) in in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=138833</id>
		<title>Howto:Create WS3.0 terrain</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=138833"/>
		<updated>2023-12-21T16:31:57Z</updated>

		<summary type="html">&lt;p&gt;Stuart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
This article provides instructions on how to generate base WS3.0 terrain.&lt;br /&gt;
&lt;br /&gt;
WS3.0 terrain consists of two parts:&lt;br /&gt;
&lt;br /&gt;
# A landclass texture draped over an elevation model.  This is the terrain mesh.&lt;br /&gt;
# Line features such as roads, railways, rivers and coastline.  This is draped over the terrain mesh at runtime.&lt;br /&gt;
[[File:Diagram-export-21-12-2023-16 29 37.png|thumb|Basic WS3.0 Scenery Generation Process]]&lt;br /&gt;
&lt;br /&gt;
== Getting the base data ==&lt;br /&gt;
First, you need two pieces of data for the scenery area you are generating:&lt;br /&gt;
&lt;br /&gt;
# An elevation model (aka DEM).  Use of the &amp;quot;NASADEM&amp;quot; with 30m resolution is recommended, and is available from [https://lpdaac.usgs.gov/products/nasadem_hgtv001/ here], and with an interactive browser [https://search.earthdata.nasa.gov/search here].&lt;br /&gt;
# Landclass data showing what type of terrain is at each point of the surface.  This is often either a Raster Geotiff (effectively a texture), or vector data.  &lt;br /&gt;
#* For Europe, use of [https://land.copernicus.eu/pan-european/corine-land-cover/clc2018 CORINE] is recommended.&lt;br /&gt;
#* For the USA NLCD is recommended&lt;br /&gt;
#* Sentinel-2 data is available for the entire world via [https://livingatlas.arcgis.com/landcoverexplorer/ ESRI], but has limited set of landclasses.&lt;br /&gt;
Put these files into a &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; directory and create an &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directory next to it. This is where the scenery will be generated..&lt;br /&gt;
&lt;br /&gt;
== Pre-processing the Elevation Model ==&lt;br /&gt;
If you are using NASADEM, then the elevation model is already using WGS84 and is ready to use as-is.  &lt;br /&gt;
&lt;br /&gt;
If you are using another elevation model, then you may need to re-project it using QGIS/gdalwarp to the WGS84 CRS (aka EPSG:4326).&lt;br /&gt;
&lt;br /&gt;
== Pre-processing the Landclass Data ==&lt;br /&gt;
For any landclass data we need to ensure the data is in the correct format.  That means:&lt;br /&gt;
&lt;br /&gt;
# Is a Raster (geotiff) rather than Vector data.  This raster will become the texture on the terrain that the terrain shaders do their magic on.&lt;br /&gt;
# Uses the WGS84 Coordinate Reference System.  The ensures that the terrain generation step is efficient.&lt;br /&gt;
# Has the correct landclass values for each terrain type.  Different landclass systems use different values.  At present we use the CORINE values, defined in [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml].&lt;br /&gt;
&lt;br /&gt;
Below is a quick table showing what steps you need to take for common landclass data sources.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|+&lt;br /&gt;
!Landclass Data&lt;br /&gt;
!Warp to WGS84 required?&lt;br /&gt;
!Landclass re-classification Required?&lt;br /&gt;
!Raster Simplification Required?&lt;br /&gt;
!Conversion to Raster Required?&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Raster&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|CORINE Vector&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|-&lt;br /&gt;
|NLCD&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|-&lt;br /&gt;
|Sentinel-2&lt;br /&gt;
|Yes&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|No&lt;br /&gt;
|}&lt;br /&gt;
Conversion to Raster must be done manually.  Converting to WGS82 and the correct landclasses ''can'' be done by the genVPB.py script, but slows down scenery generation.  Therefore if you are planning to generate scenery multiple times it is best to pre-process the files yourself.&lt;br /&gt;
&lt;br /&gt;
The easiest way to do these operations is using QGIS, which is available for most platforms.  If you are scripting a toolchain, the QGIS tools include command-line equivalents for all commands.&lt;br /&gt;
&lt;br /&gt;
When using QGIS, set the Project CRS to WGS84 (aka EPSG:4326).  You can then add layers of Raster or Vector data from files from the &amp;lt;code&amp;gt;Layer-&amp;gt;Add Layer&amp;lt;/code&amp;gt; menu.  When performing any operations, &amp;lt;u&amp;gt;always&amp;lt;/u&amp;gt; write out the data to a real file so you can go back to it later. Disk space is cheap :).&lt;br /&gt;
&lt;br /&gt;
=== Warping Raster Layers to WGS84 ===&lt;br /&gt;
This is applicable to CORINE Raster data&lt;br /&gt;
&lt;br /&gt;
You can warp a raster layer to a different CRS using the Raster-&amp;gt;Projections-Warp (Reproject) tool.  &lt;br /&gt;
&lt;br /&gt;
Select the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Resampling Method to Use - Nearest Neighbour.  (Landclass data is not like normal images.  You don't want to interpolate between values.)&lt;br /&gt;
* Nodata value for output bands - 0.0  (This means that any data at the edges will be Ocean, usually a reasonable default)&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Alternatively you can do this step from the commandline.&lt;br /&gt;
 gdalwarp -t_srs EPSG:4326 -dstnodata 0.0 -r near -ot Byte -of GTiff -co COMPRESS=NONE -co BIGTIFF=IF_NEEDED /home/stuart/FlightGear/VPB/data/CORINE/u2018_clc2018_v2020_20u1_raster100m/DATA/U2018_CLC2018_V2020_20u1.tif /home/stuart/FlightGear/VPB/data/scratch/corine_WGS84.tif&lt;br /&gt;
&lt;br /&gt;
=== Warping Vector Layers to WGS84 ===&lt;br /&gt;
You can warp a vector layer using Vector-&amp;gt;Data Management Tools-&amp;gt;Reproject Layer.  &lt;br /&gt;
&lt;br /&gt;
Set the following options in the dialog:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - Check you have selected the correct layer. The CRS is shown at the right.&lt;br /&gt;
* Target CRS -   set to &amp;lt;code&amp;gt;EPSG:4326 - WGS84&amp;lt;/code&amp;gt;, which should be your project CRS.&lt;br /&gt;
* Reprojected - Choose a target filename&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying Vector Layers ===&lt;br /&gt;
For CORINE vector data in particular, the attributes used in the vector data are not the same as those used by the CORINE Raster data.  So we need to create a new attribute on the data.&lt;br /&gt;
[[File:Field Calculator.png|thumb|QGIS Field Calculator]]&lt;br /&gt;
To do this &lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Open Attribute Table&amp;lt;/code&amp;gt;.  You should see a table with multiple columns.  Each row represents a feature in the data.&lt;br /&gt;
* Click on &amp;lt;code&amp;gt;New Field&amp;lt;/code&amp;gt; (Ctrl+W) and create a new field called Landclass of type &amp;quot;Whole Number (Integer)&amp;quot;.  This will create a new column which we will populate with the correct landclass data&lt;br /&gt;
* Click on the &amp;lt;code&amp;gt;Open Field Calculator&amp;lt;/code&amp;gt; button (Ctrl + I).  (If you get an error about only being able to create Virtual fields, go back to the Layer menu, export it and open the exported file).&lt;br /&gt;
* Select the following options:&lt;br /&gt;
** Update Existing Field&lt;br /&gt;
** Select the Landclass field you just created.&lt;br /&gt;
** Copy the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/corine_vector.txt into the Expression box.  This is just some simple code to set the attribute correctly.  The code should be correct for CORINE vector data.  If your data is from other sources you will need to work out how you want to map your source data landclasses to the CORINE ones.  [https://sourceforge.net/p/flightgear/fgdata/ci/next/tree/Materials/base/landclass-mapping.xml Materials/base/landclass-mapping.xml] can be used as a guide.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;OK&amp;lt;/code&amp;gt;.  You should see that your landclass column is now populated with the landclass data.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save you changes&lt;br /&gt;
&lt;br /&gt;
=== Creating a Raster from a Vector Layer ===&lt;br /&gt;
To create a Raster from a Vector Layer select &amp;lt;code&amp;gt;Raster-&amp;gt;Conversion-&amp;gt;Rasterize (Vector to Raster)&amp;lt;/code&amp;gt;.  &lt;br /&gt;
[[File:QGIS Rasterize (Vector to Raster).png|thumb|Creating a Raster from a Vector Layer - QGIS Rasterize]]&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Field to use for burn-in value - select the Landclass column you created above.&lt;br /&gt;
* Output raster size units.  This is going to set the resolution of your raster.  You can work out the resolution in two different ways:&lt;br /&gt;
** Select &amp;quot;Georeferenced units&amp;quot; and determine how many degrees each pixel is in latitude and longitude.&lt;br /&gt;
** Select &amp;quot;Pixels&amp;quot; and determine the size of raster you want in pixels.  [https://www.nhc.noaa.gov/gccalc.shtml This] is a good calculator to help.&lt;br /&gt;
* Width/Horizontal Resolution.  Enter the values you've calculated for the horizontal resolution (longitudinal), or the width of the raster&lt;br /&gt;
* Height/Vertical Resolution.    Enter the values you've calculated for the vertical resolution (latitude or the height of the raster&lt;br /&gt;
* Output extent - Select an option from the box on the right.    You can edit the text afterwards.&lt;br /&gt;
* Assign a specific nodata value to output bands - Select 0.0 for Ocean.  CORINE vector data in particular has a lot of nodata for Oceans&lt;br /&gt;
* Advanced Parameters - No Compression&lt;br /&gt;
* Output data type - Byte&lt;br /&gt;
* Rasterized - Select a new filename&lt;br /&gt;
&lt;br /&gt;
=== Simplifying a Raster Layer ===&lt;br /&gt;
Some Raster Landclass data (NLCD included) has too much noise - in particular large US highway systems are identified as Urban areas.&lt;br /&gt;
&lt;br /&gt;
To smooth it out we can use the GRASS &amp;lt;code&amp;gt;n.neighbors&amp;lt;/code&amp;gt; function from the Processing Toolbox in QGIS.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Layer - correct layer, check CRS&lt;br /&gt;
* Neighborhood operation - median.  (This is not a normal image, so using an average will result in weird values)&lt;br /&gt;
* Neighborhood size - 5.&lt;br /&gt;
* Neighbors - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
=== Reclassifying a Raster Layer ===&lt;br /&gt;
WS3.0 uses CORINE landclass values.  If using data from other sources it needs to be reclassified to the correct values.  &lt;br /&gt;
&lt;br /&gt;
To do this select &amp;lt;code&amp;gt;GRASS-&amp;gt;Raster-&amp;gt;r.reclass&amp;lt;/code&amp;gt; from the Processing Toolbox.&lt;br /&gt;
&lt;br /&gt;
Select the following options:&lt;br /&gt;
&lt;br /&gt;
* Input Raster Layer - correct layer, check CRS&lt;br /&gt;
* Reclass rules text - copy in the contents of https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/ws30/mappings/nlcd2019.txt.  Or an appropriate mapping from your landclass data to CORINE.  Note that you can also reference a file using the &amp;quot;File containing reclass rules&amp;quot; option. Note a mapping of 22 24 = 1 is the same as 22 and 24 = 1. For a range of 22 to 24 use 22 23 24 = 1.&lt;br /&gt;
* Reclassified - Select a new filename.&lt;br /&gt;
&lt;br /&gt;
(If this doesn't work a similar function is available in the Processing Toolbox under &amp;lt;code&amp;gt;Raster analysis-&amp;gt;Reclassify by table&amp;lt;/code&amp;gt;.  However this doesn't save your table once you close the dialog, and entries have to be manually entered individually which takes a lot of effort)&lt;br /&gt;
&lt;br /&gt;
=== Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator, Up sampling and GRASS r.neighbors===&lt;br /&gt;
&lt;br /&gt;
We will use a predetermined file naming convention throughout this procedure for simplicity. You can use a naming convention of your choice.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2019_Land_Cover from source of choice, https://www.mrlc.gov/viewer/&lt;br /&gt;
&lt;br /&gt;
NLCD_2019_Land_Cover data = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Obtain your NLCD_2016_Tree_Canopy from source of choice, https://www.mrlc.gov/viewer/ &lt;br /&gt;
&lt;br /&gt;
NLCD_2016_Tree_Canopy data = NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Deciduous Layer 255 to 0 EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; = 255) * 0 + (&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 255) * &amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous-coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Tree Canopy Layer EPSG:5070 - NAD83 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255 - For Deciduous use * 41, for Evergreen use  * 42, for Mixed Forest use 43&lt;br /&gt;
&lt;br /&gt;
Some areas may require the Tree Canopy Layer to be re-classified to multiple tree tree types.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous-coast-clipped@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;NLCD_2016_Tree_Canopy_California-Southern@1&amp;quot; != 0) * 42&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:5070 - NAD83&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Clipped Ocean Frontage EPSG:5070 - NAD83 - GIMP&lt;br /&gt;
&lt;br /&gt;
Source = NLCD_2019_Land_Cover_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
Flood fill index 11 (blue) with 0 (black)&lt;br /&gt;
&lt;br /&gt;
Export tiff =  California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Warp NLCD Deciduous and Base NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84 - WARP&lt;br /&gt;
&lt;br /&gt;
If ocean bordering with index 255&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_coast-clipped.tiff&lt;br /&gt;
&lt;br /&gt;
Else&lt;br /&gt;
&lt;br /&gt;
Warp NLCD_2016_Tree_Canopy_California-Southern.tiff&lt;br /&gt;
&lt;br /&gt;
and&lt;br /&gt;
&lt;br /&gt;
Warp Deciduous NLCD from EPSG:5070 - NAD83 / Conus Albers NLCD to Project CRS: EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Warp California-Southern_deciduous.tiff&lt;br /&gt;
&lt;br /&gt;
Raster -&amp;gt; Projection - &amp;gt; Warp&lt;br /&gt;
&lt;br /&gt;
Target CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Resampling method to use = Nearest Neighbour&lt;br /&gt;
&lt;br /&gt;
Output data type = byte&lt;br /&gt;
&lt;br /&gt;
Reprojected = California-Southern_4326-84.tiff and California-Southern_deciduous_4326-84.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_deciduous_4326-84.@1&amp;quot; and &amp;quot;California-Southern_4326-84@1&amp;quot; - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_4326-84@1&amp;quot; + (&amp;quot;California-Southern_deciduous_4326-84@1&amp;quot; != 0) * &amp;quot;California-Southern_deciduous_4326-84@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-class urban 21, 22, 23, 24 = grass 26 - Raster Calculator&lt;br /&gt;
&lt;br /&gt;
This step is being used to erase all the man made clutter on the raster with grassland. Instead of grassland you can replace it with any type of prevailing groundcover in the area your processing.&lt;br /&gt;
&lt;br /&gt;
For example this places a road easement of grass on all the road clutter that was originally in the raster. If your processing a desert area you might want to use dirt or sand instead of grassland. For Arctic areas maybe use tundra.&lt;br /&gt;
&lt;br /&gt;
Part of the clutter gets replaced later in the process.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 11) * 41 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 12) * 34 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 31) * 27 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 41) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 42) * 24 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 43) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 51) * 30 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 52) * 29 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 71) * 26 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 72) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 73) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 74) * 31 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 75) * 32 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 81) * 18 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 82) * 19 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 90) * 25 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 95) * 35&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_reclass-grass.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Make Urban layer&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_adjusted@1&amp;quot; = 21) * 10 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 22) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 23) * 1 + (&amp;quot;California-Southern_adjusted@1&amp;quot; = 24) * 2&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_urban.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Remove the road clutter with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Combine &amp;quot;California-Southern_reclass-urban@1&amp;quot; and &amp;quot;California-Southern_reclass-grass@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
This step replaces the &amp;quot;cleaned up&amp;quot; urban areas back into the raster.&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_urban-only@1&amp;quot; &amp;lt; 1) * &amp;quot;California-Southern_reclass-grass@1&amp;quot; + (&amp;quot;California-Southern_urban-only@1&amp;quot; != 0) * &amp;quot;California-Southern_urban-only@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Up sample California-Southern_adjusted-combined.tiff 4x resolution 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Active Layer = California-Southern_adjusted-combined.tiff&lt;br /&gt;
&lt;br /&gt;
Layer/Save As&lt;br /&gt;
&lt;br /&gt;
Horizontal = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
Vertical = 0.00008309125&lt;br /&gt;
&lt;br /&gt;
File Name = California-Southern_final-prep-4x.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Simplify California-Southern_4326-84-hd.tiff with r.neighbor&lt;br /&gt;
&lt;br /&gt;
GRASS/Raster/r.neighbor&lt;br /&gt;
&lt;br /&gt;
Neighborhood operation = median&lt;br /&gt;
&lt;br /&gt;
Neighborhood size = 7&lt;br /&gt;
&lt;br /&gt;
Neighbors = California-Southern_urban-only.tiff&lt;br /&gt;
&lt;br /&gt;
Run&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Reclass index 0 to 44, leave the rest the same&lt;br /&gt;
&lt;br /&gt;
(&amp;quot;California-Southern_4326-84-hd@1&amp;quot; = 0) * 44 + (&amp;quot;California-Southern_4326-84-hd@1&amp;quot; != 0) * &amp;quot;California-Southern_4326-84-hd@1&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Output CRS = EPSG:4326 - WGS 84&lt;br /&gt;
&lt;br /&gt;
Output Layer = California-Southern_4326-84-hd-corrected.tiff&lt;br /&gt;
&lt;br /&gt;
OK&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;Optional HD Fresh Water Option&amp;lt;/big&amp;gt; &lt;br /&gt;
*Step 1 - Obtain and load hi resolution vector layer&lt;br /&gt;
Make sure that the vector layer and the raster layer you will eventually merge to have the same projection. ** Extent can be different if you use the option below.&lt;br /&gt;
#Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot; or Processing Toolbox: GDAL -&amp;gt; &amp;quot;Vector conversion&amp;quot; -&amp;gt; &amp;quot;Rasterize (vector to raster)&amp;quot;&lt;br /&gt;
# Input layer = Southern-California_water_4326-84&lt;br /&gt;
#Fixed value to burn = 41 (water)&lt;br /&gt;
# Output raster size units = &amp;quot;Georeferenced units&amp;quot;&lt;br /&gt;
#Width/Horizontal resolution = 0.00008309125 (4x the base NLCD resolution )&lt;br /&gt;
#Height/Vertical resolution = 0.00008309125 (4x the base NLCD resolution)&lt;br /&gt;
#&amp;lt;nowiki&amp;gt;** Output extent = Select the raster layer you will eventually merge with as the &amp;quot;Output extent&amp;quot;.&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
#Under &amp;quot;Rasterized&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-water.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
*Step 2 - Reclass hi res, smoothed water to grass&lt;br /&gt;
# Open Raster Calculator&lt;br /&gt;
#Under &amp;quot;Output layer&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hd-nowater.tiff.&lt;br /&gt;
#Copy the following into the &amp;quot;Raster Calculator Expression&amp;quot; box. Where Southern-California_4326-84-hd is the name of your hi resolution, smoothed NLCD that includes the water data.&lt;br /&gt;
&amp;quot;Southern-California_4326-84-hd@1&amp;quot; * (&amp;quot;Southern-California_4326-84-hd@1&amp;quot; != 41) + 26 * (&amp;quot;Southern-California_4326-84-hd@1 = 41&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
    Click on &amp;quot;OK&amp;quot;. When finished you will have a new raster with the water layer changed to grassland. Another choice would be to change it to sand. &lt;br /&gt;
&lt;br /&gt;
*Step 3 - Combine the hi resolution no water raster and the hi resolution water raster.&lt;br /&gt;
# Use Top Menu: &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Miscellaneous&amp;quot; -&amp;gt; &amp;quot;Merge&amp;quot; or Processing Toolbax: GDAL -&amp;gt; Raster Miscellaneous -&amp;gt; Merge&lt;br /&gt;
#Input layers = Select &amp;quot;Southern-California_4326-84-hd-nowater@1&amp;quot; and Southern-California_4326-84-hd-water.tiff&lt;br /&gt;
#Output data type = &amp;quot;byte&amp;quot;.&lt;br /&gt;
# Under &amp;quot;Merged&amp;quot; choose a new filename to save the new raster to. We'll use Southern-California_4326-84-hdwater.tiff.&lt;br /&gt;
&lt;br /&gt;
    Click &amp;quot;Run&amp;quot; to generate the new merged hi resolution raster layer.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Setting up Virtual Planet Builder using docker==&lt;br /&gt;
Generating the scenery uses an OSG tool called Virtual Planet Builder.  Fortunately, there is a docker image so you don't need to build this yourself.  Instead it will run as a container inside docker.&lt;br /&gt;
&lt;br /&gt;
To set this up:&lt;br /&gt;
&lt;br /&gt;
#Install [https://docs.docker.com/get-started/ Docker] on your platform.&lt;br /&gt;
#On your own machine, pull the docker image&lt;br /&gt;
 docker pull flightgear/ws30-vpb-generator:latest&lt;br /&gt;
&lt;br /&gt;
You now have a docker image on your own machine you can run.&lt;br /&gt;
&lt;br /&gt;
Optionally, if you are hitting rate limits:&lt;br /&gt;
#Create an account on https://hub.docker.com/.  (Note that you will need to click on an email verification link before you can log in for the first time)&lt;br /&gt;
#Run the following before the '''docker pull''' command above&lt;br /&gt;
 docker login&lt;br /&gt;
&lt;br /&gt;
==Running the Container==&lt;br /&gt;
To generate terrain you need to run the Virtual Planet Builder tool within the container.&lt;br /&gt;
&lt;br /&gt;
Firstly, get the container running from the directory containing your &amp;lt;code&amp;gt;data&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;output&amp;lt;/code&amp;gt; directories:&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; -it flightgear/ws30-vpb-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
In a Windows environment the following can be used to build in the folder structure of&lt;br /&gt;
&lt;br /&gt;
data&lt;br /&gt;
&lt;br /&gt;
output/vbp&lt;br /&gt;
 docker run --rm --mount &amp;quot;type=bind,source=`pwd`/data,target=/home/flightgear/data,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/SRTM-3,target=/home/flightgear/SRTM-3,readonly&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output,target=/home/flightgear/output&amp;quot; --mount &amp;quot;type=bind,source=`pwd`/output/vpb,target=/home/flightgear/output/vpb&amp;quot; -it flightgear/ws30-vbp-generator:latest /bin/bash&lt;br /&gt;
&lt;br /&gt;
You should now find yourself in a bash shell within your container.  You should see data and output directories which are linked to the directories you created earlier:&lt;br /&gt;
 flightgear@ddcac77f7d5e:~$ ls&lt;br /&gt;
 data  output&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Generating the Terrain==&lt;br /&gt;
The genVPB.py script will generate tiles of terrain from a landclass raster:&lt;br /&gt;
 Usage: genVPB.py &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;input-raster&amp;gt; [--reclass &amp;lt;reclass&amp;gt;] [--coastline &amp;lt;coastline&amp;gt;] [--hgt-dir &amp;lt;hgt-dir&amp;gt;] [--output-dir &amp;lt;output-dir&amp;gt;]&lt;br /&gt;
   &amp;lt;min-lon&amp;gt; &amp;lt;min-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;max-lat&amp;gt; - bounding box of scenery to generated&lt;br /&gt;
   &amp;lt;input-raster&amp;gt;  - Input landclass raster&lt;br /&gt;
   [coastline]     - Optional coastline polygon data (.osm) to clip against.  E.g. from &amp;lt;nowiki&amp;gt;https://osmdata.openstreetmap.de/data/land-polygons.html&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
   [reclass]       - Optional file containing a set of rules for reclassifying the raster similar to r.reclass. See fgmeta/ws30/mappings/&lt;br /&gt;
   [hgt-dir]       - Optional directory containing unzipped NASADEM HGT files. Defaults to '/home/flightgear/data'.&lt;br /&gt;
   [output-dir]    - Optional directory for output scenery. Defaults to '/home/flightgear/output/vpb'&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the Windows/Docker platform you can send the generate tile command directly to osgdem.exe, one tile at a time.&lt;br /&gt;
&lt;br /&gt;
Using the NLCD raster processing convention from above, following is the the final step after creating the raster and entering bash shell with the windows version of &amp;quot;docker run...&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 osgdem --TERRAIN --image-ext png --RGBA --no-interpolate-imagery --disable-error-diffusion --geocentric --no-mip-mapping -t ./data/California-Southern_4326-84-hd-corrected.tiff -d ./SRTM-3/N32W115.hgt -b -115 32 -114 33 --PagedLOD -l 7 --radius-to-max-visible-distance-ratio 3 -o ./output/vpb/w120n30/w115n32/ws_w115n32.osgb&lt;br /&gt;
&lt;br /&gt;
Note: the --image-ext png --RGBA flags are critical to successfully building correctly placed landclasses in the final VPB generated scenery.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
If you prefer to run the scenery generation manually, running the VPB osgdem process is described in more detail here: [[Virtual Planet Builder#Running VPB]].&lt;br /&gt;
&lt;br /&gt;
After doing this you should have an output directory containing files of the form &amp;lt;code&amp;gt;output/vpb/w010n50/w004n50/ws_w004n50.osgb&amp;lt;/code&amp;gt;, plus a host of sub-directories. Each one of these is a 1x1 tile of terrain.  &lt;br /&gt;
&lt;br /&gt;
to leave the container simply type &amp;lt;code&amp;gt;exit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==Creating line features==&lt;br /&gt;
Line features such as roads, railways and rivers are simply stored as a series of lat/lon points in an STG file using a specific STG verb.  We get the data of this from Openstreetmap, and we have some simple scripts to generate the files.&lt;br /&gt;
&lt;br /&gt;
The scripts are already included in the docker image at &amp;lt;code&amp;gt;/home/flightgear/scripts/&amp;lt;/code&amp;gt;.&lt;br /&gt;
===Running the scripts===&lt;br /&gt;
The genroads.py script generates all line features.  Simply set the output directory and the lat/lon box.  Note that the output directory should be a &amp;quot;Terrain&amp;quot; directory.  E.g.&lt;br /&gt;
 ./scripts/genroads.py ./output/Terrain -4 55 -3 56&lt;br /&gt;
&lt;br /&gt;
== Packaging the Scenery==&lt;br /&gt;
Once you have the terrain and line features they should be packaged in a scenery directory in vpb and Terrain sub-directories respectively.  E.g.&lt;br /&gt;
 MyCoolScenery/Terrain&lt;br /&gt;
 MyCoolScenery/vpb&lt;br /&gt;
It is good practise to document the data sources used in scenery generation.  Some source licenses require attribution of the original data source for anything derived, published or distributed.   &lt;br /&gt;
&lt;br /&gt;
To assist in fulfilling these license obligations, you can create a source.xml file in the scenery directory which includes attribution information.  This will then be available from within the simulator under Help-&amp;gt;Scenery Sources, and &amp;lt;u&amp;gt;may&amp;lt;/u&amp;gt; fulfil the attribution requirements of your license.  '''Note that you are responsible for fulfilling any license requirements from the data, not FlightGear'''.  &lt;br /&gt;
&lt;br /&gt;
The format of the file is straightforward:&lt;br /&gt;
 &amp;lt;?xml version=&amp;quot;1.0&amp;quot;?&amp;gt;&lt;br /&gt;
 &amp;lt;PropertyList&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;Corine Land Cover (CLC) 2018, Version 2020_20u1&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;http://web.archive.org/web/20221112175615/https://land.copernicus.eu/pan-european/corine-land-cover/clc2018?tab=metadata%2A&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;GMES Open License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;NASADEM Merged DEM Global 1 arc second V001&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.earthdata.nasa.gov/&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Public Domain&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;name&amp;gt;OpenStreetMap&amp;lt;/name&amp;gt;&lt;br /&gt;
         &amp;lt;nowiki&amp;gt;&amp;lt;link&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;https://www.openstreetmap.org/copyright&amp;lt;/nowiki&amp;gt;&amp;lt;nowiki&amp;gt;&amp;lt;/link&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
         &amp;lt;license&amp;gt;Open Data Commons Open Database License&amp;lt;/license&amp;gt;&lt;br /&gt;
     &amp;lt;nowiki&amp;gt;&amp;lt;/source&amp;gt;&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
 &amp;lt;/PropertyList&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Running FlightGear with the new WS3.0 Terrain==&lt;br /&gt;
To test the new terrain, simply include the appropriate scenery directory (e.g. MyCoolScenery) in in your scenery path and run FlightGear with the &amp;lt;code&amp;gt;--prop:/scenery/use-vpb=true&amp;lt;/code&amp;gt; to enable WS3.0.&lt;/div&gt;</summary>
		<author><name>Stuart</name></author>
	</entry>
</feed>