<?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=Vanosten</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=Vanosten"/>
	<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/Special:Contributions/Vanosten"/>
	<updated>2026-04-15T17:19:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=143366</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=143366"/>
		<updated>2025-12-27T18:48:18Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: not using 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 out 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;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Not Using a Texture ==&lt;br /&gt;
&lt;br /&gt;
As of end of 2025 not using a texture leads to rendering problems in FlightGear Next, which gives either a very blurry/not sharp edges look (when there is no materials definition) or broken looks (e.g. like shattered glass). If you want good results, you have to use texturing. If you do not want to texture the objects, then you are better off continuing to use *.ac files exported from Blender with a material definition than *.gltf files exported from Blender with or without assigned materials.&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Convert_from_AC3D_to_glTF&amp;diff=143365</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=143365"/>
		<updated>2025-12-27T18:39:25Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: &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 out 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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143291</id>
		<title>GlTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143291"/>
		<updated>2025-12-24T06:54:49Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Put hierarchy into export properties&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''glTF''' (derivative short form of '''Graphics Language Transmission Format''' or '''GL Transmission Format''') is a standard file format for three-dimensional scenes and models. A glTF file uses one of two possible file extensions, .gltf (JSON/ASCII) or .glb (binary). See the [https://en.wikipedia.org/wiki/GlTF Wikipedia article] on the subject for more information. In FlightGear glTF can be used in place of the [[AC3D file format]] to load 3D models.&lt;br /&gt;
&lt;br /&gt;
== glTF vs. AC3D ==&lt;br /&gt;
&lt;br /&gt;
glTF does not deprecate the AC3D file format as both can be used interchangeably, although each one has its own advantages and disadvantages. Choosing which one to use for your project will depend on your requirements.&lt;br /&gt;
&lt;br /&gt;
The main advantage of glTF is that PBR materials are handled automatically. glTF files contain PBR material information that is used by FlightGear to avoid messing with [[Effects]] manually like in the case of AC3D files. This allows 3D models to have a consistent look across all software, i.e. what you see in [[Blender]] is exactly what you will see in FlightGear. However, this advantage can also be a disadvantage. The glTF specification is quite specific about how a material is defined, so it's not possible to add custom Effects to glTF models. If your project uses custom shaders or requires special effects that cannot be handled by the standard PBR scheme (albedo/metalness/roughness), then you should be using AC3D files with custom Effects.&lt;br /&gt;
&lt;br /&gt;
== Converting AC3D to glTF ==&lt;br /&gt;
&lt;br /&gt;
Converting AC3D files and related animations is described in [[Howto:Convert from AC3D to glTF]].&lt;br /&gt;
&lt;br /&gt;
== Unsupported Features ==&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/KhronosGroup/glTF/tree/master/specification/2.0 glTF 2.0 specification] is the best resource when it comes to glTF. All parameters and their default values are very well defined. FlightGear tries to adhere to the specification as much as possible, but there are some exceptions:&lt;br /&gt;
&lt;br /&gt;
* Embedded textures are not loaded, so all textures must be saved to external files.&lt;br /&gt;
* All parameters related to animations are ignored. This includes skinning information like joints and weights, as well as the animation keyframes themselves. FlightGear provides its own system for animating objects, see [[Howto:Animate models]].&lt;br /&gt;
* Instanced geometry is not supported.&lt;br /&gt;
* Cameras and punctual lights are not supported.&lt;br /&gt;
* When no material has been specified for a mesh, the glTF spec suggests using a 50% emissive grey material. FlightGear uses a different default material, which is specified in {{fgdata file|Effects/model-pbr.eff}}.&lt;br /&gt;
&lt;br /&gt;
== Usage notes for content developers ==&lt;br /&gt;
&lt;br /&gt;
In XML you can treat glTF models the same way you treat AC3D, with a few exceptions. As described earlier, Effects can't be assigned to glTF models because they use a predefined Effect that implements the material description of the glTF specification. [[Howto:Animate models#Material animation|Material animations]] don't work either for the same reason. If you want to change the material parameters, you should do so in your 3D modelling software of choice (or manually editing the glTF file).&lt;br /&gt;
&lt;br /&gt;
=== Blender ===&lt;br /&gt;
&lt;br /&gt;
The latest versions of Blender support glTF out of the box. See the [https://docs.blender.org/manual/en/5.0/addons/import_export/scene_gltf2.html Blender 5.0 reference documentation] for more information about Blender and glTF.&lt;br /&gt;
&lt;br /&gt;
==== Materials ====&lt;br /&gt;
&lt;br /&gt;
You need to use a Principled BSDF to setup your materials so they can displayed correctly by FlightGear. All textures attached to this node will also be exported correctly.&lt;br /&gt;
&lt;br /&gt;
In almost all situations the ''doubleSided'' property in the glTF materials section should be set to '''false'''. The export logic in Blender is a bit special. Therefore, in Materials -&amp;gt; Viewport Display -&amp;gt; Settings -&amp;gt; Backface Culling you need to set &amp;quot;Camera&amp;quot;, &amp;quot;Shadow&amp;quot; and &amp;quot;Light Probe Volume&amp;quot; to '''On'''.&lt;br /&gt;
&lt;br /&gt;
==== Export to glTF ====&lt;br /&gt;
&lt;br /&gt;
[[File:Blender glTF export menu.png|thumb|Blender glTF exporter menu location.]]&lt;br /&gt;
[[File:Blender glTF exporter example settings.png|thumb|Example settings for exporting a glTF model in Blender.]]&lt;br /&gt;
&lt;br /&gt;
Some important settings for the exporter include:&lt;br /&gt;
&lt;br /&gt;
; Format&lt;br /&gt;
: &amp;lt;tt&amp;gt;glTF Separate (.gltf + .bin + textures)&amp;lt;/tt&amp;gt; has to be selected because FlightGear does not support loading embedded assets.&lt;br /&gt;
; Textures&lt;br /&gt;
: Optional directory where textures will be placed. If none is selected, the textures will be in the same directory as the &amp;lt;tt&amp;gt;.gltf&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
; Include -&amp;gt; Limit to&lt;br /&gt;
: These parameters can be used to select which objects of your Blender scene will be exported.&lt;br /&gt;
; Include -&amp;gt; Data&lt;br /&gt;
: FlightGear does not support glTF cameras or punctual light sources, so you can disable everything here.&lt;br /&gt;
; Transform -&amp;gt; +Y up&lt;br /&gt;
: Make sure to keep this '''OFF'''. Blender uses a +Z up convention like FlightGear, so we do not adhere to the glTF standard (+Y up).&lt;br /&gt;
; Apply Modifiers&lt;br /&gt;
: If you have any unapplied modifiers (like a Subdivision Surface Modifier), they will applied before exporting.&lt;br /&gt;
; Data -&amp;gt; Mesh -&amp;gt; UVs&lt;br /&gt;
: Whether to export UV texture coordinates or not. You should keep this '''ON'''.&lt;br /&gt;
; Data -&amp;gt; Mesh -&amp;gt; Normals&lt;br /&gt;
: Whether to export normals or not. You should keep this '''ON''' as disabling them will force FlightGear to calculate them at runtime.&lt;br /&gt;
; Data -&amp;gt; Mesh -&amp;gt; Tangents&lt;br /&gt;
: Whether to export the tangent vectors or not. You should keep this '''OFF''' as FlightGear will calculate the tangent and binormal vectors at runtime anyway.&lt;br /&gt;
; Data -&amp;gt; Mesh -&amp;gt; Attributes&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Vertex Colors&lt;br /&gt;
: Whether to export the vertex colors or not. FlightGear will use the PBR information of the Principled BSDF to light the model, so vertex colors will be ignored by most Compositor pipelines. You can set this '''None''' in most cases.&lt;br /&gt;
; Materials&lt;br /&gt;
: Whether to export materials or not. You should keep this on &amp;lt;tt&amp;gt;Export&amp;lt;/tt&amp;gt;.&lt;br /&gt;
; Images&lt;br /&gt;
: &amp;lt;tt&amp;gt;Automatic&amp;lt;/tt&amp;gt; will automatically choose between PNG and JPEG when saving textures. &amp;lt;tt&amp;gt;JPEG format (.jpg)&amp;lt;/tt&amp;gt; will force saving as JPEG for every texture. In general JPEG provides a decent save in storage space at the cost of a negligible quality loss, so you should be using JPEG whenever possible (transparency requires PNG). Keep in mind that JPEG textures are lossy though, so you might want to keep a lossless copy for development purposes in PNG or XCF format.&lt;br /&gt;
; PBR Extensions&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Shape Keys&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Skinning&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Lighting&lt;br /&gt;
: Does not matter what you choose here as FlightGear completely ignores glTF lights.&lt;br /&gt;
; Animation&lt;br /&gt;
: Disable everything here as FlightGear completely ignores glTF animations.&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
&lt;br /&gt;
* [[HDR Pipeline]]&lt;br /&gt;
* [[AC3D file format]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143290</id>
		<title>GlTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143290"/>
		<updated>2025-12-24T06:18:44Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: doubleSided and backface culling&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''glTF''' (derivative short form of '''Graphics Language Transmission Format''' or '''GL Transmission Format''') is a standard file format for three-dimensional scenes and models. A glTF file uses one of two possible file extensions, .gltf (JSON/ASCII) or .glb (binary). See the [https://en.wikipedia.org/wiki/GlTF Wikipedia article] on the subject for more information. In FlightGear glTF can be used in place of the [[AC3D file format]] to load 3D models.&lt;br /&gt;
&lt;br /&gt;
== glTF vs. AC3D ==&lt;br /&gt;
&lt;br /&gt;
glTF does not deprecate the AC3D file format as both can be used interchangeably, although each one has its own advantages and disadvantages. Choosing which one to use for your project will depend on your requirements.&lt;br /&gt;
&lt;br /&gt;
The main advantage of glTF is that PBR materials are handled automatically. glTF files contain PBR material information that is used by FlightGear to avoid messing with [[Effects]] manually like in the case of AC3D files. This allows 3D models to have a consistent look across all software, i.e. what you see in [[Blender]] is exactly what you will see in FlightGear. However, this advantage can also be a disadvantage. The glTF specification is quite specific about how a material is defined, so it's not possible to add custom Effects to glTF models. If your project uses custom shaders or requires special effects that cannot be handled by the standard PBR scheme (albedo/metalness/roughness), then you should be using AC3D files with custom Effects.&lt;br /&gt;
&lt;br /&gt;
== Converting AC3D to glTF ==&lt;br /&gt;
&lt;br /&gt;
Converting AC3D files and related animations is described in [[Howto:Convert from AC3D to glTF]].&lt;br /&gt;
&lt;br /&gt;
== Unsupported Features ==&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/KhronosGroup/glTF/tree/master/specification/2.0 glTF 2.0 specification] is the best resource when it comes to glTF. All parameters and their default values are very well defined. FlightGear tries to adhere to the specification as much as possible, but there are some exceptions:&lt;br /&gt;
&lt;br /&gt;
* Embedded textures are not loaded, so all textures must be saved to external files.&lt;br /&gt;
* All parameters related to animations are ignored. This includes skinning information like joints and weights, as well as the animation keyframes themselves. FlightGear provides its own system for animating objects, see [[Howto:Animate models]].&lt;br /&gt;
* Instanced geometry is not supported.&lt;br /&gt;
* Cameras and punctual lights are not supported.&lt;br /&gt;
* When no material has been specified for a mesh, the glTF spec suggests using a 50% emissive grey material. FlightGear uses a different default material, which is specified in {{fgdata file|Effects/model-pbr.eff}}.&lt;br /&gt;
&lt;br /&gt;
== Usage notes for content developers ==&lt;br /&gt;
&lt;br /&gt;
In XML you can treat glTF models the same way you treat AC3D, with a few exceptions. As described earlier, Effects can't be assigned to glTF models because they use a predefined Effect that implements the material description of the glTF specification. [[Howto:Animate models#Material animation|Material animations]] don't work either for the same reason. If you want to change the material parameters, you should do so in your 3D modelling software of choice (or manually editing the glTF file).&lt;br /&gt;
&lt;br /&gt;
=== Blender ===&lt;br /&gt;
&lt;br /&gt;
The latest versions of Blender support glTF out of the box. See the [https://docs.blender.org/manual/en/5.0/addons/import_export/scene_gltf2.html Blender 5.0 reference documentation] for more information about Blender and glTF.&lt;br /&gt;
&lt;br /&gt;
==== Materials ====&lt;br /&gt;
&lt;br /&gt;
You need to use a Principled BSDF to setup your materials so they can displayed correctly by FlightGear. All textures attached to this node will also be exported correctly.&lt;br /&gt;
&lt;br /&gt;
In almost all situations the ''doubleSided'' property in the glTF materials section should be set to '''false'''. The export logic in Blender is a bit special. Therefore, in Materials -&amp;gt; Viewport Display -&amp;gt; Settings -&amp;gt; Backface Culling you need to set &amp;quot;Camera&amp;quot;, &amp;quot;Shadow&amp;quot; and &amp;quot;Light Probe Volume&amp;quot; to '''On'''.&lt;br /&gt;
&lt;br /&gt;
==== Export to glTF ====&lt;br /&gt;
&lt;br /&gt;
[[File:Blender glTF export menu.png|thumb|Blender glTF exporter menu location.]]&lt;br /&gt;
[[File:Blender glTF exporter example settings.png|thumb|Example settings for exporting a glTF model in Blender.]]&lt;br /&gt;
&lt;br /&gt;
Some important settings for the exporter include:&lt;br /&gt;
&lt;br /&gt;
; Format&lt;br /&gt;
: &amp;lt;tt&amp;gt;glTF Separate (.gltf + .bin + textures)&amp;lt;/tt&amp;gt; has to be selected because FlightGear does not support loading embedded assets.&lt;br /&gt;
; Textures&lt;br /&gt;
: Optional directory where textures will be placed. If none is selected, the textures will be in the same directory as the &amp;lt;tt&amp;gt;.gltf&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
; Limit to&lt;br /&gt;
: These parameters can be used to select which objects of your Blender scene will be exported.&lt;br /&gt;
; Data&lt;br /&gt;
: FlightGear does not support glTF cameras or punctual light sources, so you can disable everything here.&lt;br /&gt;
; +Y up&lt;br /&gt;
: Make sure to keep this '''OFF'''. Blender uses a +Z up convention like FlightGear, so we do not adhere to the glTF standard (+Y up).&lt;br /&gt;
; Apply Modifiers&lt;br /&gt;
: If you have any unapplied modifiers (like a Subdivision Surface Modifier), they will applied before exporting.&lt;br /&gt;
; UVs&lt;br /&gt;
: Whether to export UV texture coordinates or not. You should keep this '''ON'''.&lt;br /&gt;
; Normals&lt;br /&gt;
: Whether to export normals or not. You should keep this '''ON''' as disabling them will force FlightGear to calculate them at runtime.&lt;br /&gt;
; Tangents&lt;br /&gt;
: Whether to export the tangent vectors or not. You should keep this '''OFF''' as FlightGear will calculate the tangent and binormal vectors at runtime anyway.&lt;br /&gt;
; Vertex Colors&lt;br /&gt;
: Whether to export the vertex colors or not. FlightGear will use the PBR information of the Principled BSDF to light the model, so vertex colors will be ignored by most Compositor pipelines. You can set this '''None''' in most cases.&lt;br /&gt;
; Attributes&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Materials&lt;br /&gt;
: Whether to export materials or not. You should keep this on &amp;lt;tt&amp;gt;Export&amp;lt;/tt&amp;gt;.&lt;br /&gt;
; Images&lt;br /&gt;
: &amp;lt;tt&amp;gt;Automatic&amp;lt;/tt&amp;gt; will automatically choose between PNG and JPEG when saving textures. &amp;lt;tt&amp;gt;JPEG format (.jpg)&amp;lt;/tt&amp;gt; will force saving as JPEG for every texture. In general JPEG provides a decent save in storage space at the cost of a negligible quality loss, so you should be using JPEG whenever possible (transparency requires PNG). Keep in mind that JPEG textures are lossy though, so you might want to keep a lossless copy for development purposes in PNG or XCF format.&lt;br /&gt;
; PBR Extensions&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Lighting&lt;br /&gt;
: Does not matter what you choose here as FlightGear completely ignores glTF lights.&lt;br /&gt;
; Animation&lt;br /&gt;
: Disable everything here as FlightGear completely ignores glTF animations.&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
&lt;br /&gt;
* [[HDR Pipeline]]&lt;br /&gt;
* [[AC3D file format]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143289</id>
		<title>GlTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143289"/>
		<updated>2025-12-24T06:11:29Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Export to glTF */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''glTF''' (derivative short form of '''Graphics Language Transmission Format''' or '''GL Transmission Format''') is a standard file format for three-dimensional scenes and models. A glTF file uses one of two possible file extensions, .gltf (JSON/ASCII) or .glb (binary). See the [https://en.wikipedia.org/wiki/GlTF Wikipedia article] on the subject for more information. In FlightGear glTF can be used in place of the [[AC3D file format]] to load 3D models.&lt;br /&gt;
&lt;br /&gt;
== glTF vs. AC3D ==&lt;br /&gt;
&lt;br /&gt;
glTF does not deprecate the AC3D file format as both can be used interchangeably, although each one has its own advantages and disadvantages. Choosing which one to use for your project will depend on your requirements.&lt;br /&gt;
&lt;br /&gt;
The main advantage of glTF is that PBR materials are handled automatically. glTF files contain PBR material information that is used by FlightGear to avoid messing with [[Effects]] manually like in the case of AC3D files. This allows 3D models to have a consistent look across all software, i.e. what you see in [[Blender]] is exactly what you will see in FlightGear. However, this advantage can also be a disadvantage. The glTF specification is quite specific about how a material is defined, so it's not possible to add custom Effects to glTF models. If your project uses custom shaders or requires special effects that cannot be handled by the standard PBR scheme (albedo/metalness/roughness), then you should be using AC3D files with custom Effects.&lt;br /&gt;
&lt;br /&gt;
== Converting AC3D to glTF ==&lt;br /&gt;
&lt;br /&gt;
Converting AC3D files and related animations is described in [[Howto:Convert from AC3D to glTF]].&lt;br /&gt;
&lt;br /&gt;
== Unsupported Features ==&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/KhronosGroup/glTF/tree/master/specification/2.0 glTF 2.0 specification] is the best resource when it comes to glTF. All parameters and their default values are very well defined. FlightGear tries to adhere to the specification as much as possible, but there are some exceptions:&lt;br /&gt;
&lt;br /&gt;
* Embedded textures are not loaded, so all textures must be saved to external files.&lt;br /&gt;
* All parameters related to animations are ignored. This includes skinning information like joints and weights, as well as the animation keyframes themselves. FlightGear provides its own system for animating objects, see [[Howto:Animate models]].&lt;br /&gt;
* Instanced geometry is not supported.&lt;br /&gt;
* Cameras and punctual lights are not supported.&lt;br /&gt;
* When no material has been specified for a mesh, the glTF spec suggests using a 50% emissive grey material. FlightGear uses a different default material, which is specified in {{fgdata file|Effects/model-pbr.eff}}.&lt;br /&gt;
&lt;br /&gt;
== Usage notes for content developers ==&lt;br /&gt;
&lt;br /&gt;
In XML you can treat glTF models the same way you treat AC3D, with a few exceptions. As described earlier, Effects can't be assigned to glTF models because they use a predefined Effect that implements the material description of the glTF specification. [[Howto:Animate models#Material animation|Material animations]] don't work either for the same reason. If you want to change the material parameters, you should do so in your 3D modelling software of choice (or manually editing the glTF file).&lt;br /&gt;
&lt;br /&gt;
=== Blender ===&lt;br /&gt;
&lt;br /&gt;
[[File:Blender glTF export menu.png|thumb|Blender glTF exporter menu location.]]&lt;br /&gt;
[[File:Blender glTF exporter example settings.png|thumb|Example settings for exporting a glTF model in Blender.]]&lt;br /&gt;
&lt;br /&gt;
The latest versions of Blender support glTF out of the box. See the [https://docs.blender.org/manual/en/5.0/addons/import_export/scene_gltf2.html Blender 5.0 reference documentation] for more information about Blender and glTF.&lt;br /&gt;
&lt;br /&gt;
==== Materials ====&lt;br /&gt;
&lt;br /&gt;
You need to use a Principled BSDF to setup your materials so they can displayed correctly by FlightGear. All textures attached to this node will also be exported correctly. &lt;br /&gt;
&lt;br /&gt;
==== Export to glTF ====&lt;br /&gt;
&lt;br /&gt;
Some important settings for the exporter include:&lt;br /&gt;
&lt;br /&gt;
; Format&lt;br /&gt;
: &amp;lt;tt&amp;gt;glTF Separate (.gltf + .bin + textures)&amp;lt;/tt&amp;gt; has to be selected because FlightGear does not support loading embedded assets.&lt;br /&gt;
; Textures&lt;br /&gt;
: Optional directory where textures will be placed. If none is selected, the textures will be in the same directory as the &amp;lt;tt&amp;gt;.gltf&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
; Limit to&lt;br /&gt;
: These parameters can be used to select which objects of your Blender scene will be exported.&lt;br /&gt;
; Data&lt;br /&gt;
: FlightGear does not support glTF cameras or punctual light sources, so you can disable everything here.&lt;br /&gt;
; +Y up&lt;br /&gt;
: Make sure to keep this '''OFF'''. Blender uses a +Z up convention like FlightGear, so we do not adhere to the glTF standard (+Y up).&lt;br /&gt;
; Apply Modifiers&lt;br /&gt;
: If you have any unapplied modifiers (like a Subdivision Surface Modifier), they will applied before exporting.&lt;br /&gt;
; UVs&lt;br /&gt;
: Whether to export UV texture coordinates or not. You should keep this '''ON'''.&lt;br /&gt;
; Normals&lt;br /&gt;
: Whether to export normals or not. You should keep this '''ON''' as disabling them will force FlightGear to calculate them at runtime.&lt;br /&gt;
; Tangents&lt;br /&gt;
: Whether to export the tangent vectors or not. You should keep this '''OFF''' as FlightGear will calculate the tangent and binormal vectors at runtime anyway.&lt;br /&gt;
; Vertex Colors&lt;br /&gt;
: Whether to export the vertex colors or not. FlightGear will use the PBR information of the Principled BSDF to light the model, so vertex colors will be ignored by most Compositor pipelines. You can set this '''None''' in most cases.&lt;br /&gt;
; Attributes&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Materials&lt;br /&gt;
: Whether to export materials or not. You should keep this on &amp;lt;tt&amp;gt;Export&amp;lt;/tt&amp;gt;.&lt;br /&gt;
; Images&lt;br /&gt;
: &amp;lt;tt&amp;gt;Automatic&amp;lt;/tt&amp;gt; will automatically choose between PNG and JPEG when saving textures. &amp;lt;tt&amp;gt;JPEG format (.jpg)&amp;lt;/tt&amp;gt; will force saving as JPEG for every texture. In general JPEG provides a decent save in storage space at the cost of a negligible quality loss, so you should be using JPEG whenever possible (transparency requires PNG). Keep in mind that JPEG textures are lossy though, so you might want to keep a lossless copy for development purposes in PNG or XCF format.&lt;br /&gt;
; PBR Extensions&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Lighting&lt;br /&gt;
: Does not matter what you choose here as FlightGear completely ignores glTF lights.&lt;br /&gt;
; Animation&lt;br /&gt;
: Disable everything here as FlightGear completely ignores glTF animations.&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
&lt;br /&gt;
* [[HDR Pipeline]]&lt;br /&gt;
* [[AC3D file format]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143288</id>
		<title>GlTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143288"/>
		<updated>2025-12-24T06:08:16Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Prepare a materials section for further tricks&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''glTF''' (derivative short form of '''Graphics Language Transmission Format''' or '''GL Transmission Format''') is a standard file format for three-dimensional scenes and models. A glTF file uses one of two possible file extensions, .gltf (JSON/ASCII) or .glb (binary). See the [https://en.wikipedia.org/wiki/GlTF Wikipedia article] on the subject for more information. In FlightGear glTF can be used in place of the [[AC3D file format]] to load 3D models.&lt;br /&gt;
&lt;br /&gt;
== glTF vs. AC3D ==&lt;br /&gt;
&lt;br /&gt;
glTF does not deprecate the AC3D file format as both can be used interchangeably, although each one has its own advantages and disadvantages. Choosing which one to use for your project will depend on your requirements.&lt;br /&gt;
&lt;br /&gt;
The main advantage of glTF is that PBR materials are handled automatically. glTF files contain PBR material information that is used by FlightGear to avoid messing with [[Effects]] manually like in the case of AC3D files. This allows 3D models to have a consistent look across all software, i.e. what you see in [[Blender]] is exactly what you will see in FlightGear. However, this advantage can also be a disadvantage. The glTF specification is quite specific about how a material is defined, so it's not possible to add custom Effects to glTF models. If your project uses custom shaders or requires special effects that cannot be handled by the standard PBR scheme (albedo/metalness/roughness), then you should be using AC3D files with custom Effects.&lt;br /&gt;
&lt;br /&gt;
== Converting AC3D to glTF ==&lt;br /&gt;
&lt;br /&gt;
Converting AC3D files and related animations is described in [[Howto:Convert from AC3D to glTF]].&lt;br /&gt;
&lt;br /&gt;
== Unsupported Features ==&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/KhronosGroup/glTF/tree/master/specification/2.0 glTF 2.0 specification] is the best resource when it comes to glTF. All parameters and their default values are very well defined. FlightGear tries to adhere to the specification as much as possible, but there are some exceptions:&lt;br /&gt;
&lt;br /&gt;
* Embedded textures are not loaded, so all textures must be saved to external files.&lt;br /&gt;
* All parameters related to animations are ignored. This includes skinning information like joints and weights, as well as the animation keyframes themselves. FlightGear provides its own system for animating objects, see [[Howto:Animate models]].&lt;br /&gt;
* Instanced geometry is not supported.&lt;br /&gt;
* Cameras and punctual lights are not supported.&lt;br /&gt;
* When no material has been specified for a mesh, the glTF spec suggests using a 50% emissive grey material. FlightGear uses a different default material, which is specified in {{fgdata file|Effects/model-pbr.eff}}.&lt;br /&gt;
&lt;br /&gt;
== Usage notes for content developers ==&lt;br /&gt;
&lt;br /&gt;
In XML you can treat glTF models the same way you treat AC3D, with a few exceptions. As described earlier, Effects can't be assigned to glTF models because they use a predefined Effect that implements the material description of the glTF specification. [[Howto:Animate models#Material animation|Material animations]] don't work either for the same reason. If you want to change the material parameters, you should do so in your 3D modelling software of choice (or manually editing the glTF file).&lt;br /&gt;
&lt;br /&gt;
=== Blender ===&lt;br /&gt;
&lt;br /&gt;
[[File:Blender glTF export menu.png|thumb|Blender glTF exporter menu location.]]&lt;br /&gt;
[[File:Blender glTF exporter example settings.png|thumb|Example settings for exporting a glTF model in Blender.]]&lt;br /&gt;
&lt;br /&gt;
The latest versions of Blender support glTF out of the box. See the [https://docs.blender.org/manual/en/5.0/addons/import_export/scene_gltf2.html Blender 5.0 reference documentation] for more information about Blender and glTF.&lt;br /&gt;
&lt;br /&gt;
==== Materials ====&lt;br /&gt;
&lt;br /&gt;
You need to use a Principled BSDF to setup your materials so they can displayed correctly by FlightGear. All textures attached to this node will also be exported correctly. &lt;br /&gt;
&lt;br /&gt;
==== Export to glTF ====&lt;br /&gt;
&lt;br /&gt;
Some important settings for the exporter include:&lt;br /&gt;
&lt;br /&gt;
; Format&lt;br /&gt;
: &amp;lt;tt&amp;gt;glTF Separate (.gltf + .bin + textures)&amp;lt;/tt&amp;gt; has to be selected because FlightGear does not support loading embedded assets.&lt;br /&gt;
; Textures&lt;br /&gt;
: Optional directory where textures will be placed. If none is selected, the textures will be in the same directory as the &amp;lt;tt&amp;gt;.gltf&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
; Limit to&lt;br /&gt;
: These parameters can be used to select which objects of your Blender scene will be exported.&lt;br /&gt;
; Data&lt;br /&gt;
: FlightGear does not support glTF cameras or punctual light sources, so you can disable eveything here.&lt;br /&gt;
; +Y up&lt;br /&gt;
: Make sure to keep this '''OFF'''. Blender uses a +Z up convention like FlightGear, so we do not adhere to the glTF standard (+Y up).&lt;br /&gt;
; Apply Modifiers&lt;br /&gt;
: If you have any unapplied modifiers (like a Subdivision Surface Modifier), they will applied before exporting.&lt;br /&gt;
; UVs&lt;br /&gt;
: Whether to export UV texture coordinates or not. You should keep this '''ON'''.&lt;br /&gt;
; Normals&lt;br /&gt;
: Whether to export normals or not. You should keep this '''ON''' as disabling them will force FlightGear to calculate them at runtime.&lt;br /&gt;
; Tangents&lt;br /&gt;
: Whether to export the tangent vectors or not. You should keep this '''OFF''' as FlightGear will calculate the tangent and binormal vectors at runtime anyway.&lt;br /&gt;
; Vertex Colors&lt;br /&gt;
: Whether to export the vertex colors or not. FlightGear will use the PBR information of the Principled BSDF to light the model, so vertex colors will be ignored by most Compositor pipelines. You can keep this '''OFF''' in most cases.&lt;br /&gt;
; Attributes&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Materials&lt;br /&gt;
: Whether to export materials or not. You should keep this on &amp;lt;tt&amp;gt;Export&amp;lt;/tt&amp;gt;.&lt;br /&gt;
; Images&lt;br /&gt;
: &amp;lt;tt&amp;gt;Automatic&amp;lt;/tt&amp;gt; will automatically choose between PNG and JPEG when saving textures. &amp;lt;tt&amp;gt;JPEG format (.jpg)&amp;lt;/tt&amp;gt; will force saving as JPEG for every texture. In general JPEG provides a decent save in storage space at the cost of a negligible quality loss, so you should be using JPEG whenever possible (transparency requires PNG). Keep in mind that JPEG textures are lossy though, so you might want to keep a lossless copy for development purposes in PNG or XCF format.&lt;br /&gt;
; PBR Extensions&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Lighting&lt;br /&gt;
: Does not matter what you choose here as FlightGear completely ignores glTF lights.&lt;br /&gt;
; Animation&lt;br /&gt;
: Disable everything here as FlightGear completely ignores glTF animations.&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
&lt;br /&gt;
* [[HDR Pipeline]]&lt;br /&gt;
* [[AC3D file format]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143287</id>
		<title>GlTF</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=GlTF&amp;diff=143287"/>
		<updated>2025-12-24T05:48:04Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Pointer to the howto convert AC3D to glTF&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''glTF''' (derivative short form of '''Graphics Language Transmission Format''' or '''GL Transmission Format''') is a standard file format for three-dimensional scenes and models. A glTF file uses one of two possible file extensions, .gltf (JSON/ASCII) or .glb (binary). See the [https://en.wikipedia.org/wiki/GlTF Wikipedia article] on the subject for more information. In FlightGear glTF can be used in place of the [[AC3D file format]] to load 3D models.&lt;br /&gt;
&lt;br /&gt;
== glTF vs. AC3D ==&lt;br /&gt;
&lt;br /&gt;
glTF does not deprecate the AC3D file format as both can be used interchangeably, although each one has its own advantages and disadvantages. Choosing which one to use for your project will depend on your requirements.&lt;br /&gt;
&lt;br /&gt;
The main advantage of glTF is that PBR materials are handled automatically. glTF files contain PBR material information that is used by FlightGear to avoid messing with [[Effects]] manually like in the case of AC3D files. This allows 3D models to have a consistent look across all software, i.e. what you see in [[Blender]] is exactly what you will see in FlightGear. However, this advantage can also be a disadvantage. The glTF specification is quite specific about how a material is defined, so it's not possible to add custom Effects to glTF models. If your project uses custom shaders or requires special effects that cannot be handled by the standard PBR scheme (albedo/metalness/roughness), then you should be using AC3D files with custom Effects.&lt;br /&gt;
&lt;br /&gt;
== Converting AC3D to glTF ==&lt;br /&gt;
&lt;br /&gt;
Converting AC3D files and related animations is described in [[Howto:Convert from AC3D to glTF]].&lt;br /&gt;
&lt;br /&gt;
== Unsupported Features ==&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/KhronosGroup/glTF/tree/master/specification/2.0 glTF 2.0 specification] is the best resource when it comes to glTF. All parameters and their default values are very well defined. FlightGear tries to adhere to the specification as much as possible, but there are some exceptions:&lt;br /&gt;
&lt;br /&gt;
* Embedded textures are not loaded, so all textures must be saved to external files.&lt;br /&gt;
* All parameters related to animations are ignored. This includes skinning information like joints and weights, as well as the animation keyframes themselves. FlightGear provides its own system for animating objects, see [[Howto:Animate models]].&lt;br /&gt;
* Instanced geometry is not supported.&lt;br /&gt;
* Cameras and punctual lights are not supported.&lt;br /&gt;
* When no material has been specified for a mesh, the glTF spec suggests using a 50% emissive grey material. FlightGear uses a different default material, which is specified in {{fgdata file|Effects/model-pbr.eff}}.&lt;br /&gt;
&lt;br /&gt;
== Usage notes for content developers ==&lt;br /&gt;
&lt;br /&gt;
In XML you can treat glTF models the same way you treat AC3D, with a few exceptions. As described earlier, Effects can't be assigned to glTF models because they use a predefined Effect that implements the material description of the glTF specification. [[Howto:Animate models#Material animation|Material animations]] don't work either for the same reason. If you want to change the material parameters, you should do so in your 3D modelling software of choice (or manually editing the glTF file).&lt;br /&gt;
&lt;br /&gt;
=== Blender ===&lt;br /&gt;
&lt;br /&gt;
[[File:Blender glTF export menu.png|thumb|Blender glTF exporter menu location.]]&lt;br /&gt;
[[File:Blender glTF exporter example settings.png|thumb|Example settings for exporting a glTF model in Blender.]]&lt;br /&gt;
&lt;br /&gt;
The latest versions of Blender support glTF out of the box. You need to use a Principled BSDF to setup your materials so they can displayed correctly by FlightGear. All textures attached to this node will also be exported correctly. See the [https://docs.blender.org/manual/en/2.80/addons/io_scene_gltf2.html reference documentation] in the Blender manual for more information about Blender and glTF.&lt;br /&gt;
&lt;br /&gt;
Some important settings for the exporter include:&lt;br /&gt;
&lt;br /&gt;
; Format&lt;br /&gt;
: &amp;lt;tt&amp;gt;glTF Separate (.gltf + .bin + textures)&amp;lt;/tt&amp;gt; has to be selected because FlightGear does not support loading embedded assets.&lt;br /&gt;
; Textures&lt;br /&gt;
: Optional directory where textures will be placed. If none is selected, the textures will be in the same directory as the &amp;lt;tt&amp;gt;.gltf&amp;lt;/tt&amp;gt; file.&lt;br /&gt;
; Limit to&lt;br /&gt;
: These parameters can be used to select which objects of your Blender scene will be exported.&lt;br /&gt;
; Data&lt;br /&gt;
: FlightGear does not support glTF cameras or punctual light sources, so you can disable eveything here.&lt;br /&gt;
; +Y up&lt;br /&gt;
: Make sure to keep this '''OFF'''. Blender uses a +Z up convention like FlightGear, so we do not adhere to the glTF standard (+Y up).&lt;br /&gt;
; Apply Modifiers&lt;br /&gt;
: If you have any unapplied modifiers (like a Subdivision Surface Modifier), they will applied before exporting.&lt;br /&gt;
; UVs&lt;br /&gt;
: Whether to export UV texture coordinates or not. You should keep this '''ON'''.&lt;br /&gt;
; Normals&lt;br /&gt;
: Whether to export normals or not. You should keep this '''ON''' as disabling them will force FlightGear to calculate them at runtime.&lt;br /&gt;
; Tangents&lt;br /&gt;
: Whether to export the tangent vectors or not. You should keep this '''OFF''' as FlightGear will calculate the tangent and binormal vectors at runtime anyway.&lt;br /&gt;
; Vertex Colors&lt;br /&gt;
: Whether to export the vertex colors or not. FlightGear will use the PBR information of the Principled BSDF to light the model, so vertex colors will be ignored by most Compositor pipelines. You can keep this '''OFF''' in most cases.&lt;br /&gt;
; Attributes&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Materials&lt;br /&gt;
: Whether to export materials or not. You should keep this on &amp;lt;tt&amp;gt;Export&amp;lt;/tt&amp;gt;.&lt;br /&gt;
; Images&lt;br /&gt;
: &amp;lt;tt&amp;gt;Automatic&amp;lt;/tt&amp;gt; will automatically choose between PNG and JPEG when saving textures. &amp;lt;tt&amp;gt;JPEG format (.jpg)&amp;lt;/tt&amp;gt; will force saving as JPEG for every texture. In general JPEG provides a decent save in storage space at the cost of a negligible quality loss, so you should be using JPEG whenever possible (transparency requires PNG). Keep in mind that JPEG textures are lossy though, so you might want to keep a lossless copy for development purposes in PNG or XCF format.&lt;br /&gt;
; PBR Extensions&lt;br /&gt;
: You can keep this '''OFF'''.&lt;br /&gt;
; Lighting&lt;br /&gt;
: Does not matter what you choose here as FlightGear completely ignores glTF lights.&lt;br /&gt;
; Animation&lt;br /&gt;
: Disable everything here as FlightGear completely ignores glTF animations.&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
&lt;br /&gt;
* [[HDR Pipeline]]&lt;br /&gt;
* [[AC3D file format]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Develop_an_aircraft_transponder_in_Nasal&amp;diff=142222</id>
		<title>Howto:Develop an aircraft transponder in Nasal</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Howto:Develop_an_aircraft_transponder_in_Nasal&amp;diff=142222"/>
		<updated>2025-08-03T10:59:55Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Remove link to http://www.airsport-corp.com/modec.htm, which does not lead to a useful destination&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Stub}}&lt;br /&gt;
&lt;br /&gt;
Status: Planning&lt;br /&gt;
&lt;br /&gt;
Last updated: 12/2010&lt;br /&gt;
&lt;br /&gt;
Authors: Algernon, Hooray&lt;br /&gt;
&lt;br /&gt;
References: {{forum link|t=6395|text=Transponder}} thread (FlightGear forum).&lt;br /&gt;
	&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This tutorial will document all the steps involved in developing a multiplayer-enabled aircraft transponder system in [[Nasal]], FlightGear's scripting language.&lt;br /&gt;
&lt;br /&gt;
This tutorial involves processing multiplayer properties under /ai/models/multiplayer - you may want to refer to [[Howto: Working with AI and MP properties]] for an introduction.&lt;br /&gt;
&lt;br /&gt;
* http://en.wikipedia.org/wiki/Transponder_%28aviation%29&lt;br /&gt;
&lt;br /&gt;
[[Category:Multiplayer]]&lt;br /&gt;
[[Category:Nasal howto|Transponder, Develop an aircraft in Nasal]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Opentrack&amp;diff=142171</id>
		<title>Opentrack</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Opentrack&amp;diff=142171"/>
		<updated>2025-07-24T08:40:03Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Running with  Neuralnet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase title}}&lt;br /&gt;
{{Infobox Software&lt;br /&gt;
| title                  = opentrack&lt;br /&gt;
| logo                   = &lt;br /&gt;
| image                  = Opentrack_screenshot.png&lt;br /&gt;
| alt                    = The opentrack interface&lt;br /&gt;
| writtenin              = C/C++&lt;br /&gt;
| os                     = Cross-platform&lt;br /&gt;
| developmentstatus      = Active&lt;br /&gt;
| license                = Most all code is under the ICS license&lt;br /&gt;
| website                = https://github.com/opentrack/opentrack&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/opentrack/opentrack '''opentrack'''] is a head-tracking program with built-in support for the [[Interfacing_FlightGear|FlightGear interface]], allowing head tracking data to be sent directly as input data to FlightGear. Licensed as open-source software, opentrack has its roots in the [[FaceTrackNoIR]] project, and maintains many of the projects ideas. &lt;br /&gt;
&lt;br /&gt;
== Installation  ==&lt;br /&gt;
=== Compiling for Linux ===&lt;br /&gt;
Linux users may be disappointed to know that no binaries are provided for opentrack. Luckily, compiling opentrack is a fairly mild process.&lt;br /&gt;
&lt;br /&gt;
The following dependencies are for '''Debian-based''' systems, however it should give users of other distros a rough idea of what they will need to hunt for in their own package manager. Users of other distributions are encouraged to expand upon this guide.&lt;br /&gt;
&lt;br /&gt;
==== Dependencies ====&lt;br /&gt;
* {{code|cmake}}&lt;br /&gt;
* {{code|git}}&lt;br /&gt;
* {{code|qttools5-dev}}&lt;br /&gt;
* {{code|qtbase5-private-dev}}&lt;br /&gt;
* {{code|libprocps-dev}}&lt;br /&gt;
* {{code|libopencv-dev}}&lt;br /&gt;
&lt;br /&gt;
If you are on Ubuntu 24.04 or higher and are building OpenTrack 2024.1.1, then you will need newer dependencies:&lt;br /&gt;
* {{code|cmake}}&lt;br /&gt;
* {{code|git}}&lt;br /&gt;
* {{code|qttools6-dev}}&lt;br /&gt;
* {{code|qtbase6-private-dev}}&lt;br /&gt;
* {{code|libproc2-dev}} on recent Ubuntu&lt;br /&gt;
* {{code|libopencv-dev}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|While Opentrack will build without OpenCV, it will only compile with a very minimal subset of its functionality, making it of little use to the average user who does not have very specific usage requirements.}}&lt;br /&gt;
&lt;br /&gt;
==== Building Default====&lt;br /&gt;
Compiling the project is the same as with any cmake project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
git clone https://github.com/opentrack/opentrack&lt;br /&gt;
cd opentrack/&lt;br /&gt;
cmake .&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The resulting build output will be placed in the {{code|install/}} directory. It will not 'install' itself anywhere outside of the current directory.}}&lt;br /&gt;
&lt;br /&gt;
==== Building with Neuralnet====&lt;br /&gt;
The Neuralnet Tracker uses a webcam and will interpret the position of your head automatically. The instructions are based on https://forums.x-plane.org/forums/topic/310414-howto-headtracking-aitrack-neuralnet-opentrack/ and assume you are user &amp;quot;pingu&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
First create a directory, where your compiled stuff will be:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
cd /home/pingu&lt;br /&gt;
mkdir bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then download onnxruntime-linux-x64-1.17.0.tgz from https://github.com/microsoft/onnxruntime/releases/tag/v1.17.0 and extract it into /home/pingu/bin.&lt;br /&gt;
&lt;br /&gt;
Afterwards:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
cd /home/pingu/bin&lt;br /&gt;
git clone https://github.com/opentrack/opentrack&lt;br /&gt;
cd opentrack/&lt;br /&gt;
cmake -DONNXRuntime_DIR=/home/vanosten/bin/onnxruntime-linux-x64-1.17.0 .&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
NB:&lt;br /&gt;
* The ONNX runtime has to stay in place. Otherwise you need to edit the LD_LIBRARY_PATH.&lt;br /&gt;
* The start OpenTrack change into the installation directory (e.g. /home/pingu/bin/opentrack/install) and then run bin/opentrack.&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
{{tip|If you use the [[Howto:Place 3D objects with the UFO|UFO to place objects]], disable the headtracker add-on before starting FlightGear. The {{key press|Shift|{{=}}}} binding for centering the view will interfere with the UFO's binding for showing the Adjust Model dialog.}}&lt;br /&gt;
&lt;br /&gt;
FlightGear will not automatically start accepting input from opentrack just because you have it running, because it has not been told to listen for input from opentrack, or what to do with it.&lt;br /&gt;
&lt;br /&gt;
The simplest way to do so is to use the headtracker addon.&lt;br /&gt;
* Download the headtracker addon from {{fgaddon source|path=Addons/Headtracker}} (See [[FGAddon#Download|FGAddon]] regarding how to download from an svn repository).&lt;br /&gt;
* Load the headtracker [[Addon#Installing_and_using_an_addon|addon]], either by adding it in the [[FlightGear_Qt_launcher| FlightGear launcher]], or with the following [[Command_line_options|command line option]]:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--addon=full-path-to-the-headtracker-folder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Add the following [[Command_line_options|option]] either from the [[Command_line|command line]], or through the [[FlightGear_Qt_launcher| FlightGear launcher]]:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--generic=socket,in,60,localhost,5542,udp,opentrack&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
{{Note|Proper calibration of your head-tracking setup is crucial for success, it may require lots of experimenting. Also ensure that no other software is trying to use your webcam, that FlightGear is selected as the &amp;quot;Output&amp;quot;, and that your tracking is running before launching FlightGear}}&lt;br /&gt;
&lt;br /&gt;
[[File:Opentrack with the FlightGear output mode selected.png|thumbnail|FlightGear must be selected as the &amp;quot;Output&amp;quot; in order for the head tracking to work]]&lt;br /&gt;
&lt;br /&gt;
A generic quickstart video demonstrating the usage of opentrack can be found below.&lt;br /&gt;
{{#ev:youtube|QYmHab6CGgo|A quickstart video for using opentrack}}&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
=== Wiki articles ===&lt;br /&gt;
* [[Head tracking]]&lt;br /&gt;
&lt;br /&gt;
=== Forum topics ===&lt;br /&gt;
* {{forum link|title=Re: Opentrack|p=372905|}} (The original source of the XML code and startup options)&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* {{github source|proj=opentrack|repo=opentrack|text=Project website}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Head tracking]]&lt;br /&gt;
&lt;br /&gt;
[[pl:opentrack]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Opentrack&amp;diff=142170</id>
		<title>Opentrack</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Opentrack&amp;diff=142170"/>
		<updated>2025-07-24T08:34:40Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Building with Neuralnet enabled&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase title}}&lt;br /&gt;
{{Infobox Software&lt;br /&gt;
| title                  = opentrack&lt;br /&gt;
| logo                   = &lt;br /&gt;
| image                  = Opentrack_screenshot.png&lt;br /&gt;
| alt                    = The opentrack interface&lt;br /&gt;
| writtenin              = C/C++&lt;br /&gt;
| os                     = Cross-platform&lt;br /&gt;
| developmentstatus      = Active&lt;br /&gt;
| license                = Most all code is under the ICS license&lt;br /&gt;
| website                = https://github.com/opentrack/opentrack&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/opentrack/opentrack '''opentrack'''] is a head-tracking program with built-in support for the [[Interfacing_FlightGear|FlightGear interface]], allowing head tracking data to be sent directly as input data to FlightGear. Licensed as open-source software, opentrack has its roots in the [[FaceTrackNoIR]] project, and maintains many of the projects ideas. &lt;br /&gt;
&lt;br /&gt;
== Installation  ==&lt;br /&gt;
=== Compiling for Linux ===&lt;br /&gt;
Linux users may be disappointed to know that no binaries are provided for opentrack. Luckily, compiling opentrack is a fairly mild process.&lt;br /&gt;
&lt;br /&gt;
The following dependencies are for '''Debian-based''' systems, however it should give users of other distros a rough idea of what they will need to hunt for in their own package manager. Users of other distributions are encouraged to expand upon this guide.&lt;br /&gt;
&lt;br /&gt;
==== Dependencies ====&lt;br /&gt;
* {{code|cmake}}&lt;br /&gt;
* {{code|git}}&lt;br /&gt;
* {{code|qttools5-dev}}&lt;br /&gt;
* {{code|qtbase5-private-dev}}&lt;br /&gt;
* {{code|libprocps-dev}}&lt;br /&gt;
* {{code|libopencv-dev}}&lt;br /&gt;
&lt;br /&gt;
If you are on Ubuntu 24.04 or higher and are building OpenTrack 2024.1.1, then you will need newer dependencies:&lt;br /&gt;
* {{code|cmake}}&lt;br /&gt;
* {{code|git}}&lt;br /&gt;
* {{code|qttools6-dev}}&lt;br /&gt;
* {{code|qtbase6-private-dev}}&lt;br /&gt;
* {{code|libproc2-dev}} on recent Ubuntu&lt;br /&gt;
* {{code|libopencv-dev}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|While Opentrack will build without OpenCV, it will only compile with a very minimal subset of its functionality, making it of little use to the average user who does not have very specific usage requirements.}}&lt;br /&gt;
&lt;br /&gt;
==== Building Default====&lt;br /&gt;
Compiling the project is the same as with any cmake project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
git clone https://github.com/opentrack/opentrack&lt;br /&gt;
cd opentrack/&lt;br /&gt;
cmake .&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The resulting build output will be placed in the {{code|install/}} directory. It will not 'install' itself anywhere outside of the current directory.}}&lt;br /&gt;
&lt;br /&gt;
==== Building with Neuralnet====&lt;br /&gt;
The Neuralnet Tracker uses a webcam and will interpret the position of your head automatically. The instructions are based on https://forums.x-plane.org/forums/topic/310414-howto-headtracking-aitrack-neuralnet-opentrack/ and assume you are user &amp;quot;pingu&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
First create a directory, where your compiled stuff will be:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
cd /home/pingu&lt;br /&gt;
mkdir bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then download onnxruntime-linux-x64-1.17.0.tgz from https://github.com/microsoft/onnxruntime/releases/tag/v1.17.0 and extract it into /home/pingu/bin.&lt;br /&gt;
&lt;br /&gt;
Afterwards:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
cd /home/pingu/bin&lt;br /&gt;
git clone https://github.com/opentrack/opentrack&lt;br /&gt;
cd opentrack/&lt;br /&gt;
cmake -DONNXRuntime_DIR=/home/vanosten/bin/onnxruntime-linux-x64-1.17.0 .&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
{{tip|If you use the [[Howto:Place 3D objects with the UFO|UFO to place objects]], disable the headtracker add-on before starting FlightGear. The {{key press|Shift|{{=}}}} binding for centering the view will interfere with the UFO's binding for showing the Adjust Model dialog.}}&lt;br /&gt;
&lt;br /&gt;
FlightGear will not automatically start accepting input from opentrack just because you have it running, because it has not been told to listen for input from opentrack, or what to do with it.&lt;br /&gt;
&lt;br /&gt;
The simplest way to do so is to use the headtracker addon.&lt;br /&gt;
* Download the headtracker addon from {{fgaddon source|path=Addons/Headtracker}} (See [[FGAddon#Download|FGAddon]] regarding how to download from an svn repository).&lt;br /&gt;
* Load the headtracker [[Addon#Installing_and_using_an_addon|addon]], either by adding it in the [[FlightGear_Qt_launcher| FlightGear launcher]], or with the following [[Command_line_options|command line option]]:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--addon=full-path-to-the-headtracker-folder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Add the following [[Command_line_options|option]] either from the [[Command_line|command line]], or through the [[FlightGear_Qt_launcher| FlightGear launcher]]:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--generic=socket,in,60,localhost,5542,udp,opentrack&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
{{Note|Proper calibration of your head-tracking setup is crucial for success, it may require lots of experimenting. Also ensure that no other software is trying to use your webcam, that FlightGear is selected as the &amp;quot;Output&amp;quot;, and that your tracking is running before launching FlightGear}}&lt;br /&gt;
&lt;br /&gt;
[[File:Opentrack with the FlightGear output mode selected.png|thumbnail|FlightGear must be selected as the &amp;quot;Output&amp;quot; in order for the head tracking to work]]&lt;br /&gt;
&lt;br /&gt;
A generic quickstart video demonstrating the usage of opentrack can be found below.&lt;br /&gt;
{{#ev:youtube|QYmHab6CGgo|A quickstart video for using opentrack}}&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
=== Wiki articles ===&lt;br /&gt;
* [[Head tracking]]&lt;br /&gt;
&lt;br /&gt;
=== Forum topics ===&lt;br /&gt;
* {{forum link|title=Re: Opentrack|p=372905|}} (The original source of the XML code and startup options)&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* {{github source|proj=opentrack|repo=opentrack|text=Project website}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Head tracking]]&lt;br /&gt;
&lt;br /&gt;
[[pl:opentrack]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Opentrack&amp;diff=142169</id>
		<title>Opentrack</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Opentrack&amp;diff=142169"/>
		<updated>2025-07-24T08:24:11Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Dependencies for more recent versions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase title}}&lt;br /&gt;
{{Infobox Software&lt;br /&gt;
| title                  = opentrack&lt;br /&gt;
| logo                   = &lt;br /&gt;
| image                  = Opentrack_screenshot.png&lt;br /&gt;
| alt                    = The opentrack interface&lt;br /&gt;
| writtenin              = C/C++&lt;br /&gt;
| os                     = Cross-platform&lt;br /&gt;
| developmentstatus      = Active&lt;br /&gt;
| license                = Most all code is under the ICS license&lt;br /&gt;
| website                = https://github.com/opentrack/opentrack&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/opentrack/opentrack '''opentrack'''] is a head-tracking program with built-in support for the [[Interfacing_FlightGear|FlightGear interface]], allowing head tracking data to be sent directly as input data to FlightGear. Licensed as open-source software, opentrack has its roots in the [[FaceTrackNoIR]] project, and maintains many of the projects ideas. &lt;br /&gt;
&lt;br /&gt;
== Installation  ==&lt;br /&gt;
=== Compiling for Linux ===&lt;br /&gt;
Linux users may be disappointed to know that no binaries are provided for opentrack. Luckily, compiling opentrack is a fairly mild process.&lt;br /&gt;
&lt;br /&gt;
The following dependencies are for '''Debian-based''' systems, however it should give users of other distros a rough idea of what they will need to hunt for in their own package manager. Users of other distributions are encouraged to expand upon this guide.&lt;br /&gt;
&lt;br /&gt;
==== Dependencies ====&lt;br /&gt;
* {{code|cmake}}&lt;br /&gt;
* {{code|git}}&lt;br /&gt;
* {{code|qttools5-dev}}&lt;br /&gt;
* {{code|qtbase5-private-dev}}&lt;br /&gt;
* {{code|libprocps-dev}}&lt;br /&gt;
* {{code|libopencv-dev}}&lt;br /&gt;
&lt;br /&gt;
If you are on Ubuntu 24.04 or higher and are building OpenTrack 2024.1.1, then you will need newer dependencies:&lt;br /&gt;
* {{code|cmake}}&lt;br /&gt;
* {{code|git}}&lt;br /&gt;
* {{code|qttools6-dev}}&lt;br /&gt;
* {{code|qtbase6-private-dev}}&lt;br /&gt;
* {{code|libproc2-dev}} on recent Ubuntu&lt;br /&gt;
* {{code|libopencv-dev}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Note|While Opentrack will build without OpenCV, it will only compile with a very minimal subset of its functionality, making it of little use to the average user who does not have very specific usage requirements.}}&lt;br /&gt;
&lt;br /&gt;
==== Building ====&lt;br /&gt;
Compiling the project is the same as with any cmake project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
git clone https://github.com/opentrack/opentrack&lt;br /&gt;
cd opentrack/&lt;br /&gt;
cmake .&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The resulting build output will be placed in the {{code|install/}} directory. It will not 'install' itself anywhere outside of the current directory.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
{{tip|If you use the [[Howto:Place 3D objects with the UFO|UFO to place objects]], disable the headtracker add-on before starting FlightGear. The {{key press|Shift|{{=}}}} binding for centering the view will interfere with the UFO's binding for showing the Adjust Model dialog.}}&lt;br /&gt;
&lt;br /&gt;
FlightGear will not automatically start accepting input from opentrack just because you have it running, because it has not been told to listen for input from opentrack, or what to do with it.&lt;br /&gt;
&lt;br /&gt;
The simplest way to do so is to use the headtracker addon.&lt;br /&gt;
* Download the headtracker addon from {{fgaddon source|path=Addons/Headtracker}} (See [[FGAddon#Download|FGAddon]] regarding how to download from an svn repository).&lt;br /&gt;
* Load the headtracker [[Addon#Installing_and_using_an_addon|addon]], either by adding it in the [[FlightGear_Qt_launcher| FlightGear launcher]], or with the following [[Command_line_options|command line option]]:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--addon=full-path-to-the-headtracker-folder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Add the following [[Command_line_options|option]] either from the [[Command_line|command line]], or through the [[FlightGear_Qt_launcher| FlightGear launcher]]:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--generic=socket,in,60,localhost,5542,udp,opentrack&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
{{Note|Proper calibration of your head-tracking setup is crucial for success, it may require lots of experimenting. Also ensure that no other software is trying to use your webcam, that FlightGear is selected as the &amp;quot;Output&amp;quot;, and that your tracking is running before launching FlightGear}}&lt;br /&gt;
&lt;br /&gt;
[[File:Opentrack with the FlightGear output mode selected.png|thumbnail|FlightGear must be selected as the &amp;quot;Output&amp;quot; in order for the head tracking to work]]&lt;br /&gt;
&lt;br /&gt;
A generic quickstart video demonstrating the usage of opentrack can be found below.&lt;br /&gt;
{{#ev:youtube|QYmHab6CGgo|A quickstart video for using opentrack}}&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
=== Wiki articles ===&lt;br /&gt;
* [[Head tracking]]&lt;br /&gt;
&lt;br /&gt;
=== Forum topics ===&lt;br /&gt;
* {{forum link|title=Re: Opentrack|p=372905|}} (The original source of the XML code and startup options)&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* {{github source|proj=opentrack|repo=opentrack|text=Project website}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Head tracking]]&lt;br /&gt;
&lt;br /&gt;
[[pl:opentrack]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Opentrack&amp;diff=142166</id>
		<title>Opentrack</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Opentrack&amp;diff=142166"/>
		<updated>2025-07-23T10:22:13Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Dependencies */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{lowercase title}}&lt;br /&gt;
{{Infobox Software&lt;br /&gt;
| title                  = opentrack&lt;br /&gt;
| logo                   = &lt;br /&gt;
| image                  = Opentrack_screenshot.png&lt;br /&gt;
| alt                    = The opentrack interface&lt;br /&gt;
| writtenin              = C/C++&lt;br /&gt;
| os                     = Cross-platform&lt;br /&gt;
| developmentstatus      = Active&lt;br /&gt;
| license                = Most all code is under the ICS license&lt;br /&gt;
| website                = https://github.com/opentrack/opentrack&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
[https://github.com/opentrack/opentrack '''opentrack'''] is a head-tracking program with built-in support for the [[Interfacing_FlightGear|FlightGear interface]], allowing head tracking data to be sent directly as input data to FlightGear. Licensed as open-source software, opentrack has its roots in the [[FaceTrackNoIR]] project, and maintains many of the projects ideas. &lt;br /&gt;
&lt;br /&gt;
== Installation  ==&lt;br /&gt;
=== Compiling for Linux ===&lt;br /&gt;
Linux users may be disappointed to know that no binaries are provided for opentrack. Luckily, compiling opentrack is a fairly mild process.&lt;br /&gt;
&lt;br /&gt;
The following dependencies are for '''Debian-based''' systems, however it should give users of other distros a rough idea of what they will need to hunt for in their own package manager. Users of other distributions are encouraged to expand upon this guide.&lt;br /&gt;
&lt;br /&gt;
==== Dependencies ====&lt;br /&gt;
* {{code|cmake}}&lt;br /&gt;
* {{code|git}}&lt;br /&gt;
* {{code|qttools5-dev}}&lt;br /&gt;
* {{code|qtbase5-private-dev}}&lt;br /&gt;
* {{code|libprocps-dev}} or {{code|libproc2-dev}} on recent Ubuntu&lt;br /&gt;
* {{code|libopencv-dev}}&lt;br /&gt;
&lt;br /&gt;
{{Note|While opentrack will build without OpenCV, it will only compile with a very minimal subset of its functionality, making it of little use to the average user who does not have very specific usage requirements.}}&lt;br /&gt;
&lt;br /&gt;
==== Building ====&lt;br /&gt;
Compiling the project is the same as with any cmake project:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
git clone https://github.com/opentrack/opentrack&lt;br /&gt;
cd opentrack/&lt;br /&gt;
cmake .&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|The resulting build output will be placed in the {{code|install/}} directory. It will not 'install' itself anywhere outside of the current directory.}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
{{tip|If you use the [[Howto:Place 3D objects with the UFO|UFO to place objects]], disable the headtracker add-on before starting FlightGear. The {{key press|Shift|{{=}}}} binding for centering the view will interfere with the UFO's binding for showing the Adjust Model dialog.}}&lt;br /&gt;
&lt;br /&gt;
FlightGear will not automatically start accepting input from opentrack just because you have it running, because it has not been told to listen for input from opentrack, or what to do with it.&lt;br /&gt;
&lt;br /&gt;
The simplest way to do so is to use the headtracker addon.&lt;br /&gt;
* Download the headtracker addon from {{fgaddon source|path=Addons/Headtracker}} (See [[FGAddon#Download|FGAddon]] regarding how to download from an svn repository).&lt;br /&gt;
* Load the headtracker [[Addon#Installing_and_using_an_addon|addon]], either by adding it in the [[FlightGear_Qt_launcher| FlightGear launcher]], or with the following [[Command_line_options|command line option]]:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--addon=full-path-to-the-headtracker-folder&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Add the following [[Command_line_options|option]] either from the [[Command_line|command line]], or through the [[FlightGear_Qt_launcher| FlightGear launcher]]:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
--generic=socket,in,60,localhost,5542,udp,opentrack&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
{{Note|Proper calibration of your head-tracking setup is crucial for success, it may require lots of experimenting. Also ensure that no other software is trying to use your webcam, that FlightGear is selected as the &amp;quot;Output&amp;quot;, and that your tracking is running before launching FlightGear}}&lt;br /&gt;
&lt;br /&gt;
[[File:Opentrack with the FlightGear output mode selected.png|thumbnail|FlightGear must be selected as the &amp;quot;Output&amp;quot; in order for the head tracking to work]]&lt;br /&gt;
&lt;br /&gt;
A generic quickstart video demonstrating the usage of opentrack can be found below.&lt;br /&gt;
{{#ev:youtube|QYmHab6CGgo|A quickstart video for using opentrack}}&lt;br /&gt;
&lt;br /&gt;
== Related content ==&lt;br /&gt;
=== Wiki articles ===&lt;br /&gt;
* [[Head tracking]]&lt;br /&gt;
&lt;br /&gt;
=== Forum topics ===&lt;br /&gt;
* {{forum link|title=Re: Opentrack|p=372905|}} (The original source of the XML code and startup options)&lt;br /&gt;
&lt;br /&gt;
== External links ==&lt;br /&gt;
* {{github source|proj=opentrack|repo=opentrack|text=Project website}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Head tracking]]&lt;br /&gt;
&lt;br /&gt;
[[pl:opentrack]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0_rendering&amp;diff=141703</id>
		<title>World Scenery 3.0 rendering</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0_rendering&amp;diff=141703"/>
		<updated>2025-04-04T12:22:53Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Added table for LoD level and grid size&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WS30 Navbar}}&lt;br /&gt;
&lt;br /&gt;
This page has changing notes about the ongoing [[World Scenery 3.0 roadmap|World Scenery 3.0]] rendering implementation. It can be considered a scratchpad. If you are looking to help with rendering, testing, scenery generation with [[Virtual Planet Builder|VPB]], or any other aspect of WS3 get in touch using the &amp;quot;[[Mailing lists|fg-devel]]&amp;quot; mailing list.&lt;br /&gt;
&lt;br /&gt;
== Notes - short term features ==&lt;br /&gt;
&lt;br /&gt;
==== Misc issues (near term): ====&lt;br /&gt;
&lt;br /&gt;
* Uniforms tile_width and tile_height sent from the CPU are the wrong way around. These could be packed in a vec2 called tile_size.xy. They are currently put into the global variable tile_size in landclass-search-functions.frag , and flipped manually.&lt;br /&gt;
* terrain-overlay.eff is used in newer regional definitions instead of terrain-default. There's no way to tell FG to use the WS30 version - ws30-overlay.eff.&lt;br /&gt;
* Roads: switching materials ws30Freeway and ws30Road to road-*.eff causes roads not to render. Switching to lfeat.eff causes roads to render, even at ultra, but there are no moving cars etc. (lfeat.eff is derived from Runway.eff which inherits from terrain and uses a runway shader at high settings). The terrain-default effect has the wrong texture and goes black in the distance. It is not designed, or the most efficient, for roads. The terrain fragment shaders have changed in recent eras so at ultra setting it is probably missing some uniform - e.g. xsize is sent used as a uniform (I can get roads to render by setting xsize to ysize, but there is an error in the console log about scaling the texture).&lt;br /&gt;
* Likely no longer needed: Landclass texture dimensions in texels is useful - however textureSize() provides that. The question is if some exotic compiler/GPU has issues with this - maybe unlikely given FG will eventually need OpenGL 4.x+ support? Querying textureSize() is likely fast since the GPU must know this to handle the texture, so the value should be readily available. So this is not needed?&lt;br /&gt;
* There's some sort of landclass border artifact visible at long range visible on a 10 series GPU. It's mostly hidden by the haze , which is thicker than normal right now due to issues with tile model position. To see it clearly remove haze and lighting via the control in the fragment shader.&lt;br /&gt;
&lt;br /&gt;
==== Sending materials parameters to shaders as arrays of vec4s ====&lt;br /&gt;
''v2, 19th Nov 2021.''&lt;br /&gt;
&lt;br /&gt;
Two ways of doing it: 1) each parameter as a separate array with a landclass index. 2) all material parameters per landclass in one block. &lt;br /&gt;
&lt;br /&gt;
'''1)''' needs a function to look up non-vec4 parameters - it's possible to keep vec4 parameters as an array of vec4s, and pack single parameters in groups of 4 as a combined array. There needs to be a way to define, in an xml mapping file, which parameters are packed where in a combined vec4 array.&lt;br /&gt;
&lt;br /&gt;
e.g. four materials parameters base_magnification_factor, use_overlay, overlay_magnification_factor, overlay_bias are packed into a suitably named combined array.&lt;br /&gt;
&lt;br /&gt;
The other alternative is to have more occupancy and use an array with the relevant data type - e.g. floats .&lt;br /&gt;
&lt;br /&gt;
'''2)''' has the advantage that accesses are in interleaved format, which is easier on caches and reduces register pressure by being vec4s. 2 always needs a simple function or two to look it up.&lt;br /&gt;
&lt;br /&gt;
e.g.&amp;lt;syntaxhighlight lang=&amp;quot;c++&amp;quot;&amp;gt;&lt;br /&gt;
float getFloatFromVec4ArrayData(int i)&lt;br /&gt;
{&lt;br /&gt;
    int n = int(floor(float(i/4.0)));&lt;br /&gt;
    vec4 v4 = specularArray[n];&lt;br /&gt;
    int index_within_v4 = int(mod(float(i),4.0));&lt;br /&gt;
    float value = v4[index_within_v4];&lt;br /&gt;
    return value;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vec4 getVec4FromArrayData(int i) &lt;br /&gt;
{&lt;br /&gt;
  return (vec4(getFloatFromArrayData(i), getFloatFromArrayData(i+1), getFloatFromArrayData(i+2), getFloatFromArrayData(i+3));&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
// Accessing parameters&lt;br /&gt;
vec4 specular = getVec4FromArrayData(size_of_parameter_block*landclass_index+17); // returns 17, 18, 19, 20&lt;br /&gt;
vec4 ambient = getVec4FromArrayData(size_of_parameter_block*landclass_index+21);&lt;br /&gt;
int use_overlay = int(getFloatFromVec4ArrayData(size_of_parameter_block*landclass_index+25));&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;2) needs a way to define a block of parameters per landclass in xml.&lt;br /&gt;
&lt;br /&gt;
e.g.&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
0: the number identifying the effect. There needs to be a xml file to assign different effects a number. e.g. WS30.eff:0, agriculture:1, some future terrain effect: 3. This number will be used to turn different code blocks on/off.&lt;br /&gt;
&lt;br /&gt;
1: base texture slot&lt;br /&gt;
&lt;br /&gt;
2: base_texture_magnification parameter&lt;br /&gt;
&lt;br /&gt;
3 to 6: specular rgba&lt;br /&gt;
&lt;br /&gt;
[...]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Sending of texture set data to shaders =====&lt;br /&gt;
''v1, 13th Nov 2021.''&lt;br /&gt;
&lt;br /&gt;
I think the maximum number of texture sets used by regional definitions is 4 - e.g. DryCropPastureCover/DryCrop in regions global summer. So the maximum number of texture sets could be limited to save space. 4 sets, or a few more? Possible to extend the number later. e.g. base_tex1, base_tex2, base_tex3, base_tex4, overlay_tex1, overlay_tex2, overlay_tex3 ... For 6 textures that's 24 texture parameters per landclass. It may be possible to reduce this a bit, as things like dot textures probably don't  feature in texture sets currently.&lt;br /&gt;
&lt;br /&gt;
== Roads ==&lt;br /&gt;
''&amp;lt;small&amp;gt;v2, 13th Nov 2021.&amp;lt;/small&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Eventually road shaders should have access to the underlying landclass - this could come directly from the tile's landclass texture if road meshes are separate per tile. Landclass info could also be embedded as a vertex attribute. Roads can lookup the ground texture array using this info to create dirt concentrated towards road edges in country roads or less well maintained roads - for example dirt, mud, sand depending on surrounding terrain. It's also possible to just create some suitable dirt colours. The maintenance status of roads could come from a OSM2City heuristic - e.g. distance from cities/town, lighting status, surrounding terrain. it's also possible to for the shaders to guess maintenance status - e.g. well maintained roads when the surrounding country side is urban or park-lands , less well maintained roads when unlit, and dirt or mud when there is irrigated or dry crop agriculture. Examples from wikimedia commons: [https://commons.wikimedia.org/wiki/File:Country_Road_-_panoramio_(1).jpg],[https://commons.wikimedia.org/wiki/File:Narrow_country_road_-_geograph.org.uk_-_1302296.jpg][https://commons.wikimedia.org/wiki/File:Country_Road_(5073498111).jpg][https://commons.wikimedia.org/wiki/File:Country_Road_near_Elsham_-_geograph.org.uk_-_1058253.jpg][https://commons.wikimedia.org/wiki/File:Desert_road_-_panoramio_(3).jpg]&lt;br /&gt;
&lt;br /&gt;
== Transitions ==&lt;br /&gt;
''&amp;lt;small&amp;gt;v1, 13th Nov 2021.&amp;lt;/small&amp;gt;'' &lt;br /&gt;
&lt;br /&gt;
There are two ways of dealing with transitions: &lt;br /&gt;
&lt;br /&gt;
1. Searching the landclass texture in a special pass either by faking a compute shader, or actually using a compute shader once FG moves to Vulkan (in the LTS after the next LTS  which may be 2023 or 2024).&lt;br /&gt;
&lt;br /&gt;
2. Doing a search every pixel in the landclass texture in the fragment shader and finding an neighboring landlcasses. This is implemented already.&lt;br /&gt;
&lt;br /&gt;
=== 1) Special pass to search the landclass texture ===&lt;br /&gt;
&lt;br /&gt;
* Faking a compute shader by rendering to a texture so the right values get written to the right place&lt;br /&gt;
* Done once, done as each tile is loaded&lt;br /&gt;
* Combined landclass and transitions texture. Minimum 1 neighbor and 3 channels. 5 Channels: 1: landclass, 2: closest neighbor, 3: second closest neighbor, 4: mix factor between landclass and two neighbours, 5: split between neighbor 1 and 2. May be possible to combine 1 and 2 in once channel by using 4 bits (16 levels each).&lt;br /&gt;
* Drawback: landclass and transitions texture needs 3x-5x more VRAM. 3 more channels could be used to include some advanced transitions parameters.&lt;br /&gt;
* Performance on older GPUs: Advantage of this depends on how fast 2) is on older systems once shaders have been fully ported - unknown currently. Tradeoff = more VRAM usage (older GPUs will have less max VRAM) versus less searching - however the caching of texture means lookups in the immediate vicinity are fast so searching isn't too bad.&lt;br /&gt;
&lt;br /&gt;
=== 2) Searching the landclass texture every pixel (fragment) ===&lt;br /&gt;
This is currently implemented.&lt;br /&gt;
&lt;br /&gt;
There are small scale transitions to depixelate the landclass texture. There are large scale transitions between large/coarse landclass blobs.&lt;br /&gt;
&lt;br /&gt;
=== Scenery generation ===&lt;br /&gt;
Higher landclass texture resolution means less pixelation.&lt;br /&gt;
&lt;br /&gt;
Vector landclass data -&amp;gt; landclass raster conversion: smaller landclass blobs look better with transitions enabled, but small and contrasting blobs may highlight the pixelation without transitions.&lt;br /&gt;
&lt;br /&gt;
== Object placement based on masks ==&lt;br /&gt;
&amp;lt;small&amp;gt;v1, 21 Nov 2021.&amp;lt;/small&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== WS2 scheme ====&lt;br /&gt;
&lt;br /&gt;
* Objects like trees or farm buildings were placed based on object placement masks (textures) - in WS2. Different texture channels were for different  trees or scenery objects, and also controlled rotation of objects.&lt;br /&gt;
* Each landclass blob had it's own set of ground texture coordinates that started from 0. These coordinates restarted after each landclass blob, so they didn't extend too far and cause precision issues.&lt;br /&gt;
* C++ placement code looked at the ground texture coordinates, and the object maps, and then placed objects. This allowed things like trees to line up exactly with the agriculture field boundaries.&lt;br /&gt;
* There are texture variants sets - C++ will randomly select different texture sets and their object placement masks.&lt;br /&gt;
&lt;br /&gt;
==== WS30 ====&lt;br /&gt;
&lt;br /&gt;
* The texture coordinates are created in a shader. Texture coordinates have to restart often to avoid precision issues. &lt;br /&gt;
* The C++ placement code currently doesn't know the texture coordinates, or any detiling algorithms used for things like agriculture.&lt;br /&gt;
* Texture variant selection is done on the GPU - currently there isn't a mechanism to do it on CPU and tell the GPU e.g. encoding it as a channel in the landclass texture at the cost of increasing occupancy and putting pressure on VRAM (which is the type of thing that is suited for a fake compute shader pass - see the transitions section).&lt;br /&gt;
&lt;br /&gt;
==== Solution ====&lt;br /&gt;
&lt;br /&gt;
* Reproduce the texture coordinates code in C++. Reproduce the texture variant selection code in C++.&lt;br /&gt;
* Reproduce the texture detiling code in C++. Detile the masks with it. The detiling code's noise functions must be such that they produce same results on all CPUs and all GPUs - this may need using texture lookup noise for detiling and texture variant selection.&lt;br /&gt;
* It's easiest to use exactly the same code as glsl for maintenance reasons. C++ headers like glm can recreate glsl structures, operator overloads, and built-ins so glsl code will compile in C++ : https://github.com/g-truc/glm&lt;br /&gt;
* The texture lookup and detiling glsl code can be separated into functions, and put in a shader include file. This file needs to be copied manually everytime it's changed - otherwise building simgear or flightgear becomes dependent on FGData. The file can be included in C++, and the functions called to lookup the object masks correctly - the function interface can stay the same.&lt;br /&gt;
&lt;br /&gt;
== Scenery size on server and client ==&lt;br /&gt;
''&amp;lt;small&amp;gt;v1, 13th Nov 2021.&amp;lt;/small&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
It's possible to use different filenames to signify different formats for elevation and landclass texture data.&lt;br /&gt;
&lt;br /&gt;
Terrain elevation data in the source DEMs are rounded off to 1m. So having more bits than that is overkill.&lt;br /&gt;
&lt;br /&gt;
Terrain elevation option: 8 bit terrain elevation + offset stored in file name - when the tile elevation difference is less than 255m. If this is done, these tile should also be 8 bit in memory with an offset provided by a uniform - the vertex shader can translate different formats trivially. For tiles with elevations greater then 255m splitting elevation data into 2x2, 3x3 ..4x4 subtiles may work - the file names could indicate subtile format and offsets. Sometimes terrain has a simple underlying slope with small deviations - it's also possible to specify two gradients - elevation (z) = tile offset + dx*x + dy*y + z_8bit(x,y). Offset, dx, and dy can be specified in the filename and the vertex shader can trivially apply this.&lt;br /&gt;
&lt;br /&gt;
Client: higher uncompressed scenery size means people run out of disk space and flush their Terrasync cache more often - this means higher TerraSync bandwidth. These days SSDs mean people's harddrive sizes are smaller than what they would be if the non-SSD technology was dominant. Hybrid SSDs are the solution, but are uncommon.&lt;br /&gt;
&lt;br /&gt;
Client: Non-SSDs can suffer from file fragmentation. IIRC FG can now read Tar files. So it may be simpler to leave the tar files in place for all scenery instead of extracting them.&lt;br /&gt;
&lt;br /&gt;
== VRAM occupancy ==&lt;br /&gt;
''&amp;lt;small&amp;gt;v2, 9th Dec 2021.&amp;lt;/small&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
As of early Nov, WS3 takes up more VRAM than WS2.&lt;br /&gt;
&lt;br /&gt;
Vertex data: 16 bit + offset if possible. Rounded off to 1m this allows 65km tile size. A 1x1 degree tile at the equator is ~111km so this is an option for smaller tiles. The mesh points need to be rounded of to 1m, or a fraction of 1m for tiles that are 32km, 16km, or 8km. That may need a VPB change. It may also be possible to round off vertices to 1m at runtime - but it may take slightly more CPU times, unless there's already a algorithm that processes a lot of vertices (e.g. tree or object placement) - in which case it could be added to that. Rounding vertices should not create holes? as the connectivity should be intact.&lt;br /&gt;
&lt;br /&gt;
Landclass data: Should be reduced to greyscale . Currently the actual landclass is stored in the g channel. The r channel contains the original CORINE values. Update, Dec 2021: Fixed. &lt;br /&gt;
&lt;br /&gt;
== Tile LoD scheme - fine tuning ==&lt;br /&gt;
&amp;lt;sub&amp;gt;''v1, 9th Dec 2021.''&amp;lt;/sub&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== World Scenery 2 ===&lt;br /&gt;
&lt;br /&gt;
* Scenery is split into roughly square tiles. Each tile is of the same size and the same detail.&lt;br /&gt;
* Rendering draws tiles in a square around the camera influenced by LoD: bare. Visible tiles are prioritised.&lt;br /&gt;
* At high altitude a large number of tiles are drawn, and in the scenegraph. These tiles are at full detail.&lt;br /&gt;
&lt;br /&gt;
=== World Scenery 3.0: ===&lt;br /&gt;
&lt;br /&gt;
* Scenery is split into roughly square tiles. There are currently 7 LoD levels (0 to 6) with increasing detail. Tiles of each LoD level cover the entire world. &lt;br /&gt;
* Rendering draws tiles from a mixture of LoD levels. The further away from the camera, the less detail the drawn tiles are (lower LoD level). &lt;br /&gt;
* For tiles of differing LoD levels to fit next to each other without gaps, each tile contains a boundary with a special mesh, like an interface layer - the tile skirt. &lt;br /&gt;
* The lower LoD tiles are also bigger and cover a larger area compared to the higher LoD tiles - it takes fewer of them to cover the globe. This reduces the number of separate tiles visible at high altitude, and helps prevent the scenegraph from growing huge. &lt;br /&gt;
* As the camera comes closer 4 tiles of a given LoD levels will be replaced by 1 tile of a higher LoD level. e.g. One LoD five tile will be replaced by four LoD 6 tiles. As the camera moves away four LoD 6 tiles will be replaced by one LoD 5 tile - and four LoD 5 tiles will be replaced by one LoD 4 tile. &lt;br /&gt;
&lt;br /&gt;
==== Scenery pop-in ====&lt;br /&gt;
&lt;br /&gt;
* The lower tile detail levels means less vertices are visible when the camera is far. It also means the shape of the terrain is more approximate - but since the terrain is further away it should be hard to notice - with some fine tuning. How noticeable it gets depends on how much of the cameras field of view the scenery takes up - and how much the monitor takes up in the person's field of view. As the camera gets closer lower detail tiles are replaced by higher detail ones - this is called scenery pop-in. &lt;br /&gt;
* The scenery pop-in is not visible if the colour of the space on the monitor taken up by tiles doesn't change. If the tile mesh is silhouetted against the sky - like a mountain ridge - then scenery pop-in is more noticeable as the colour of the background contrasts more. Similarly if a ridge or a mountain close to the camera is of a different colour the the background created by a a different landclass, water, or a city then the pop-in is more noticeable.&lt;br /&gt;
* If the colour of texturing changes slightly between different LoDs then it will also be noticeable - even if the terrain is perfectly flat. Pop-in will be more noticeable in regions where the colour naturally changes over a short space - less in deserts.&lt;br /&gt;
* There's some colour change due to the landclass texture being stretched by different amounts for each tile LoD level. The size of the texture remains the same, but the tile sizes change. It's technically possible to lookup landclases and textures of a neighbouring LoD level and blend, but this needs 2 extra texture lookups with maybe the landclass transition also being done twice - and is likely not worth it. &lt;br /&gt;
* The stress test for scenery pop-in would be in a region with tall, complex, sharp mountains and ridges - like the Himalayas - so each tile LoD level contains large differences in elevation. If there is also colour variation over short ranges, it will help.&lt;br /&gt;
&lt;br /&gt;
==== Tile loading ====&lt;br /&gt;
&lt;br /&gt;
* Currently (Nov 2021) tiles are loaded in a square around the camera influenced by LoD bare. The VPB tile manager now loads the tiles.&lt;br /&gt;
* New tile LoDs take a while to load. Currently tile loading is easily seen as colours change for new tiles due to placeholder texture coordinates. To see the effect - try reloading scenery and watch as LoD levels are loaded from the lowest to the highest detail. It's also possible to rapidly go from high altitude to a distant spot and stop, with the UFO - and then watch tile loading. Colours change due to landclass textures between different tiles not matching as they are stretched over different sized tiles.&lt;br /&gt;
* If tile loading is slow, it is possible to load the lowest detail tiles and then worry about the rest - which is what the VPB tile manager seems to be doing (??). I'm not sure loading tiles around the craft is that slow even on the more worse case systems (?), but loading the lowest detail and every other level at startup might be.&lt;br /&gt;
&lt;br /&gt;
===== Tile loading prioritisation =====&lt;br /&gt;
&lt;br /&gt;
* Ideally tiles in front of the camera should be prioritised. Ideally the first tile LoD levels to be loaded should be the ones that would be selected based on distance from the camera at the time of loading. The 2nd pass of tiles to be loaded should be based on the direction the craft is moving. The 2nd LoD to be loaded should be a higher detail in the direction ahead of the craft, and a lower detail behind the craft. And so on for subsequent passes.&lt;br /&gt;
* Tile loading priority depends on the altitude, how fast the craft is moving, and whether it's likely to change direction - based on speed, flight history, or craft type (e.g. airliner compared to acrobatic craft). How soon new LoDs are needed depends on how large the tiles are. At high altitude, huge, low-detail tiles like LoDs 0/1/2 don't need to be loaded quickly even when flying fast. For fast moving craft at low altitude, small and detailed tiles like LoDs 6/5/4 need to be loaded fast e.g. for a supersonic jet doing a low pass. If the craft is changing direction rapidly at high speeds like when doing acrobatics it's harder to predict. Loading time for acrobatics at slower speeds don't matter much as there will be plenty of time to load terrain. &lt;br /&gt;
* For a lot of craft and flights it's safe to never load LoDs that are too different from the current requirements. Only tile LoDs close to the current altitude will be needed on a typical flight. This could reduce scenegraph nodes, and VRAM occupancy. For example, is unlikely to ever need 1x1 degree LoD 0 tiles for a glider - and a single prop craft is unlikely to need LoDs levels that are too different. By contrast a larger margin is needed for the Space Shuttle/SRBs which can quickly climb to orbit.&lt;br /&gt;
* Starting on the ground is probably a special case. Only LoDs that are in view are needed for a while. It would benefit development/testing if sim startup is fast, as well as being more pleasant to use. Maybe a dev mode that starts up after only loading the tile under the craft would be useful - often people are iterating on non-scenery things, or on scenery effects/materials on scenery tiles which can be placed close to the camera.&lt;br /&gt;
&lt;br /&gt;
==== Tile LoD algorithm ====&lt;br /&gt;
the following table shows the LoD level dependent on distance as well as the resulting grid size.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! LoD Level !! Degrees (per side) !! N-S Length (km) !! E-W Length (km) !! N-S Mesh resolution (m) !! E-W Mesh resolution (m) !! Tile radius (km) !! LoD Range (km)&lt;br /&gt;
|-&lt;br /&gt;
| 0 || 1.000000 || 111.0 || 78.0 || 1734.4 || 1218.8 || 67.8 || 203.5&lt;br /&gt;
|-&lt;br /&gt;
| 1 || 0.500000 || 55.5 || 39.0 || 867.2 || 609.4 || 33.9 || 101.7&lt;br /&gt;
|-&lt;br /&gt;
| 2 || 0.250000 || 27.8 || 19.5 || 433.6 || 304.7 || 17.0 || 50.9&lt;br /&gt;
|-&lt;br /&gt;
| 3 || 0.125000 || 13.9 || 9.8 || 216.8 || 152.3 || 8.5 || 25.4&lt;br /&gt;
|-&lt;br /&gt;
| 4 || 0.062500 || 6.9 || 4.9 || 108.4 || 76.2 || 4.2 || 12.7&lt;br /&gt;
|-&lt;br /&gt;
| 5 || 0.031250 || 3.5 || 2.4 || 54.2 || 38.1 || 2.1 || 6.4&lt;br /&gt;
|-&lt;br /&gt;
| 6 || 0.015625 || 1.7 || 1.2 || 27.1 || 19.0 || 1.1 || 3.2&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Because the tiles are built using degrees, the resolution varies depending on your latitude.  The numbers above are for 45 degrees of latitude - the numbers for the equator are about 10% larger.  The NASADEM elevation rasters are at 1 arc-second resolution, so 30m at 45 degrees latitude, and so around full resolution on LOD level 6.&lt;br /&gt;
&lt;br /&gt;
A target 35nm away (63km) will be rendered on terrain at LoD level 2.&lt;br /&gt;
&lt;br /&gt;
===== Profiling =====&lt;br /&gt;
The worst case systems are likely to be old laptops, and tile LoD schemes need to be verified on those systems.&lt;br /&gt;
&lt;br /&gt;
===== Reducing number of tiles =====&lt;br /&gt;
Reducing the number of tiles reduces the CPU bottleneck from the OSG scenegraph traversal. Even if only a small number of tiles are being drawn, the presence of tile of other LoDs which are loaded but not needed could cause cull traversal to be very slow. RAM/VRAM occupancy is reduced - see the section on VRAM occupancy. See mailing list for a way of skipping OSG by using a couple of large vertex buffers for each tile LoD , and using a alternative landclass storage in memory.&lt;br /&gt;
&lt;br /&gt;
Size of most detailed tiles: doubling the size of the LoD 6 tile reduces tile count by just over 4x. It means LoD level 1 will be the same size as LoD level 6. So one LoD level is not needed, reducing the tile count by more than 4x.&lt;br /&gt;
&lt;br /&gt;
Increasing the size of the most detailed size means increasing the size of the landclass texture. It's likely the small size of the landclass textures means all of the texture gets cached, and allows doing lots of landclass lookups faster. However caching is designed so that local searching is fast. The landclass occupancy is also small - 1 channel 256x128 texture = 4 channel 64x32 texture. So it may not affect performance much. It's possible that increasing the landclass texture size makes landclass searches slower - and should be verified on older systems. It's possible to double the size of LoD 6, and skip LoD 5 - so LoD 4 to LoD 0 use the same size of texture. However, the scenery pop-in from LoD 6 to 4 will be big and probably noticeable.&lt;br /&gt;
&lt;br /&gt;
Tile LoD selection scheme&lt;br /&gt;
&lt;br /&gt;
To do&lt;br /&gt;
&lt;br /&gt;
== Shader info ==&lt;br /&gt;
''&amp;lt;small&amp;gt;v1, 13th Nov 2021.&amp;lt;/small&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
=== Uniforms ===&lt;br /&gt;
&lt;br /&gt;
The following Uniforms are generated by VPBTechnique itself, and do not need to be defined in ws30.eff:&lt;br /&gt;
* &amp;lt;code&amp;gt;uniform int tile_level;&amp;lt;/code&amp;gt;  The tile LoD Level&lt;br /&gt;
* &amp;lt;code&amp;gt;uniform float tile_width;&amp;lt;/code&amp;gt;  The tile width (E-W) in m&lt;br /&gt;
* &amp;lt;code&amp;gt;uniform float tile_height;&amp;lt;/code&amp;gt; The tile height (N-S) in m&lt;br /&gt;
* &amp;lt;code&amp;gt;uniform bool photoScenery;&amp;lt;/code&amp;gt; Whether a photo scenery is enabled and available for this tile&lt;br /&gt;
* &amp;lt;code&amp;gt;uniform vec4 dimensionsArray[128];&amp;lt;/code&amp;gt;  The dimensions of a given atlas texture index&lt;br /&gt;
* &amp;lt;code&amp;gt;uniform vec4 ambientArray[128];&amp;lt;/code&amp;gt;  The ambient color of a give atlas texture index&lt;br /&gt;
* &amp;lt;code&amp;gt;uniform vec4 diffuseArray[128];&amp;lt;/code&amp;gt; The diffuse color of a give atlas texture index &lt;br /&gt;
* &amp;lt;code&amp;gt;uniform vec4 specularArray[128];&amp;lt;/code&amp;gt; The specular color of a give atlas texture index&lt;br /&gt;
* &amp;lt;code&amp;gt;uniform mat4 zUpTransform;&amp;lt;/code&amp;gt; The matrix to rotate a given vertex in model space into a z-up frame&lt;br /&gt;
* &amp;lt;code&amp;gt;uniform vec3 modelOffset;&amp;lt;/code&amp;gt; The origin of this tile in earth centered coordinates&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Possible things old/exotic compilers/GPUs may throw errors or have rendering issues with ====&lt;br /&gt;
It's possible there are some old compilers out there that may have issues with WS3. Maybe there are compilers that barely support glsl 1.3. Maybe compilers for mobile or newer GPU vendors might have the odd issue: Intel integrated, Intel discrete (Iris), Apple GPUs (M1 and newer), AMD APUs. Maybe some Linux opensource drivers will throw issues. &lt;br /&gt;
&lt;br /&gt;
These are some possible future culprits that weren't present in WS2:&lt;br /&gt;
&lt;br /&gt;
- Addressing vectors by index instead of member e.g. v[2] instead of v.z&lt;br /&gt;
&lt;br /&gt;
- TextureGrad() - possible to use textureLoD and manually calculate lod - GLSL 1.30. dFdx()/DFdy() - GLSL 1.20. TextureSize() - GLSL 1.30&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=141357</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=141357"/>
		<updated>2025-02-14T12:52:16Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Adapt to newest version of script&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 bin scripts&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 --raster &amp;lt;input-raster&amp;gt; [ option ... ]&lt;br /&gt;
Usage: genVPB.py --bbox &amp;lt;lat0&amp;gt; &amp;lt;lon0&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon1&amp;gt; --sentinel --reclass &amp;lt;reclass&amp;gt; [ option ... ]&lt;br /&gt;
&lt;br /&gt;
  Arguments:&lt;br /&gt;
&lt;br /&gt;
  --raster &amp;lt;input-raster&amp;gt;   - Input landclass raster&lt;br /&gt;
  --bbox &amp;lt;lat0&amp;gt; &amp;lt;lon0&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon1&amp;gt; - Bounding box of scenery to be generated.&lt;br /&gt;
  --sentinel &amp;lt;raster-dir&amp;gt;   - Using Sentinel-2 Landclass data from &amp;lt;raster-dir&amp;gt;&lt;br /&gt;
  --auto-download           - Auto-download Sentinel-2 Landclass data.  Only valid with --sentinel&lt;br /&gt;
  --hgt-dir &amp;lt;hgt-dir&amp;gt;       - Set directory containing unzipped NASADEM HGT files. Defaults to '{DEFAULT_HGT_DIR}'.&lt;br /&gt;
  --output-dir &amp;lt;output-dir&amp;gt; - Set output directory. Defaults to '{DEFAULT_OUTPUT_DIR}'.&lt;br /&gt;
  --reclass &amp;lt;reclass&amp;gt;       - Reclassify raster using file &amp;lt;reclass&amp;gt;. See fgmeta/ws30/mappings/.&lt;br /&gt;
  --coastline &amp;lt;coastline&amp;gt;   - Clip against coastline against polygon (.osm).  E.g. from https://osmdata.openstreetmap.de/data/land-polygons.html.&lt;br /&gt;
  --shrink-water &amp;lt;pixels&amp;gt;   - Shrink water bodies (landclasses 40, 41) by &amp;lt;pixels&amp;gt; pixels, typically in combination with generating a water raster.&lt;br /&gt;
  --generate-water-raster   - Generate a water raster from OSM data.&lt;br /&gt;
  --cache-dir &amp;lt;dir&amp;gt;         - Use &amp;lt;dir&amp;gt; as a cache of OSM data to improve performance and reduce load on Overpass API.&lt;br /&gt;
  --nasadem-server &amp;lt;server&amp;gt; - Set server to download NASADEM data from. Defaults to {getNASADEM.DEFAULT_SERVER}&lt;br /&gt;
  --nasadem-user &amp;lt;user&amp;gt;     - NASA Earthdata username. Required to download NASADEM automatically. To create a username, see https://urs.earthdata.nasa.gov/users/new/.&lt;br /&gt;
  --nasadem-password &amp;lt;password&amp;gt; - NASA Earthdata password. Required to download NASADEM automatically.&lt;br /&gt;
  --debug                   - Debug output, generate intermediate geoTIFFs and don't compress output.&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;
&amp;lt;code&amp;gt;./scripts/genVPB.py --bbox -55 -3 56 -2 --raster ./data/uk_wgs84_10m_N54.tif&amp;lt;/code&amp;gt;&lt;br /&gt;
&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;
&lt;br /&gt;
Usage: genwaterraster.py &amp;lt;min-lat&amp;gt; &amp;lt;min-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;max-lon&amp;gt; &amp;lt;scenery-dir&amp;gt; [cache-dir]&lt;br /&gt;
&lt;br /&gt;
  &amp;lt;min-lat&amp;gt; &amp;lt;min-lon&amp;gt; &amp;lt;max-lat&amp;gt; &amp;lt;max-lon - bounding box of water to generated&lt;br /&gt;
  &amp;lt;scenery_dir&amp;gt;  Scenery directory to write to&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/vpb directory created above.  For example, to generate water for the area around Edinburgh:&lt;br /&gt;
 &amp;lt;code&amp;gt;./scripts/genwaterraster.py 55 -4 56 -3 ./output/vpb ./cache&amp;lt;/code&amp;gt;&lt;br /&gt;
&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 &amp;lt;code&amp;gt;Landclass&amp;lt;/code&amp;gt; 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. You input e.g. SE and SW coordinates and calculate to get the distance in Km. Then you multiply by thousand and devide by the number of metres per pixel (e.g. 5) -&amp;gt; resolution for width.&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 (NB: East, West, South, North). 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;
=== Clipping a Raster Layer with OSM Data for Land (Corine) ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following multi-stage process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
==== Download OSM Land Data ====&lt;br /&gt;
&lt;br /&gt;
Download land polygons based on OSM data as a Shapefile from [https://osmdata.openstreetmap.de/data/land-polygons.html Land Polygons] and make sure to pick the WGS84 projected download with split polygons (&amp;quot;Large polygons are split, use for larger scales&amp;quot;). Once downloaded unzip the content into a directory.&lt;br /&gt;
&lt;br /&gt;
==== Reclassifying the OSM Land Data Vector Layer ====&lt;br /&gt;
I QGIS make sure that only the layer for the raster for land data is selected (e.g. &amp;lt;code&amp;gt;land-polygons-split-4326&amp;lt;/code&amp;gt;) -&amp;gt; in the map view you will see the whole earth. NB: typically you do this reclassify only once after download and can reuse the result for future processing.&lt;br /&gt;
&lt;br /&gt;
Then: &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 dialogue&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;lt;code&amp;gt;Integer (32 bit)&amp;lt;/code&amp;gt;. This will create a new column which we will populate with the correct land class data&lt;br /&gt;
* On top of the table on the left side choose &amp;quot;Landclass&amp;quot; in the drop-down menu, then input &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; into the field to the right and then press button &amp;quot;Update&amp;quot; all to the left of this field.&lt;br /&gt;
* Wait a bit and the close the dialogue.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save your changes (overwrite e.g. &amp;lt;code&amp;gt;land-polygons-split-4326&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Convert the Land Data from Vector to Raster ====&lt;br /&gt;
Do the same as in chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; above. The only difference is that the Input layer will be the land data polygons and you need to choose a different file name for the &amp;quot;Rasterized&amp;quot; (e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
&lt;br /&gt;
==== Remove Novalue Entries in the Land Data Raster ====&lt;br /&gt;
To do this:&lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Processing-&amp;gt;Toolbox&amp;lt;/code&amp;gt;. You should see a new box on the right side.&lt;br /&gt;
* Write &amp;quot;gdal_calc&amp;quot; in the search box and you should see an entry &amp;quot;Raster calculator&amp;quot;. Double click on it and you will get a new dialogue window.&lt;br /&gt;
* In this dialogue:&lt;br /&gt;
** For &amp;quot;Input layer A&amp;quot; choose the raster from the previous chapter ((e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
** In field &amp;quot;Calculation in gdalnumeric ...&amp;quot; write: &amp;lt;code&amp;gt;greater(A,0) * A&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Output raster type&amp;quot; choose &amp;lt;code&amp;gt;Byte&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Advanced Parameters&amp;quot; choose Profile &amp;lt;code&amp;gt;No compression&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Additional command-line parameters&amp;quot; write: &amp;lt;code&amp;gt;--hideNoData&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Calculated&amp;quot; choose a file (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
** (In the &amp;quot;GDAL/OGR console call&amp;quot; it will have something similar to the follwing - just with different paths: &amp;lt;code&amp;gt;gdal_calc.py --overwrite --calc &amp;quot;greater(A ,0) * A&amp;quot; --format GTiff --type Byte -A /home/vanosten/custom-fg-scenery/data/osm_land_scotland_5m.tif --A_band 1 --co COMPRESS=NONE --co BIGTIFF=IF_NEEDED --hideNoData --outfile /home/vanosten/custom-fg-scenery/data/osm_land_scotland_allvalues_5m.tif&amp;lt;/code&amp;gt;&lt;br /&gt;
** Press the &amp;quot;Run&amp;quot; button - and when complete close the dialogue.&lt;br /&gt;
&lt;br /&gt;
You should now see a map only black and white. You can check for correctness by pressing &amp;lt;code&amp;gt;CTRL+SHIFT+I&amp;lt;/code&amp;gt; to get a cursor with an arrow and an &amp;quot;i&amp;quot;. First make sure the new raster is selected on the left side. Next click on the sea/ocean and then check in the &amp;quot;Identify Results&amp;quot; window on the right that the value is &amp;lt; 2. The click on the land and check that the value is 2.&lt;br /&gt;
&lt;br /&gt;
==== Create the Final Clipped Corine Raster Against OSM Land Data =====&lt;br /&gt;
Do the following:&lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that you have only the following two layers: the basis Corine raster (see chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; - here e.g. corine_raster_scotland_5m.tif) and plus the raster from the previous step (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Raster-&amp;gt;Raster Calculator ...&amp;lt;/code&amp;gt; and a corresponding dialogue will open showing on the left hand side the two rasters.&lt;br /&gt;
* Choose a new &amp;quot;Output layer&amp;quot; (e.g. corine_raster_scotland_clipped_5m.tif).&lt;br /&gt;
* In the &amp;quot;Raster Calculator Expression&amp;quot; field input: &amp;lt;code&amp;gt;if (&amp;quot;osm_land_scotland_all_data_5m@1&amp;quot; &amp;lt; 2, 44, &amp;quot;corine_raster_scotland_5m@1&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Press button &amp;quot;OK&amp;quot; and wait a while (you will see a new dialogue with showing the progress.&lt;br /&gt;
&lt;br /&gt;
Done. You have now a raster (e.g. corine_raster_scotland_clipped_5m.tif) which does not have land in areas, where OSM data has sea/ocean.&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;
=== Optional Python script to process NLCD for the USA ===&lt;br /&gt;
You can optionally process the NLCD by loading this script in the python console of the QGIS Desktop program.&lt;br /&gt;
&lt;br /&gt;
If you save the NLCD tiff's using the same consistent naming convention used in this example it is fairly simple to generate final WS3.0 tiff's to use to generate the scenery.&lt;br /&gt;
&lt;br /&gt;
You will start with an original tree layer and a land cover layer from the MRLC.gov site. See the section &amp;quot;Obtaining NLCD&amp;quot; in the above &amp;quot;Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator&amp;quot; topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, to start with you will have a couple files named...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
In the QGIS program the layer names you start with will be...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork&lt;br /&gt;
&lt;br /&gt;
which will refer to the tiff files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running this script will generate a bunch of intermediate files including the last file, that will be the final finished file for running in the VPB script or VPB build environment Docker image.&lt;br /&gt;
&lt;br /&gt;
The last file for this example for New York would be, NLCD_2021_Land_Cover_NewYork_Final-HD_4326.tiff&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from qgis.core import QgsProject, QgsRasterLayer, QgsCoordinateReferenceSystem, QgsProcessingException&lt;br /&gt;
from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry&lt;br /&gt;
from osgeo import gdal, osr&lt;br /&gt;
import os&lt;br /&gt;
import numpy&lt;br /&gt;
import numpy as np&lt;br /&gt;
import processing&lt;br /&gt;
import subprocess&lt;br /&gt;
&lt;br /&gt;
# Define input layer names, change according to your file names&lt;br /&gt;
year = '2021';&lt;br /&gt;
state = 'Kentucky';&lt;br /&gt;
part = '';&lt;br /&gt;
&lt;br /&gt;
tree_canopy_layer_name = 'NLCD_' + year +  '_Tree_Canopy_' + state + part&lt;br /&gt;
land_cover_layer_name = 'NLCD_' + year +  '_Land_Cover_' + state + part&lt;br /&gt;
&lt;br /&gt;
extent = None&lt;br /&gt;
&lt;br /&gt;
################################################## Step 1: Reclass tree canopy to one landcover type 41, 42, or 43 #########################################&lt;br /&gt;
&lt;br /&gt;
# Define input and output paths&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Trees-Combined.tiff'&lt;br /&gt;
    &lt;br /&gt;
# Retrieve input layers from the project using iface for land cover layer&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(tree_canopy_layer_name)[0]&lt;br /&gt;
# Set the layers as the active layer&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
# Retrieve input layers from the project using iface&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()  &lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A &amp;gt; 0) * 41 + '&lt;br /&gt;
    '(A &amp;lt;= 0) * A'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Trees-Combined')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 1: Calculate result_tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Trees-Combined)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################# Step 2: Warp tree canopy to 4326 #############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Trees-Combined')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_tree_canopy.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 2: Warp tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Tree_Canopy_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################### Step 3: Warp land cover 4326 ############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Land_Cover_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(land_cover_layer_name)[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_land_cover.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 3: Warp land_cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Land_Cover_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################ Step 4: Combine land cover 4326 and tree canopy 4326######################################&lt;br /&gt;
  &lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
warped_tree_canopy_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')[0]&lt;br /&gt;
warped_land_cover_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')[0]&lt;br /&gt;
iface.setActiveLayer(warped_tree_canopy_layer)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(warped_land_cover_layer)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((B &amp;gt; 0) &amp;amp; (B != 41) &amp;amp; (B != 42) &amp;amp; (B != 43) &amp;amp; (A &amp;gt; 0)) * A + '&lt;br /&gt;
    '((B == 41) | (B == 42) | (B == 43) | (A &amp;lt;= 0)) * B'&lt;br /&gt;
   )&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '-B', input_layer_land_cover.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Combined_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 4: Combine tree canopy and land cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 5: Replace urban and clutter with grass ###################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Grass-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 11) * 41 + '&lt;br /&gt;
    '(A == 12) * 34 + '&lt;br /&gt;
    '(A == 21) * 26 + '&lt;br /&gt;
    '(A == 22) * 26 + '&lt;br /&gt;
    '(A == 23) * 26 + '&lt;br /&gt;
    '(A == 24) * 26 + '&lt;br /&gt;
    '(A == 31) * 27 + '&lt;br /&gt;
    '(A == 41) * 23 + '&lt;br /&gt;
    '(A == 42) * 24 + '&lt;br /&gt;
    '(A == 43) * 25 + '&lt;br /&gt;
    '(A == 51) * 30 + '&lt;br /&gt;
    '(A == 52) * 29 + '&lt;br /&gt;
    '(A == 71) * 26 + '&lt;br /&gt;
    '(A == 72) * 32 + '&lt;br /&gt;
    '(A == 73) * 31 + '&lt;br /&gt;
    '(A == 74) * 31 + '&lt;br /&gt;
    '(A == 75) * 32 + '&lt;br /&gt;
    '(A == 81) * 18 + '&lt;br /&gt;
    '(A == 82) * 19 + '&lt;br /&gt;
    '(A == 90) * 25 + '&lt;br /&gt;
    '(A == 95) * 35'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_grass_only_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_grass_only_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 5: Calculate result_grass_only completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Grass-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################## Step 6: Reclass urban 21, 22, 23 or 24 ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 21)*10 + '&lt;br /&gt;
    '(A == 22)*1 + '&lt;br /&gt;
    '(A == 23)*1 + '&lt;br /&gt;
    '(A == 24)*2'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_urban_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_urban_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 6: Calculate result_urban completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################ Step 7: Remove clutter and roads from urban ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 7: Remove clutter and roads from urban. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 8: Combine grass only and clean urban #########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined-Clean_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
grass_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')[0]&lt;br /&gt;
urban_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')[0]&lt;br /&gt;
iface.setActiveLayer(urban_only_layer)&lt;br /&gt;
input_urban_only = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(grass_only_layer)&lt;br /&gt;
input_grass_only = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((A &amp;gt; 0) &amp;amp; (B &amp;gt; 0)) * A + '&lt;br /&gt;
    '((A &amp;lt;= 0) | (B &amp;lt;= 0)) * B + (B == 0) * 44'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_urban_only.source(),&lt;br /&gt;
    '-B', input_grass_only.source(),&lt;br /&gt;
    '--type=Byte',&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
# Resample the combined raster to a different resolution&lt;br /&gt;
output_path_resampled = output_path.replace(&amp;quot;_4326.tiff&amp;quot;, &amp;quot;_HD_4326.tiff&amp;quot;)&lt;br /&gt;
gdal.Warp(&lt;br /&gt;
    output_path_resampled,&lt;br /&gt;
    output_path,&lt;br /&gt;
    xRes=0.00005539416,&lt;br /&gt;
    yRes=0.00005539416&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
urban_grass_combined = QgsRasterLayer(output_path_resampled, 'NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(urban_grass_combined)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 8: Combined and clean completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined-Clean_HD_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################## Step 9: Smooth all hi res features #################################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_HD_4326.tiff'&lt;br /&gt;
    &lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)  &lt;br /&gt;
&lt;br /&gt;
# Convert output to Byte using gdal_translate&lt;br /&gt;
converted_output_path = output_path.replace(&amp;quot;_HD_4326.tiff&amp;quot;, &amp;quot;_Final-HD_4326.tiff&amp;quot;)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_translate',&lt;br /&gt;
    '-ot', 'Byte',  # Set output data type to Byte&lt;br /&gt;
    output_path,&lt;br /&gt;
    converted_output_path&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(converted_output_path, 'NLCD_' + year +  '_' + state + part + '_Final-HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 9: Smooth all hi res features completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Final-HD_4326)&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=141356</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=141356"/>
		<updated>2025-02-14T12:33:23Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Update list of arguments etc. to newest version&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 bin scripts&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 --raster &amp;lt;input-raster&amp;gt; [ option ... ]&lt;br /&gt;
Usage: genVPB.py --bbox &amp;lt;lat0&amp;gt; &amp;lt;lon0&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon1&amp;gt; --sentinel --reclass &amp;lt;reclass&amp;gt; [ option ... ]&lt;br /&gt;
&lt;br /&gt;
  Arguments:&lt;br /&gt;
&lt;br /&gt;
  --raster &amp;lt;input-raster&amp;gt;   - Input landclass raster&lt;br /&gt;
  --bbox &amp;lt;lat0&amp;gt; &amp;lt;lon0&amp;gt; &amp;lt;lat1&amp;gt; &amp;lt;lon1&amp;gt; - Bounding box of scenery to be generated.&lt;br /&gt;
  --sentinel &amp;lt;raster-dir&amp;gt;   - Using Sentinel-2 Landclass data from &amp;lt;raster-dir&amp;gt;&lt;br /&gt;
  --auto-download           - Auto-download Sentinel-2 Landclass data.  Only valid with --sentinel&lt;br /&gt;
  --hgt-dir &amp;lt;hgt-dir&amp;gt;       - Set directory containing unzipped NASADEM HGT files. Defaults to '{DEFAULT_HGT_DIR}'.&lt;br /&gt;
  --output-dir &amp;lt;output-dir&amp;gt; - Set output directory. Defaults to '{DEFAULT_OUTPUT_DIR}'.&lt;br /&gt;
  --reclass &amp;lt;reclass&amp;gt;       - Reclassify raster using file &amp;lt;reclass&amp;gt;. See fgmeta/ws30/mappings/.&lt;br /&gt;
  --coastline &amp;lt;coastline&amp;gt;   - Clip against coastline against polygon (.osm).  E.g. from https://osmdata.openstreetmap.de/data/land-polygons.html.&lt;br /&gt;
  --shrink-water &amp;lt;pixels&amp;gt;   - Shrink water bodies (landclasses 40, 41) by &amp;lt;pixels&amp;gt; pixels, typically in combination with generating a water raster.&lt;br /&gt;
  --generate-water-raster   - Generate a water raster from OSM data.&lt;br /&gt;
  --cache-dir &amp;lt;dir&amp;gt;         - Use &amp;lt;dir&amp;gt; as a cache of OSM data to improve performance and reduce load on Overpass API.&lt;br /&gt;
  --nasadem-server &amp;lt;server&amp;gt; - Set server to download NASADEM data from. Defaults to {getNASADEM.DEFAULT_SERVER}&lt;br /&gt;
  --nasadem-user &amp;lt;user&amp;gt;     - NASA Earthdata username. Required to download NASADEM automatically. To create a username, see https://urs.earthdata.nasa.gov/users/new/.&lt;br /&gt;
  --nasadem-password &amp;lt;password&amp;gt; - NASA Earthdata password. Required to download NASADEM automatically.&lt;br /&gt;
  --debug                   - Debug output, generate intermediate geoTIFFs and don't compress output.&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;
&amp;lt;code&amp;gt;./scripts/genVPB.py --bbox -55 -3 56 -2 --raster ./data/uk_wgs84_10m_N54.tif&amp;lt;/code&amp;gt;&lt;br /&gt;
&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/genwaterraster.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 &amp;lt;code&amp;gt;Landclass&amp;lt;/code&amp;gt; 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. You input e.g. SE and SW coordinates and calculate to get the distance in Km. Then you multiply by thousand and devide by the number of metres per pixel (e.g. 5) -&amp;gt; resolution for width.&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 (NB: East, West, South, North). 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;
=== Clipping a Raster Layer with OSM Data for Land (Corine) ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following multi-stage process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
==== Download OSM Land Data ====&lt;br /&gt;
&lt;br /&gt;
Download land polygons based on OSM data as a Shapefile from [https://osmdata.openstreetmap.de/data/land-polygons.html Land Polygons] and make sure to pick the WGS84 projected download with split polygons (&amp;quot;Large polygons are split, use for larger scales&amp;quot;). Once downloaded unzip the content into a directory.&lt;br /&gt;
&lt;br /&gt;
==== Reclassifying the OSM Land Data Vector Layer ====&lt;br /&gt;
I QGIS make sure that only the layer for the raster for land data is selected (e.g. &amp;lt;code&amp;gt;land-polygons-split-4326&amp;lt;/code&amp;gt;) -&amp;gt; in the map view you will see the whole earth. NB: typically you do this reclassify only once after download and can reuse the result for future processing.&lt;br /&gt;
&lt;br /&gt;
Then: &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 dialogue&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;lt;code&amp;gt;Integer (32 bit)&amp;lt;/code&amp;gt;. This will create a new column which we will populate with the correct land class data&lt;br /&gt;
* On top of the table on the left side choose &amp;quot;Landclass&amp;quot; in the drop-down menu, then input &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; into the field to the right and then press button &amp;quot;Update&amp;quot; all to the left of this field.&lt;br /&gt;
* Wait a bit and the close the dialogue.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save your changes (overwrite e.g. &amp;lt;code&amp;gt;land-polygons-split-4326&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Convert the Land Data from Vector to Raster ====&lt;br /&gt;
Do the same as in chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; above. The only difference is that the Input layer will be the land data polygons and you need to choose a different file name for the &amp;quot;Rasterized&amp;quot; (e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
&lt;br /&gt;
==== Remove Novalue Entries in the Land Data Raster ====&lt;br /&gt;
To do this:&lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Processing-&amp;gt;Toolbox&amp;lt;/code&amp;gt;. You should see a new box on the right side.&lt;br /&gt;
* Write &amp;quot;gdal_calc&amp;quot; in the search box and you should see an entry &amp;quot;Raster calculator&amp;quot;. Double click on it and you will get a new dialogue window.&lt;br /&gt;
* In this dialogue:&lt;br /&gt;
** For &amp;quot;Input layer A&amp;quot; choose the raster from the previous chapter ((e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
** In field &amp;quot;Calculation in gdalnumeric ...&amp;quot; write: &amp;lt;code&amp;gt;greater(A,0) * A&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Output raster type&amp;quot; choose &amp;lt;code&amp;gt;Byte&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Advanced Parameters&amp;quot; choose Profile &amp;lt;code&amp;gt;No compression&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Additional command-line parameters&amp;quot; write: &amp;lt;code&amp;gt;--hideNoData&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Calculated&amp;quot; choose a file (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
** (In the &amp;quot;GDAL/OGR console call&amp;quot; it will have something similar to the follwing - just with different paths: &amp;lt;code&amp;gt;gdal_calc.py --overwrite --calc &amp;quot;greater(A ,0) * A&amp;quot; --format GTiff --type Byte -A /home/vanosten/custom-fg-scenery/data/osm_land_scotland_5m.tif --A_band 1 --co COMPRESS=NONE --co BIGTIFF=IF_NEEDED --hideNoData --outfile /home/vanosten/custom-fg-scenery/data/osm_land_scotland_allvalues_5m.tif&amp;lt;/code&amp;gt;&lt;br /&gt;
** Press the &amp;quot;Run&amp;quot; button - and when complete close the dialogue.&lt;br /&gt;
&lt;br /&gt;
You should now see a map only black and white. You can check for correctness by pressing &amp;lt;code&amp;gt;CTRL+SHIFT+I&amp;lt;/code&amp;gt; to get a cursor with an arrow and an &amp;quot;i&amp;quot;. First make sure the new raster is selected on the left side. Next click on the sea/ocean and then check in the &amp;quot;Identify Results&amp;quot; window on the right that the value is &amp;lt; 2. The click on the land and check that the value is 2.&lt;br /&gt;
&lt;br /&gt;
==== Create the Final Clipped Corine Raster Against OSM Land Data =====&lt;br /&gt;
Do the following:&lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that you have only the following two layers: the basis Corine raster (see chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; - here e.g. corine_raster_scotland_5m.tif) and plus the raster from the previous step (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Raster-&amp;gt;Raster Calculator ...&amp;lt;/code&amp;gt; and a corresponding dialogue will open showing on the left hand side the two rasters.&lt;br /&gt;
* Choose a new &amp;quot;Output layer&amp;quot; (e.g. corine_raster_scotland_clipped_5m.tif).&lt;br /&gt;
* In the &amp;quot;Raster Calculator Expression&amp;quot; field input: &amp;lt;code&amp;gt;if (&amp;quot;osm_land_scotland_all_data_5m@1&amp;quot; &amp;lt; 2, 44, &amp;quot;corine_raster_scotland_5m@1&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Press button &amp;quot;OK&amp;quot; and wait a while (you will see a new dialogue with showing the progress.&lt;br /&gt;
&lt;br /&gt;
Done. You have now a raster (e.g. corine_raster_scotland_clipped_5m.tif) which does not have land in areas, where OSM data has sea/ocean.&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;
=== Optional Python script to process NLCD for the USA ===&lt;br /&gt;
You can optionally process the NLCD by loading this script in the python console of the QGIS Desktop program.&lt;br /&gt;
&lt;br /&gt;
If you save the NLCD tiff's using the same consistent naming convention used in this example it is fairly simple to generate final WS3.0 tiff's to use to generate the scenery.&lt;br /&gt;
&lt;br /&gt;
You will start with an original tree layer and a land cover layer from the MRLC.gov site. See the section &amp;quot;Obtaining NLCD&amp;quot; in the above &amp;quot;Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator&amp;quot; topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, to start with you will have a couple files named...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
In the QGIS program the layer names you start with will be...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork&lt;br /&gt;
&lt;br /&gt;
which will refer to the tiff files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running this script will generate a bunch of intermediate files including the last file, that will be the final finished file for running in the VPB script or VPB build environment Docker image.&lt;br /&gt;
&lt;br /&gt;
The last file for this example for New York would be, NLCD_2021_Land_Cover_NewYork_Final-HD_4326.tiff&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from qgis.core import QgsProject, QgsRasterLayer, QgsCoordinateReferenceSystem, QgsProcessingException&lt;br /&gt;
from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry&lt;br /&gt;
from osgeo import gdal, osr&lt;br /&gt;
import os&lt;br /&gt;
import numpy&lt;br /&gt;
import numpy as np&lt;br /&gt;
import processing&lt;br /&gt;
import subprocess&lt;br /&gt;
&lt;br /&gt;
# Define input layer names, change according to your file names&lt;br /&gt;
year = '2021';&lt;br /&gt;
state = 'Kentucky';&lt;br /&gt;
part = '';&lt;br /&gt;
&lt;br /&gt;
tree_canopy_layer_name = 'NLCD_' + year +  '_Tree_Canopy_' + state + part&lt;br /&gt;
land_cover_layer_name = 'NLCD_' + year +  '_Land_Cover_' + state + part&lt;br /&gt;
&lt;br /&gt;
extent = None&lt;br /&gt;
&lt;br /&gt;
################################################## Step 1: Reclass tree canopy to one landcover type 41, 42, or 43 #########################################&lt;br /&gt;
&lt;br /&gt;
# Define input and output paths&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Trees-Combined.tiff'&lt;br /&gt;
    &lt;br /&gt;
# Retrieve input layers from the project using iface for land cover layer&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(tree_canopy_layer_name)[0]&lt;br /&gt;
# Set the layers as the active layer&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
# Retrieve input layers from the project using iface&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()  &lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A &amp;gt; 0) * 41 + '&lt;br /&gt;
    '(A &amp;lt;= 0) * A'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Trees-Combined')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 1: Calculate result_tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Trees-Combined)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################# Step 2: Warp tree canopy to 4326 #############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Trees-Combined')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_tree_canopy.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 2: Warp tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Tree_Canopy_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################### Step 3: Warp land cover 4326 ############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Land_Cover_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(land_cover_layer_name)[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_land_cover.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 3: Warp land_cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Land_Cover_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################ Step 4: Combine land cover 4326 and tree canopy 4326######################################&lt;br /&gt;
  &lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
warped_tree_canopy_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')[0]&lt;br /&gt;
warped_land_cover_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')[0]&lt;br /&gt;
iface.setActiveLayer(warped_tree_canopy_layer)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(warped_land_cover_layer)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((B &amp;gt; 0) &amp;amp; (B != 41) &amp;amp; (B != 42) &amp;amp; (B != 43) &amp;amp; (A &amp;gt; 0)) * A + '&lt;br /&gt;
    '((B == 41) | (B == 42) | (B == 43) | (A &amp;lt;= 0)) * B'&lt;br /&gt;
   )&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '-B', input_layer_land_cover.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Combined_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 4: Combine tree canopy and land cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 5: Replace urban and clutter with grass ###################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Grass-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 11) * 41 + '&lt;br /&gt;
    '(A == 12) * 34 + '&lt;br /&gt;
    '(A == 21) * 26 + '&lt;br /&gt;
    '(A == 22) * 26 + '&lt;br /&gt;
    '(A == 23) * 26 + '&lt;br /&gt;
    '(A == 24) * 26 + '&lt;br /&gt;
    '(A == 31) * 27 + '&lt;br /&gt;
    '(A == 41) * 23 + '&lt;br /&gt;
    '(A == 42) * 24 + '&lt;br /&gt;
    '(A == 43) * 25 + '&lt;br /&gt;
    '(A == 51) * 30 + '&lt;br /&gt;
    '(A == 52) * 29 + '&lt;br /&gt;
    '(A == 71) * 26 + '&lt;br /&gt;
    '(A == 72) * 32 + '&lt;br /&gt;
    '(A == 73) * 31 + '&lt;br /&gt;
    '(A == 74) * 31 + '&lt;br /&gt;
    '(A == 75) * 32 + '&lt;br /&gt;
    '(A == 81) * 18 + '&lt;br /&gt;
    '(A == 82) * 19 + '&lt;br /&gt;
    '(A == 90) * 25 + '&lt;br /&gt;
    '(A == 95) * 35'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_grass_only_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_grass_only_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 5: Calculate result_grass_only completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Grass-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################## Step 6: Reclass urban 21, 22, 23 or 24 ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 21)*10 + '&lt;br /&gt;
    '(A == 22)*1 + '&lt;br /&gt;
    '(A == 23)*1 + '&lt;br /&gt;
    '(A == 24)*2'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_urban_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_urban_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 6: Calculate result_urban completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################ Step 7: Remove clutter and roads from urban ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 7: Remove clutter and roads from urban. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 8: Combine grass only and clean urban #########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined-Clean_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
grass_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')[0]&lt;br /&gt;
urban_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')[0]&lt;br /&gt;
iface.setActiveLayer(urban_only_layer)&lt;br /&gt;
input_urban_only = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(grass_only_layer)&lt;br /&gt;
input_grass_only = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((A &amp;gt; 0) &amp;amp; (B &amp;gt; 0)) * A + '&lt;br /&gt;
    '((A &amp;lt;= 0) | (B &amp;lt;= 0)) * B + (B == 0) * 44'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_urban_only.source(),&lt;br /&gt;
    '-B', input_grass_only.source(),&lt;br /&gt;
    '--type=Byte',&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
# Resample the combined raster to a different resolution&lt;br /&gt;
output_path_resampled = output_path.replace(&amp;quot;_4326.tiff&amp;quot;, &amp;quot;_HD_4326.tiff&amp;quot;)&lt;br /&gt;
gdal.Warp(&lt;br /&gt;
    output_path_resampled,&lt;br /&gt;
    output_path,&lt;br /&gt;
    xRes=0.00005539416,&lt;br /&gt;
    yRes=0.00005539416&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
urban_grass_combined = QgsRasterLayer(output_path_resampled, 'NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(urban_grass_combined)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 8: Combined and clean completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined-Clean_HD_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################## Step 9: Smooth all hi res features #################################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_HD_4326.tiff'&lt;br /&gt;
    &lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)  &lt;br /&gt;
&lt;br /&gt;
# Convert output to Byte using gdal_translate&lt;br /&gt;
converted_output_path = output_path.replace(&amp;quot;_HD_4326.tiff&amp;quot;, &amp;quot;_Final-HD_4326.tiff&amp;quot;)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_translate',&lt;br /&gt;
    '-ot', 'Byte',  # Set output data type to Byte&lt;br /&gt;
    output_path,&lt;br /&gt;
    converted_output_path&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(converted_output_path, 'NLCD_' + year +  '_' + state + part + '_Final-HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 9: Smooth all hi res features completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Final-HD_4326)&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=141355</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=141355"/>
		<updated>2025-02-14T10:41:46Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Highlight landclass column&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 bin scripts&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/genwaterraster.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 &amp;lt;code&amp;gt;Landclass&amp;lt;/code&amp;gt; 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. You input e.g. SE and SW coordinates and calculate to get the distance in Km. Then you multiply by thousand and devide by the number of metres per pixel (e.g. 5) -&amp;gt; resolution for width.&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 (NB: East, West, South, North). 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;
=== Clipping a Raster Layer with OSM Data for Land (Corine) ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following multi-stage process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
==== Download OSM Land Data ====&lt;br /&gt;
&lt;br /&gt;
Download land polygons based on OSM data as a Shapefile from [https://osmdata.openstreetmap.de/data/land-polygons.html Land Polygons] and make sure to pick the WGS84 projected download with split polygons (&amp;quot;Large polygons are split, use for larger scales&amp;quot;). Once downloaded unzip the content into a directory.&lt;br /&gt;
&lt;br /&gt;
==== Reclassifying the OSM Land Data Vector Layer ====&lt;br /&gt;
I QGIS make sure that only the layer for the raster for land data is selected (e.g. &amp;lt;code&amp;gt;land-polygons-split-4326&amp;lt;/code&amp;gt;) -&amp;gt; in the map view you will see the whole earth. NB: typically you do this reclassify only once after download and can reuse the result for future processing.&lt;br /&gt;
&lt;br /&gt;
Then: &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 dialogue&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;lt;code&amp;gt;Integer (32 bit)&amp;lt;/code&amp;gt;. This will create a new column which we will populate with the correct land class data&lt;br /&gt;
* On top of the table on the left side choose &amp;quot;Landclass&amp;quot; in the drop-down menu, then input &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; into the field to the right and then press button &amp;quot;Update&amp;quot; all to the left of this field.&lt;br /&gt;
* Wait a bit and the close the dialogue.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save your changes (overwrite e.g. &amp;lt;code&amp;gt;land-polygons-split-4326&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Convert the Land Data from Vector to Raster ====&lt;br /&gt;
Do the same as in chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; above. The only difference is that the Input layer will be the land data polygons and you need to choose a different file name for the &amp;quot;Rasterized&amp;quot; (e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
&lt;br /&gt;
==== Remove Novalue Entries in the Land Data Raster ====&lt;br /&gt;
To do this:&lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Processing-&amp;gt;Toolbox&amp;lt;/code&amp;gt;. You should see a new box on the right side.&lt;br /&gt;
* Write &amp;quot;gdal_calc&amp;quot; in the search box and you should see an entry &amp;quot;Raster calculator&amp;quot;. Double click on it and you will get a new dialogue window.&lt;br /&gt;
* In this dialogue:&lt;br /&gt;
** For &amp;quot;Input layer A&amp;quot; choose the raster from the previous chapter ((e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
** In field &amp;quot;Calculation in gdalnumeric ...&amp;quot; write: &amp;lt;code&amp;gt;greater(A,0) * A&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Output raster type&amp;quot; choose &amp;lt;code&amp;gt;Byte&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Advanced Parameters&amp;quot; choose Profile &amp;lt;code&amp;gt;No compression&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Additional command-line parameters&amp;quot; write: &amp;lt;code&amp;gt;--hideNoData&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Calculated&amp;quot; choose a file (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
** (In the &amp;quot;GDAL/OGR console call&amp;quot; it will have something similar to the follwing - just with different paths: &amp;lt;code&amp;gt;gdal_calc.py --overwrite --calc &amp;quot;greater(A ,0) * A&amp;quot; --format GTiff --type Byte -A /home/vanosten/custom-fg-scenery/data/osm_land_scotland_5m.tif --A_band 1 --co COMPRESS=NONE --co BIGTIFF=IF_NEEDED --hideNoData --outfile /home/vanosten/custom-fg-scenery/data/osm_land_scotland_allvalues_5m.tif&amp;lt;/code&amp;gt;&lt;br /&gt;
** Press the &amp;quot;Run&amp;quot; button - and when complete close the dialogue.&lt;br /&gt;
&lt;br /&gt;
You should now see a map only black and white. You can check for correctness by pressing &amp;lt;code&amp;gt;CTRL+SHIFT+I&amp;lt;/code&amp;gt; to get a cursor with an arrow and an &amp;quot;i&amp;quot;. First make sure the new raster is selected on the left side. Next click on the sea/ocean and then check in the &amp;quot;Identify Results&amp;quot; window on the right that the value is &amp;lt; 2. The click on the land and check that the value is 2.&lt;br /&gt;
&lt;br /&gt;
==== Create the Final Clipped Corine Raster Against OSM Land Data =====&lt;br /&gt;
Do the following:&lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that you have only the following two layers: the basis Corine raster (see chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; - here e.g. corine_raster_scotland_5m.tif) and plus the raster from the previous step (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Raster-&amp;gt;Raster Calculator ...&amp;lt;/code&amp;gt; and a corresponding dialogue will open showing on the left hand side the two rasters.&lt;br /&gt;
* Choose a new &amp;quot;Output layer&amp;quot; (e.g. corine_raster_scotland_clipped_5m.tif).&lt;br /&gt;
* In the &amp;quot;Raster Calculator Expression&amp;quot; field input: &amp;lt;code&amp;gt;if (&amp;quot;osm_land_scotland_all_data_5m@1&amp;quot; &amp;lt; 2, 44, &amp;quot;corine_raster_scotland_5m@1&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Press button &amp;quot;OK&amp;quot; and wait a while (you will see a new dialogue with showing the progress.&lt;br /&gt;
&lt;br /&gt;
Done. You have now a raster (e.g. corine_raster_scotland_clipped_5m.tif) which does not have land in areas, where OSM data has sea/ocean.&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;
=== Optional Python script to process NLCD for the USA ===&lt;br /&gt;
You can optionally process the NLCD by loading this script in the python console of the QGIS Desktop program.&lt;br /&gt;
&lt;br /&gt;
If you save the NLCD tiff's using the same consistent naming convention used in this example it is fairly simple to generate final WS3.0 tiff's to use to generate the scenery.&lt;br /&gt;
&lt;br /&gt;
You will start with an original tree layer and a land cover layer from the MRLC.gov site. See the section &amp;quot;Obtaining NLCD&amp;quot; in the above &amp;quot;Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator&amp;quot; topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, to start with you will have a couple files named...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
In the QGIS program the layer names you start with will be...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork&lt;br /&gt;
&lt;br /&gt;
which will refer to the tiff files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running this script will generate a bunch of intermediate files including the last file, that will be the final finished file for running in the VPB script or VPB build environment Docker image.&lt;br /&gt;
&lt;br /&gt;
The last file for this example for New York would be, NLCD_2021_Land_Cover_NewYork_Final-HD_4326.tiff&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from qgis.core import QgsProject, QgsRasterLayer, QgsCoordinateReferenceSystem, QgsProcessingException&lt;br /&gt;
from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry&lt;br /&gt;
from osgeo import gdal, osr&lt;br /&gt;
import os&lt;br /&gt;
import numpy&lt;br /&gt;
import numpy as np&lt;br /&gt;
import processing&lt;br /&gt;
import subprocess&lt;br /&gt;
&lt;br /&gt;
# Define input layer names, change according to your file names&lt;br /&gt;
year = '2021';&lt;br /&gt;
state = 'Kentucky';&lt;br /&gt;
part = '';&lt;br /&gt;
&lt;br /&gt;
tree_canopy_layer_name = 'NLCD_' + year +  '_Tree_Canopy_' + state + part&lt;br /&gt;
land_cover_layer_name = 'NLCD_' + year +  '_Land_Cover_' + state + part&lt;br /&gt;
&lt;br /&gt;
extent = None&lt;br /&gt;
&lt;br /&gt;
################################################## Step 1: Reclass tree canopy to one landcover type 41, 42, or 43 #########################################&lt;br /&gt;
&lt;br /&gt;
# Define input and output paths&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Trees-Combined.tiff'&lt;br /&gt;
    &lt;br /&gt;
# Retrieve input layers from the project using iface for land cover layer&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(tree_canopy_layer_name)[0]&lt;br /&gt;
# Set the layers as the active layer&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
# Retrieve input layers from the project using iface&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()  &lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A &amp;gt; 0) * 41 + '&lt;br /&gt;
    '(A &amp;lt;= 0) * A'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Trees-Combined')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 1: Calculate result_tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Trees-Combined)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################# Step 2: Warp tree canopy to 4326 #############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Trees-Combined')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_tree_canopy.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 2: Warp tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Tree_Canopy_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################### Step 3: Warp land cover 4326 ############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Land_Cover_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(land_cover_layer_name)[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_land_cover.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 3: Warp land_cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Land_Cover_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################ Step 4: Combine land cover 4326 and tree canopy 4326######################################&lt;br /&gt;
  &lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
warped_tree_canopy_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')[0]&lt;br /&gt;
warped_land_cover_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')[0]&lt;br /&gt;
iface.setActiveLayer(warped_tree_canopy_layer)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(warped_land_cover_layer)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((B &amp;gt; 0) &amp;amp; (B != 41) &amp;amp; (B != 42) &amp;amp; (B != 43) &amp;amp; (A &amp;gt; 0)) * A + '&lt;br /&gt;
    '((B == 41) | (B == 42) | (B == 43) | (A &amp;lt;= 0)) * B'&lt;br /&gt;
   )&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '-B', input_layer_land_cover.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Combined_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 4: Combine tree canopy and land cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 5: Replace urban and clutter with grass ###################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Grass-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 11) * 41 + '&lt;br /&gt;
    '(A == 12) * 34 + '&lt;br /&gt;
    '(A == 21) * 26 + '&lt;br /&gt;
    '(A == 22) * 26 + '&lt;br /&gt;
    '(A == 23) * 26 + '&lt;br /&gt;
    '(A == 24) * 26 + '&lt;br /&gt;
    '(A == 31) * 27 + '&lt;br /&gt;
    '(A == 41) * 23 + '&lt;br /&gt;
    '(A == 42) * 24 + '&lt;br /&gt;
    '(A == 43) * 25 + '&lt;br /&gt;
    '(A == 51) * 30 + '&lt;br /&gt;
    '(A == 52) * 29 + '&lt;br /&gt;
    '(A == 71) * 26 + '&lt;br /&gt;
    '(A == 72) * 32 + '&lt;br /&gt;
    '(A == 73) * 31 + '&lt;br /&gt;
    '(A == 74) * 31 + '&lt;br /&gt;
    '(A == 75) * 32 + '&lt;br /&gt;
    '(A == 81) * 18 + '&lt;br /&gt;
    '(A == 82) * 19 + '&lt;br /&gt;
    '(A == 90) * 25 + '&lt;br /&gt;
    '(A == 95) * 35'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_grass_only_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_grass_only_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 5: Calculate result_grass_only completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Grass-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################## Step 6: Reclass urban 21, 22, 23 or 24 ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 21)*10 + '&lt;br /&gt;
    '(A == 22)*1 + '&lt;br /&gt;
    '(A == 23)*1 + '&lt;br /&gt;
    '(A == 24)*2'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_urban_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_urban_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 6: Calculate result_urban completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################ Step 7: Remove clutter and roads from urban ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 7: Remove clutter and roads from urban. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 8: Combine grass only and clean urban #########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined-Clean_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
grass_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')[0]&lt;br /&gt;
urban_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')[0]&lt;br /&gt;
iface.setActiveLayer(urban_only_layer)&lt;br /&gt;
input_urban_only = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(grass_only_layer)&lt;br /&gt;
input_grass_only = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((A &amp;gt; 0) &amp;amp; (B &amp;gt; 0)) * A + '&lt;br /&gt;
    '((A &amp;lt;= 0) | (B &amp;lt;= 0)) * B + (B == 0) * 44'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_urban_only.source(),&lt;br /&gt;
    '-B', input_grass_only.source(),&lt;br /&gt;
    '--type=Byte',&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
# Resample the combined raster to a different resolution&lt;br /&gt;
output_path_resampled = output_path.replace(&amp;quot;_4326.tiff&amp;quot;, &amp;quot;_HD_4326.tiff&amp;quot;)&lt;br /&gt;
gdal.Warp(&lt;br /&gt;
    output_path_resampled,&lt;br /&gt;
    output_path,&lt;br /&gt;
    xRes=0.00005539416,&lt;br /&gt;
    yRes=0.00005539416&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
urban_grass_combined = QgsRasterLayer(output_path_resampled, 'NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(urban_grass_combined)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 8: Combined and clean completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined-Clean_HD_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################## Step 9: Smooth all hi res features #################################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_HD_4326.tiff'&lt;br /&gt;
    &lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)  &lt;br /&gt;
&lt;br /&gt;
# Convert output to Byte using gdal_translate&lt;br /&gt;
converted_output_path = output_path.replace(&amp;quot;_HD_4326.tiff&amp;quot;, &amp;quot;_Final-HD_4326.tiff&amp;quot;)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_translate',&lt;br /&gt;
    '-ot', 'Byte',  # Set output data type to Byte&lt;br /&gt;
    output_path,&lt;br /&gt;
    converted_output_path&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(converted_output_path, 'NLCD_' + year +  '_' + state + part + '_Final-HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 9: Smooth all hi res features completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Final-HD_4326)&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=141347</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=141347"/>
		<updated>2025-02-14T10:11:32Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Better explanation what to open and only do it once.&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 bin scripts&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/genwaterraster.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. You input e.g. SE and SW coordinates and calculate to get the distance in Km. Then you multiply by thousand and devide by the number of metres per pixel (e.g. 5) -&amp;gt; resolution for width.&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 (NB: East, West, South, North). 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;
=== Clipping a Raster Layer with OSM Data for Land (Corine) ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following multi-stage process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
==== Download OSM Land Data ====&lt;br /&gt;
&lt;br /&gt;
Download land polygons based on OSM data as a Shapefile from [https://osmdata.openstreetmap.de/data/land-polygons.html Land Polygons] and make sure to pick the WGS84 projected download with split polygons (&amp;quot;Large polygons are split, use for larger scales&amp;quot;). Once downloaded unzip the content into a directory.&lt;br /&gt;
&lt;br /&gt;
==== Reclassifying the OSM Land Data Vector Layer ====&lt;br /&gt;
I QGIS make sure that only the layer for the raster for land data is selected (e.g. &amp;lt;code&amp;gt;land-polygons-split-4326&amp;lt;/code&amp;gt;) -&amp;gt; in the map view you will see the whole earth. NB: typically you do this reclassify only once after download and can reuse the result for future processing.&lt;br /&gt;
&lt;br /&gt;
Then: &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 dialogue&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;lt;code&amp;gt;Integer (32 bit)&amp;lt;/code&amp;gt;. This will create a new column which we will populate with the correct land class data&lt;br /&gt;
* On top of the table on the left side choose &amp;quot;Landclass&amp;quot; in the drop-down menu, then input &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; into the field to the right and then press button &amp;quot;Update&amp;quot; all to the left of this field.&lt;br /&gt;
* Wait a bit and the close the dialogue.&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Layer-&amp;gt;Save Layer Edits&amp;lt;/code&amp;gt; to save your changes (overwrite e.g. &amp;lt;code&amp;gt;land-polygons-split-4326&amp;lt;/code&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
==== Convert the Land Data from Vector to Raster ====&lt;br /&gt;
Do the same as in chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; above. The only difference is that the Input layer will be the land data polygons and you need to choose a different file name for the &amp;quot;Rasterized&amp;quot; (e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
&lt;br /&gt;
==== Remove Novalue Entries in the Land Data Raster ====&lt;br /&gt;
To do this:&lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Processing-&amp;gt;Toolbox&amp;lt;/code&amp;gt;. You should see a new box on the right side.&lt;br /&gt;
* Write &amp;quot;gdal_calc&amp;quot; in the search box and you should see an entry &amp;quot;Raster calculator&amp;quot;. Double click on it and you will get a new dialogue window.&lt;br /&gt;
* In this dialogue:&lt;br /&gt;
** For &amp;quot;Input layer A&amp;quot; choose the raster from the previous chapter ((e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
** In field &amp;quot;Calculation in gdalnumeric ...&amp;quot; write: &amp;lt;code&amp;gt;greater(A,0) * A&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Output raster type&amp;quot; choose &amp;lt;code&amp;gt;Byte&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Advanced Parameters&amp;quot; choose Profile &amp;lt;code&amp;gt;No compression&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Additional command-line parameters&amp;quot; write: &amp;lt;code&amp;gt;--hideNoData&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Calculated&amp;quot; choose a file (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
** (In the &amp;quot;GDAL/OGR console call&amp;quot; it will have something similar to the follwing - just with different paths: &amp;lt;code&amp;gt;gdal_calc.py --overwrite --calc &amp;quot;greater(A ,0) * A&amp;quot; --format GTiff --type Byte -A /home/vanosten/custom-fg-scenery/data/osm_land_scotland_5m.tif --A_band 1 --co COMPRESS=NONE --co BIGTIFF=IF_NEEDED --hideNoData --outfile /home/vanosten/custom-fg-scenery/data/osm_land_scotland_allvalues_5m.tif&amp;lt;/code&amp;gt;&lt;br /&gt;
** Press the &amp;quot;Run&amp;quot; button - and when complete close the dialogue.&lt;br /&gt;
&lt;br /&gt;
You should now see a map only black and white. You can check for correctness by pressing &amp;lt;code&amp;gt;CTRL+SHIFT+I&amp;lt;/code&amp;gt; to get a cursor with an arrow and an &amp;quot;i&amp;quot;. First make sure the new raster is selected on the left side. Next click on the sea/ocean and then check in the &amp;quot;Identify Results&amp;quot; window on the right that the value is &amp;lt; 2. The click on the land and check that the value is 2.&lt;br /&gt;
&lt;br /&gt;
==== Create the Final Clipped Corine Raster Against OSM Land Data =====&lt;br /&gt;
Do the following:&lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that you have only the following two layers: the basis Corine raster (see chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; - here e.g. corine_raster_scotland_5m.tif) and plus the raster from the previous step (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Raster-&amp;gt;Raster Calculator ...&amp;lt;/code&amp;gt; and a corresponding dialogue will open showing on the left hand side the two rasters.&lt;br /&gt;
* Choose a new &amp;quot;Output layer&amp;quot; (e.g. corine_raster_scotland_clipped_5m.tif).&lt;br /&gt;
* In the &amp;quot;Raster Calculator Expression&amp;quot; field input: &amp;lt;code&amp;gt;if (&amp;quot;osm_land_scotland_all_data_5m@1&amp;quot; &amp;lt; 2, 44, &amp;quot;corine_raster_scotland_5m@1&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Press button &amp;quot;OK&amp;quot; and wait a while (you will see a new dialogue with showing the progress.&lt;br /&gt;
&lt;br /&gt;
Done. You have now a raster (e.g. corine_raster_scotland_clipped_5m.tif) which does not have land in areas, where OSM data has sea/ocean.&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;
=== Optional Python script to process NLCD for the USA ===&lt;br /&gt;
You can optionally process the NLCD by loading this script in the python console of the QGIS Desktop program.&lt;br /&gt;
&lt;br /&gt;
If you save the NLCD tiff's using the same consistent naming convention used in this example it is fairly simple to generate final WS3.0 tiff's to use to generate the scenery.&lt;br /&gt;
&lt;br /&gt;
You will start with an original tree layer and a land cover layer from the MRLC.gov site. See the section &amp;quot;Obtaining NLCD&amp;quot; in the above &amp;quot;Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator&amp;quot; topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, to start with you will have a couple files named...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
In the QGIS program the layer names you start with will be...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork&lt;br /&gt;
&lt;br /&gt;
which will refer to the tiff files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running this script will generate a bunch of intermediate files including the last file, that will be the final finished file for running in the VPB script or VPB build environment Docker image.&lt;br /&gt;
&lt;br /&gt;
The last file for this example for New York would be, NLCD_2021_Land_Cover_NewYork_Final-HD_4326.tiff&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from qgis.core import QgsProject, QgsRasterLayer, QgsCoordinateReferenceSystem, QgsProcessingException&lt;br /&gt;
from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry&lt;br /&gt;
from osgeo import gdal, osr&lt;br /&gt;
import os&lt;br /&gt;
import numpy&lt;br /&gt;
import numpy as np&lt;br /&gt;
import processing&lt;br /&gt;
import subprocess&lt;br /&gt;
&lt;br /&gt;
# Define input layer names, change according to your file names&lt;br /&gt;
year = '2021';&lt;br /&gt;
state = 'Kentucky';&lt;br /&gt;
part = '';&lt;br /&gt;
&lt;br /&gt;
tree_canopy_layer_name = 'NLCD_' + year +  '_Tree_Canopy_' + state + part&lt;br /&gt;
land_cover_layer_name = 'NLCD_' + year +  '_Land_Cover_' + state + part&lt;br /&gt;
&lt;br /&gt;
extent = None&lt;br /&gt;
&lt;br /&gt;
################################################## Step 1: Reclass tree canopy to one landcover type 41, 42, or 43 #########################################&lt;br /&gt;
&lt;br /&gt;
# Define input and output paths&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Trees-Combined.tiff'&lt;br /&gt;
    &lt;br /&gt;
# Retrieve input layers from the project using iface for land cover layer&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(tree_canopy_layer_name)[0]&lt;br /&gt;
# Set the layers as the active layer&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
# Retrieve input layers from the project using iface&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()  &lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A &amp;gt; 0) * 41 + '&lt;br /&gt;
    '(A &amp;lt;= 0) * A'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Trees-Combined')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 1: Calculate result_tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Trees-Combined)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################# Step 2: Warp tree canopy to 4326 #############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Trees-Combined')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_tree_canopy.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 2: Warp tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Tree_Canopy_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################### Step 3: Warp land cover 4326 ############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Land_Cover_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(land_cover_layer_name)[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_land_cover.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 3: Warp land_cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Land_Cover_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################ Step 4: Combine land cover 4326 and tree canopy 4326######################################&lt;br /&gt;
  &lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
warped_tree_canopy_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')[0]&lt;br /&gt;
warped_land_cover_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')[0]&lt;br /&gt;
iface.setActiveLayer(warped_tree_canopy_layer)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(warped_land_cover_layer)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((B &amp;gt; 0) &amp;amp; (B != 41) &amp;amp; (B != 42) &amp;amp; (B != 43) &amp;amp; (A &amp;gt; 0)) * A + '&lt;br /&gt;
    '((B == 41) | (B == 42) | (B == 43) | (A &amp;lt;= 0)) * B'&lt;br /&gt;
   )&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '-B', input_layer_land_cover.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Combined_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 4: Combine tree canopy and land cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 5: Replace urban and clutter with grass ###################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Grass-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 11) * 41 + '&lt;br /&gt;
    '(A == 12) * 34 + '&lt;br /&gt;
    '(A == 21) * 26 + '&lt;br /&gt;
    '(A == 22) * 26 + '&lt;br /&gt;
    '(A == 23) * 26 + '&lt;br /&gt;
    '(A == 24) * 26 + '&lt;br /&gt;
    '(A == 31) * 27 + '&lt;br /&gt;
    '(A == 41) * 23 + '&lt;br /&gt;
    '(A == 42) * 24 + '&lt;br /&gt;
    '(A == 43) * 25 + '&lt;br /&gt;
    '(A == 51) * 30 + '&lt;br /&gt;
    '(A == 52) * 29 + '&lt;br /&gt;
    '(A == 71) * 26 + '&lt;br /&gt;
    '(A == 72) * 32 + '&lt;br /&gt;
    '(A == 73) * 31 + '&lt;br /&gt;
    '(A == 74) * 31 + '&lt;br /&gt;
    '(A == 75) * 32 + '&lt;br /&gt;
    '(A == 81) * 18 + '&lt;br /&gt;
    '(A == 82) * 19 + '&lt;br /&gt;
    '(A == 90) * 25 + '&lt;br /&gt;
    '(A == 95) * 35'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_grass_only_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_grass_only_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 5: Calculate result_grass_only completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Grass-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################## Step 6: Reclass urban 21, 22, 23 or 24 ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 21)*10 + '&lt;br /&gt;
    '(A == 22)*1 + '&lt;br /&gt;
    '(A == 23)*1 + '&lt;br /&gt;
    '(A == 24)*2'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_urban_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_urban_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 6: Calculate result_urban completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################ Step 7: Remove clutter and roads from urban ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 7: Remove clutter and roads from urban. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 8: Combine grass only and clean urban #########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined-Clean_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
grass_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')[0]&lt;br /&gt;
urban_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')[0]&lt;br /&gt;
iface.setActiveLayer(urban_only_layer)&lt;br /&gt;
input_urban_only = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(grass_only_layer)&lt;br /&gt;
input_grass_only = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((A &amp;gt; 0) &amp;amp; (B &amp;gt; 0)) * A + '&lt;br /&gt;
    '((A &amp;lt;= 0) | (B &amp;lt;= 0)) * B + (B == 0) * 44'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_urban_only.source(),&lt;br /&gt;
    '-B', input_grass_only.source(),&lt;br /&gt;
    '--type=Byte',&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
# Resample the combined raster to a different resolution&lt;br /&gt;
output_path_resampled = output_path.replace(&amp;quot;_4326.tiff&amp;quot;, &amp;quot;_HD_4326.tiff&amp;quot;)&lt;br /&gt;
gdal.Warp(&lt;br /&gt;
    output_path_resampled,&lt;br /&gt;
    output_path,&lt;br /&gt;
    xRes=0.00005539416,&lt;br /&gt;
    yRes=0.00005539416&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
urban_grass_combined = QgsRasterLayer(output_path_resampled, 'NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(urban_grass_combined)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 8: Combined and clean completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined-Clean_HD_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################## Step 9: Smooth all hi res features #################################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_HD_4326.tiff'&lt;br /&gt;
    &lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)  &lt;br /&gt;
&lt;br /&gt;
# Convert output to Byte using gdal_translate&lt;br /&gt;
converted_output_path = output_path.replace(&amp;quot;_HD_4326.tiff&amp;quot;, &amp;quot;_Final-HD_4326.tiff&amp;quot;)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_translate',&lt;br /&gt;
    '-ot', 'Byte',  # Set output data type to Byte&lt;br /&gt;
    output_path,&lt;br /&gt;
    converted_output_path&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(converted_output_path, 'NLCD_' + year +  '_' + state + part + '_Final-HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 9: Smooth all hi res features completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Final-HD_4326)&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=141346</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=141346"/>
		<updated>2025-02-14T09:48:57Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Reclassifying the OSM Land Data 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 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 bin scripts&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/genwaterraster.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. You input e.g. SE and SW coordinates and calculate to get the distance in Km. Then you multiply by thousand and devide by the number of metres per pixel (e.g. 5) -&amp;gt; resolution for width.&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 (NB: East, West, South, North). 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;
=== Clipping a Raster Layer with OSM Data for Land (Corine) ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following multi-stage process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
==== Download OSM Land Data ====&lt;br /&gt;
&lt;br /&gt;
Download land polygons based on OSM data as a Shapefile from [https://osmdata.openstreetmap.de/data/land-polygons.html Land Polygons] and make sure to pick the WGS84 projected download with split polygons (&amp;quot;Large polygons are split, use for larger scales&amp;quot;). Once downloaded unzip the content into a directory.&lt;br /&gt;
&lt;br /&gt;
==== Reclassifying the OSM Land Data Vector Layer ====&lt;br /&gt;
I QGIS make sure that only the layer for the raster from previous outputs is selected - e.g. corine_raster_scotland_5m.tif.&lt;br /&gt;
&lt;br /&gt;
Then: &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 dialogue&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;lt;code&amp;gt;Integer (32 bit)&amp;lt;/code&amp;gt;. This will create a new column which we will populate with the correct land class data&lt;br /&gt;
* On top of the table on the left side choose &amp;quot;Landclass&amp;quot; in the drop-down menu, then input &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; into the field to the right and then press button &amp;quot;Update&amp;quot; all to the left of this field.&lt;br /&gt;
* Wait a bit and the close the dialogue.&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;
==== Convert the Land Data from Vector to Raster ====&lt;br /&gt;
Do the same as in chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; above. The only difference is that the Input layer will be the land data polygons and you need to choose a different file name for the &amp;quot;Rasterized&amp;quot; (e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
&lt;br /&gt;
==== Remove Novalue Entries in the Land Data Raster ====&lt;br /&gt;
To do this:&lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Processing-&amp;gt;Toolbox&amp;lt;/code&amp;gt;. You should see a new box on the right side.&lt;br /&gt;
* Write &amp;quot;gdal_calc&amp;quot; in the search box and you should see an entry &amp;quot;Raster calculator&amp;quot;. Double click on it and you will get a new dialogue window.&lt;br /&gt;
* In this dialogue:&lt;br /&gt;
** For &amp;quot;Input layer A&amp;quot; choose the raster from the previous chapter ((e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
** In field &amp;quot;Calculation in gdalnumeric ...&amp;quot; write: &amp;lt;code&amp;gt;greater(A,0) * A&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Output raster type&amp;quot; choose &amp;lt;code&amp;gt;Byte&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Advanced Parameters&amp;quot; choose Profile &amp;lt;code&amp;gt;No compression&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Additional command-line parameters&amp;quot; write: &amp;lt;code&amp;gt;--hideNoData&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Calculated&amp;quot; choose a file (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
** (In the &amp;quot;GDAL/OGR console call&amp;quot; it will have something similar to the follwing - just with different paths: &amp;lt;code&amp;gt;gdal_calc.py --overwrite --calc &amp;quot;greater(A ,0) * A&amp;quot; --format GTiff --type Byte -A /home/vanosten/custom-fg-scenery/data/osm_land_scotland_5m.tif --A_band 1 --co COMPRESS=NONE --co BIGTIFF=IF_NEEDED --hideNoData --outfile /home/vanosten/custom-fg-scenery/data/osm_land_scotland_allvalues_5m.tif&amp;lt;/code&amp;gt;&lt;br /&gt;
** Press the &amp;quot;Run&amp;quot; button - and when complete close the dialogue.&lt;br /&gt;
&lt;br /&gt;
You should now see a map only black and white. You can check for correctness by pressing &amp;lt;code&amp;gt;CTRL+SHIFT+I&amp;lt;/code&amp;gt; to get a cursor with an arrow and an &amp;quot;i&amp;quot;. First make sure the new raster is selected on the left side. Next click on the sea/ocean and then check in the &amp;quot;Identify Results&amp;quot; window on the right that the value is &amp;lt; 2. The click on the land and check that the value is 2.&lt;br /&gt;
&lt;br /&gt;
==== Create the Final Clipped Corine Raster Against OSM Land Data =====&lt;br /&gt;
Do the following:&lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that you have only the following two layers: the basis Corine raster (see chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; - here e.g. corine_raster_scotland_5m.tif) and plus the raster from the previous step (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Raster-&amp;gt;Raster Calculator ...&amp;lt;/code&amp;gt; and a corresponding dialogue will open showing on the left hand side the two rasters.&lt;br /&gt;
* Choose a new &amp;quot;Output layer&amp;quot; (e.g. corine_raster_scotland_clipped_5m.tif).&lt;br /&gt;
* In the &amp;quot;Raster Calculator Expression&amp;quot; field input: &amp;lt;code&amp;gt;if (&amp;quot;osm_land_scotland_all_data_5m@1&amp;quot; &amp;lt; 2, 44, &amp;quot;corine_raster_scotland_5m@1&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Press button &amp;quot;OK&amp;quot; and wait a while (you will see a new dialogue with showing the progress.&lt;br /&gt;
&lt;br /&gt;
Done. You have now a raster (e.g. corine_raster_scotland_clipped_5m.tif) which does not have land in areas, where OSM data has sea/ocean.&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;
=== Optional Python script to process NLCD for the USA ===&lt;br /&gt;
You can optionally process the NLCD by loading this script in the python console of the QGIS Desktop program.&lt;br /&gt;
&lt;br /&gt;
If you save the NLCD tiff's using the same consistent naming convention used in this example it is fairly simple to generate final WS3.0 tiff's to use to generate the scenery.&lt;br /&gt;
&lt;br /&gt;
You will start with an original tree layer and a land cover layer from the MRLC.gov site. See the section &amp;quot;Obtaining NLCD&amp;quot; in the above &amp;quot;Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator&amp;quot; topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, to start with you will have a couple files named...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
In the QGIS program the layer names you start with will be...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork&lt;br /&gt;
&lt;br /&gt;
which will refer to the tiff files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running this script will generate a bunch of intermediate files including the last file, that will be the final finished file for running in the VPB script or VPB build environment Docker image.&lt;br /&gt;
&lt;br /&gt;
The last file for this example for New York would be, NLCD_2021_Land_Cover_NewYork_Final-HD_4326.tiff&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from qgis.core import QgsProject, QgsRasterLayer, QgsCoordinateReferenceSystem, QgsProcessingException&lt;br /&gt;
from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry&lt;br /&gt;
from osgeo import gdal, osr&lt;br /&gt;
import os&lt;br /&gt;
import numpy&lt;br /&gt;
import numpy as np&lt;br /&gt;
import processing&lt;br /&gt;
import subprocess&lt;br /&gt;
&lt;br /&gt;
# Define input layer names, change according to your file names&lt;br /&gt;
year = '2021';&lt;br /&gt;
state = 'Kentucky';&lt;br /&gt;
part = '';&lt;br /&gt;
&lt;br /&gt;
tree_canopy_layer_name = 'NLCD_' + year +  '_Tree_Canopy_' + state + part&lt;br /&gt;
land_cover_layer_name = 'NLCD_' + year +  '_Land_Cover_' + state + part&lt;br /&gt;
&lt;br /&gt;
extent = None&lt;br /&gt;
&lt;br /&gt;
################################################## Step 1: Reclass tree canopy to one landcover type 41, 42, or 43 #########################################&lt;br /&gt;
&lt;br /&gt;
# Define input and output paths&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Trees-Combined.tiff'&lt;br /&gt;
    &lt;br /&gt;
# Retrieve input layers from the project using iface for land cover layer&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(tree_canopy_layer_name)[0]&lt;br /&gt;
# Set the layers as the active layer&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
# Retrieve input layers from the project using iface&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()  &lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A &amp;gt; 0) * 41 + '&lt;br /&gt;
    '(A &amp;lt;= 0) * A'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Trees-Combined')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 1: Calculate result_tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Trees-Combined)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################# Step 2: Warp tree canopy to 4326 #############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Trees-Combined')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_tree_canopy.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 2: Warp tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Tree_Canopy_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################### Step 3: Warp land cover 4326 ############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Land_Cover_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(land_cover_layer_name)[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_land_cover.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 3: Warp land_cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Land_Cover_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################ Step 4: Combine land cover 4326 and tree canopy 4326######################################&lt;br /&gt;
  &lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
warped_tree_canopy_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')[0]&lt;br /&gt;
warped_land_cover_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')[0]&lt;br /&gt;
iface.setActiveLayer(warped_tree_canopy_layer)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(warped_land_cover_layer)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((B &amp;gt; 0) &amp;amp; (B != 41) &amp;amp; (B != 42) &amp;amp; (B != 43) &amp;amp; (A &amp;gt; 0)) * A + '&lt;br /&gt;
    '((B == 41) | (B == 42) | (B == 43) | (A &amp;lt;= 0)) * B'&lt;br /&gt;
   )&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '-B', input_layer_land_cover.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Combined_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 4: Combine tree canopy and land cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 5: Replace urban and clutter with grass ###################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Grass-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 11) * 41 + '&lt;br /&gt;
    '(A == 12) * 34 + '&lt;br /&gt;
    '(A == 21) * 26 + '&lt;br /&gt;
    '(A == 22) * 26 + '&lt;br /&gt;
    '(A == 23) * 26 + '&lt;br /&gt;
    '(A == 24) * 26 + '&lt;br /&gt;
    '(A == 31) * 27 + '&lt;br /&gt;
    '(A == 41) * 23 + '&lt;br /&gt;
    '(A == 42) * 24 + '&lt;br /&gt;
    '(A == 43) * 25 + '&lt;br /&gt;
    '(A == 51) * 30 + '&lt;br /&gt;
    '(A == 52) * 29 + '&lt;br /&gt;
    '(A == 71) * 26 + '&lt;br /&gt;
    '(A == 72) * 32 + '&lt;br /&gt;
    '(A == 73) * 31 + '&lt;br /&gt;
    '(A == 74) * 31 + '&lt;br /&gt;
    '(A == 75) * 32 + '&lt;br /&gt;
    '(A == 81) * 18 + '&lt;br /&gt;
    '(A == 82) * 19 + '&lt;br /&gt;
    '(A == 90) * 25 + '&lt;br /&gt;
    '(A == 95) * 35'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_grass_only_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_grass_only_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 5: Calculate result_grass_only completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Grass-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################## Step 6: Reclass urban 21, 22, 23 or 24 ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 21)*10 + '&lt;br /&gt;
    '(A == 22)*1 + '&lt;br /&gt;
    '(A == 23)*1 + '&lt;br /&gt;
    '(A == 24)*2'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_urban_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_urban_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 6: Calculate result_urban completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################ Step 7: Remove clutter and roads from urban ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 7: Remove clutter and roads from urban. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 8: Combine grass only and clean urban #########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined-Clean_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
grass_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')[0]&lt;br /&gt;
urban_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')[0]&lt;br /&gt;
iface.setActiveLayer(urban_only_layer)&lt;br /&gt;
input_urban_only = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(grass_only_layer)&lt;br /&gt;
input_grass_only = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((A &amp;gt; 0) &amp;amp; (B &amp;gt; 0)) * A + '&lt;br /&gt;
    '((A &amp;lt;= 0) | (B &amp;lt;= 0)) * B + (B == 0) * 44'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_urban_only.source(),&lt;br /&gt;
    '-B', input_grass_only.source(),&lt;br /&gt;
    '--type=Byte',&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
# Resample the combined raster to a different resolution&lt;br /&gt;
output_path_resampled = output_path.replace(&amp;quot;_4326.tiff&amp;quot;, &amp;quot;_HD_4326.tiff&amp;quot;)&lt;br /&gt;
gdal.Warp(&lt;br /&gt;
    output_path_resampled,&lt;br /&gt;
    output_path,&lt;br /&gt;
    xRes=0.00005539416,&lt;br /&gt;
    yRes=0.00005539416&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
urban_grass_combined = QgsRasterLayer(output_path_resampled, 'NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(urban_grass_combined)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 8: Combined and clean completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined-Clean_HD_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################## Step 9: Smooth all hi res features #################################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_HD_4326.tiff'&lt;br /&gt;
    &lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)  &lt;br /&gt;
&lt;br /&gt;
# Convert output to Byte using gdal_translate&lt;br /&gt;
converted_output_path = output_path.replace(&amp;quot;_HD_4326.tiff&amp;quot;, &amp;quot;_Final-HD_4326.tiff&amp;quot;)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_translate',&lt;br /&gt;
    '-ot', 'Byte',  # Set output data type to Byte&lt;br /&gt;
    output_path,&lt;br /&gt;
    converted_output_path&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(converted_output_path, 'NLCD_' + year +  '_' + state + part + '_Final-HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 9: Smooth all hi res features completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Final-HD_4326)&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=141345</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=141345"/>
		<updated>2025-02-14T09:26:56Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Better explanation for calculating pixels&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 bin scripts&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/genwaterraster.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. You input e.g. SE and SW coordinates and calculate to get the distance in Km. Then you multiply by thousand and devide by the number of metres per pixel (e.g. 5) -&amp;gt; resolution for width.&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 (NB: East, West, South, North). 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;
=== Clipping a Raster Layer with OSM Data for Land (Corine) ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following multi-stage process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
==== Download OSM Land Data ====&lt;br /&gt;
&lt;br /&gt;
Download land polygons based on OSM data as a Shapefile from [https://osmdata.openstreetmap.de/data/land-polygons.html Land Polygons] and make sure to pick the WGS84 projected download with split polygons (&amp;quot;Large polygons are split, use for larger scales&amp;quot;). Once downloaded unzip the content into a directory.&lt;br /&gt;
&lt;br /&gt;
==== Reclassifying the OSM Land Data Vector Layer ====&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 dialogue&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;lt;code&amp;gt;Integer (32 bit)&amp;lt;/code&amp;gt;. This will create a new column which we will populate with the correct land class data&lt;br /&gt;
* On top of the table on the left side choose &amp;quot;Landclass&amp;quot; in the drop-down menu, then input &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; into the field to the right and then press button &amp;quot;Update&amp;quot; all to the left of this field.&lt;br /&gt;
* Wait a bit and the close the dialogue.&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;
==== Convert the Land Data from Vector to Raster ====&lt;br /&gt;
Do the same as in chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; above. The only difference is that the Input layer will be the land data polygons and you need to choose a different file name for the &amp;quot;Rasterized&amp;quot; (e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
&lt;br /&gt;
==== Remove Novalue Entries in the Land Data Raster ====&lt;br /&gt;
To do this:&lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Processing-&amp;gt;Toolbox&amp;lt;/code&amp;gt;. You should see a new box on the right side.&lt;br /&gt;
* Write &amp;quot;gdal_calc&amp;quot; in the search box and you should see an entry &amp;quot;Raster calculator&amp;quot;. Double click on it and you will get a new dialogue window.&lt;br /&gt;
* In this dialogue:&lt;br /&gt;
** For &amp;quot;Input layer A&amp;quot; choose the raster from the previous chapter ((e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
** In field &amp;quot;Calculation in gdalnumeric ...&amp;quot; write: &amp;lt;code&amp;gt;greater(A,0) * A&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Output raster type&amp;quot; choose &amp;lt;code&amp;gt;Byte&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Advanced Parameters&amp;quot; choose Profile &amp;lt;code&amp;gt;No compression&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Additional command-line parameters&amp;quot; write: &amp;lt;code&amp;gt;--hideNoData&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Calculated&amp;quot; choose a file (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
** (In the &amp;quot;GDAL/OGR console call&amp;quot; it will have something similar to the follwing - just with different paths: &amp;lt;code&amp;gt;gdal_calc.py --overwrite --calc &amp;quot;greater(A ,0) * A&amp;quot; --format GTiff --type Byte -A /home/vanosten/custom-fg-scenery/data/osm_land_scotland_5m.tif --A_band 1 --co COMPRESS=NONE --co BIGTIFF=IF_NEEDED --hideNoData --outfile /home/vanosten/custom-fg-scenery/data/osm_land_scotland_allvalues_5m.tif&amp;lt;/code&amp;gt;&lt;br /&gt;
** Press the &amp;quot;Run&amp;quot; button - and when complete close the dialogue.&lt;br /&gt;
&lt;br /&gt;
You should now see a map only black and white. You can check for correctness by pressing &amp;lt;code&amp;gt;CTRL+SHIFT+I&amp;lt;/code&amp;gt; to get a cursor with an arrow and an &amp;quot;i&amp;quot;. First make sure the new raster is selected on the left side. Next click on the sea/ocean and then check in the &amp;quot;Identify Results&amp;quot; window on the right that the value is &amp;lt; 2. The click on the land and check that the value is 2.&lt;br /&gt;
&lt;br /&gt;
==== Create the Final Clipped Corine Raster Against OSM Land Data =====&lt;br /&gt;
Do the following:&lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that you have only the following two layers: the basis Corine raster (see chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; - here e.g. corine_raster_scotland_5m.tif) and plus the raster from the previous step (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Raster-&amp;gt;Raster Calculator ...&amp;lt;/code&amp;gt; and a corresponding dialogue will open showing on the left hand side the two rasters.&lt;br /&gt;
* Choose a new &amp;quot;Output layer&amp;quot; (e.g. corine_raster_scotland_clipped_5m.tif).&lt;br /&gt;
* In the &amp;quot;Raster Calculator Expression&amp;quot; field input: &amp;lt;code&amp;gt;if (&amp;quot;osm_land_scotland_all_data_5m@1&amp;quot; &amp;lt; 2, 44, &amp;quot;corine_raster_scotland_5m@1&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Press button &amp;quot;OK&amp;quot; and wait a while (you will see a new dialogue with showing the progress.&lt;br /&gt;
&lt;br /&gt;
Done. You have now a raster (e.g. corine_raster_scotland_clipped_5m.tif) which does not have land in areas, where OSM data has sea/ocean.&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;
=== Optional Python script to process NLCD for the USA ===&lt;br /&gt;
You can optionally process the NLCD by loading this script in the python console of the QGIS Desktop program.&lt;br /&gt;
&lt;br /&gt;
If you save the NLCD tiff's using the same consistent naming convention used in this example it is fairly simple to generate final WS3.0 tiff's to use to generate the scenery.&lt;br /&gt;
&lt;br /&gt;
You will start with an original tree layer and a land cover layer from the MRLC.gov site. See the section &amp;quot;Obtaining NLCD&amp;quot; in the above &amp;quot;Step By Step Procedure for Processing NLCD for the USA using the Raster Calculator&amp;quot; topic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For example, to start with you will have a couple files named...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork.tiff&lt;br /&gt;
&lt;br /&gt;
In the QGIS program the layer names you start with will be...&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Tree_Canopy_NewYork&lt;br /&gt;
&lt;br /&gt;
NLCD_2021_Land_Cover_NewYork&lt;br /&gt;
&lt;br /&gt;
which will refer to the tiff files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Running this script will generate a bunch of intermediate files including the last file, that will be the final finished file for running in the VPB script or VPB build environment Docker image.&lt;br /&gt;
&lt;br /&gt;
The last file for this example for New York would be, NLCD_2021_Land_Cover_NewYork_Final-HD_4326.tiff&amp;lt;syntaxhighlight lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from qgis.core import QgsProject, QgsRasterLayer, QgsCoordinateReferenceSystem, QgsProcessingException&lt;br /&gt;
from qgis.analysis import QgsRasterCalculator, QgsRasterCalculatorEntry&lt;br /&gt;
from osgeo import gdal, osr&lt;br /&gt;
import os&lt;br /&gt;
import numpy&lt;br /&gt;
import numpy as np&lt;br /&gt;
import processing&lt;br /&gt;
import subprocess&lt;br /&gt;
&lt;br /&gt;
# Define input layer names, change according to your file names&lt;br /&gt;
year = '2021';&lt;br /&gt;
state = 'Kentucky';&lt;br /&gt;
part = '';&lt;br /&gt;
&lt;br /&gt;
tree_canopy_layer_name = 'NLCD_' + year +  '_Tree_Canopy_' + state + part&lt;br /&gt;
land_cover_layer_name = 'NLCD_' + year +  '_Land_Cover_' + state + part&lt;br /&gt;
&lt;br /&gt;
extent = None&lt;br /&gt;
&lt;br /&gt;
################################################## Step 1: Reclass tree canopy to one landcover type 41, 42, or 43 #########################################&lt;br /&gt;
&lt;br /&gt;
# Define input and output paths&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Trees-Combined.tiff'&lt;br /&gt;
    &lt;br /&gt;
# Retrieve input layers from the project using iface for land cover layer&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(tree_canopy_layer_name)[0]&lt;br /&gt;
# Set the layers as the active layer&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
# Retrieve input layers from the project using iface&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()  &lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A &amp;gt; 0) * 41 + '&lt;br /&gt;
    '(A &amp;lt;= 0) * A'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Trees-Combined')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 1: Calculate result_tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Trees-Combined)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################# Step 2: Warp tree canopy to 4326 #############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Trees-Combined')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_tree_canopy.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 2: Warp tree_canopy completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Tree_Canopy_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################### Step 3: Warp land cover 4326 ############################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Land_Cover_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName(land_cover_layer_name)[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;gdal:warpreproject&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'INPUT':input_layer_land_cover.source(),&lt;br /&gt;
        'SOURCE_CRS':None,&lt;br /&gt;
        'TARGET_CRS':QgsCoordinateReferenceSystem('EPSG:4326'),&lt;br /&gt;
        'RESAMPLING':0,&lt;br /&gt;
        'NODATA':None,&lt;br /&gt;
        'TARGET_RESOLUTION':None,&lt;br /&gt;
        'OPTIONS':'',&lt;br /&gt;
        'DATA_TYPE':1,&lt;br /&gt;
        'TARGET_EXTENT':extent,&lt;br /&gt;
        'TARGET_EXTENT_CRS':None,&lt;br /&gt;
        'MULTITHREADING':False,&lt;br /&gt;
        'EXTRA':'',&lt;br /&gt;
        'OUTPUT':output_path&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 3: Warp land_cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Land_Cover_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################ Step 4: Combine land cover 4326 and tree canopy 4326######################################&lt;br /&gt;
  &lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
warped_tree_canopy_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Tree_Canopy_4326')[0]&lt;br /&gt;
warped_land_cover_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Land_Cover_4326')[0]&lt;br /&gt;
iface.setActiveLayer(warped_tree_canopy_layer)&lt;br /&gt;
input_layer_tree_canopy = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(warped_land_cover_layer)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((B &amp;gt; 0) &amp;amp; (B != 41) &amp;amp; (B != 42) &amp;amp; (B != 43) &amp;amp; (A &amp;gt; 0)) * A + '&lt;br /&gt;
    '((B == 41) | (B == 42) | (B == 43) | (A &amp;lt;= 0)) * B'&lt;br /&gt;
   )&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_layer_tree_canopy.source(),&lt;br /&gt;
    '-B', input_layer_land_cover.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_tree_canopy_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Combined_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_tree_canopy_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 4: Combine tree canopy and land cover completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 5: Replace urban and clutter with grass ###################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Grass-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 11) * 41 + '&lt;br /&gt;
    '(A == 12) * 34 + '&lt;br /&gt;
    '(A == 21) * 26 + '&lt;br /&gt;
    '(A == 22) * 26 + '&lt;br /&gt;
    '(A == 23) * 26 + '&lt;br /&gt;
    '(A == 24) * 26 + '&lt;br /&gt;
    '(A == 31) * 27 + '&lt;br /&gt;
    '(A == 41) * 23 + '&lt;br /&gt;
    '(A == 42) * 24 + '&lt;br /&gt;
    '(A == 43) * 25 + '&lt;br /&gt;
    '(A == 51) * 30 + '&lt;br /&gt;
    '(A == 52) * 29 + '&lt;br /&gt;
    '(A == 71) * 26 + '&lt;br /&gt;
    '(A == 72) * 32 + '&lt;br /&gt;
    '(A == 73) * 31 + '&lt;br /&gt;
    '(A == 74) * 31 + '&lt;br /&gt;
    '(A == 75) * 32 + '&lt;br /&gt;
    '(A == 81) * 18 + '&lt;br /&gt;
    '(A == 82) * 19 + '&lt;br /&gt;
    '(A == 90) * 25 + '&lt;br /&gt;
    '(A == 95) * 35'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_grass_only_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_grass_only_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 5: Calculate result_grass_only completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Grass-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
################################################################## Step 6: Reclass urban 21, 22, 23 or 24 ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
combined_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined_4326')[0]&lt;br /&gt;
iface.setActiveLayer(combined_layer)&lt;br /&gt;
input_combined_layer = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '(A == 21)*10 + '&lt;br /&gt;
    '(A == 22)*1 + '&lt;br /&gt;
    '(A == 23)*1 + '&lt;br /&gt;
    '(A == 24)*2'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_combined_layer.source(),&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_urban_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_urban_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 6: Calculate result_urban completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################ Step 7: Remove clutter and roads from urban ###########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Urban-Only_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(output_path, 'NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 7: Remove clutter and roads from urban. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Urban-Only_4326)&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
############################################################## Step 8: Combine grass only and clean urban #########################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_Combined-Clean_4326.tiff'&lt;br /&gt;
&lt;br /&gt;
grass_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Grass-Only_4326')[0]&lt;br /&gt;
urban_only_layer = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Urban-Only_4326')[0]&lt;br /&gt;
iface.setActiveLayer(urban_only_layer)&lt;br /&gt;
input_urban_only = iface.activeLayer()&lt;br /&gt;
iface.setActiveLayer(grass_only_layer)&lt;br /&gt;
input_grass_only = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
expression = (&lt;br /&gt;
    '((A &amp;gt; 0) &amp;amp; (B &amp;gt; 0)) * A + '&lt;br /&gt;
    '((A &amp;lt;= 0) | (B &amp;lt;= 0)) * B + (B == 0) * 44'&lt;br /&gt;
)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_calc.py',&lt;br /&gt;
    '-A', input_urban_only.source(),&lt;br /&gt;
    '-B', input_grass_only.source(),&lt;br /&gt;
    '--type=Byte',&lt;br /&gt;
    '--outfile', output_path,&lt;br /&gt;
    '--calc', expression&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
# Resample the combined raster to a different resolution&lt;br /&gt;
output_path_resampled = output_path.replace(&amp;quot;_4326.tiff&amp;quot;, &amp;quot;_HD_4326.tiff&amp;quot;)&lt;br /&gt;
gdal.Warp(&lt;br /&gt;
    output_path_resampled,&lt;br /&gt;
    output_path,&lt;br /&gt;
    xRes=0.00005539416,&lt;br /&gt;
    yRes=0.00005539416&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
urban_grass_combined = QgsRasterLayer(output_path_resampled, 'NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(urban_grass_combined)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 8: Combined and clean completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Combined-Clean_HD_4326)&amp;quot;)&lt;br /&gt;
    &lt;br /&gt;
################################################################## Step 9: Smooth all hi res features #################################################################&lt;br /&gt;
&lt;br /&gt;
output_path = 'G:/Scenery/ws3.0/' + state + '/data/NLCD_' + year +  '_' + state + part + '_HD_4326.tiff'&lt;br /&gt;
    &lt;br /&gt;
layer1 = QgsProject.instance().mapLayersByName('NLCD_' + year +  '_' + state + part + '_Combined-Clean_HD_4326')[0]&lt;br /&gt;
iface.setActiveLayer(layer1)&lt;br /&gt;
input_layer_land_cover = iface.activeLayer()&lt;br /&gt;
&lt;br /&gt;
processing.run(&lt;br /&gt;
    &amp;quot;grass7:r.neighbors&amp;quot;,&lt;br /&gt;
    {&lt;br /&gt;
        'input':input_layer_land_cover.source(),&lt;br /&gt;
        'selection':None,&lt;br /&gt;
        'method':1,&lt;br /&gt;
        'size':7,&lt;br /&gt;
        'gauss':None,&lt;br /&gt;
        'quantile':'',&lt;br /&gt;
        '-c':False,&lt;br /&gt;
        '-a':False,&lt;br /&gt;
        'weight':'',&lt;br /&gt;
        'output':output_path,&lt;br /&gt;
        'GRASS_REGION_PARAMETER':extent,&lt;br /&gt;
        'GRASS_REGION_CELLSIZE_PARAMETER':0,&lt;br /&gt;
        'GRASS_RASTER_FORMAT_OPT':'',&lt;br /&gt;
        'GRASS_RASTER_FORMAT_META':''&lt;br /&gt;
    }&lt;br /&gt;
)  &lt;br /&gt;
&lt;br /&gt;
# Convert output to Byte using gdal_translate&lt;br /&gt;
converted_output_path = output_path.replace(&amp;quot;_HD_4326.tiff&amp;quot;, &amp;quot;_Final-HD_4326.tiff&amp;quot;)&lt;br /&gt;
command = [&lt;br /&gt;
    'gdal_translate',&lt;br /&gt;
    '-ot', 'Byte',  # Set output data type to Byte&lt;br /&gt;
    output_path,&lt;br /&gt;
    converted_output_path&lt;br /&gt;
]&lt;br /&gt;
subprocess.run(command, shell=True)&lt;br /&gt;
&lt;br /&gt;
result_land_cover_warped_layer = QgsRasterLayer(converted_output_path, 'NLCD_' + year +  '_' + state + part + '_Final-HD_4326')&lt;br /&gt;
QgsProject.instance().addMapLayer(result_land_cover_warped_layer)&lt;br /&gt;
&lt;br /&gt;
print(&amp;quot;Step 9: Smooth all hi res features completed. (NLCD_&amp;quot; + year +  &amp;quot;_&amp;quot; + state + part + &amp;quot;_Final-HD_4326)&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=140455</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=140455"/>
		<updated>2024-09-15T11:20:34Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Added Scotland&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;
&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139994</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=139994"/>
		<updated>2024-06-23T07:20:41Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: New process for chapter &amp;quot;Clipping a Raster Layer with OSM Data for Land&amp;quot;&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 bin scripts&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/genwaterraster.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;
=== Clipping a Raster Layer with OSM Data for Land (Corine) ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following multi-stage process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
==== Download OSM Land Data ====&lt;br /&gt;
&lt;br /&gt;
Download land polygons based on OSM data as a Shapefile from [https://osmdata.openstreetmap.de/data/land-polygons.html Land Polygons] and make sure to pick the WGS84 projected download with split polygons (&amp;quot;Large polygons are split, use for larger scales&amp;quot;). Once downloaded unzip the content into a directory.&lt;br /&gt;
&lt;br /&gt;
==== Reclassifying the OSM Land Data Vector Layer ====&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 dialogue&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;lt;code&amp;gt;Integer (32 bit)&amp;lt;/code&amp;gt;. This will create a new column which we will populate with the correct land class data&lt;br /&gt;
* On top of the table on the left side choose &amp;quot;Landclass&amp;quot; in the drop-down menu, then input &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; into the field to the right and then press button &amp;quot;Update&amp;quot; all to the left of this field.&lt;br /&gt;
* Wait a bit and the close the dialogue.&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;
==== Convert the Land Data from Vector to Raster ====&lt;br /&gt;
Do the same as in chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; above. The only difference is that the Input layer will be the land data polygons and you need to choose a different file name for the &amp;quot;Rasterized&amp;quot; (e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
&lt;br /&gt;
==== Remove Novalue Entries in the Land Data Raster ====&lt;br /&gt;
To do this:&lt;br /&gt;
&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Processing-&amp;gt;Toolbox&amp;lt;/code&amp;gt;. You should see a new box on the right side.&lt;br /&gt;
* Write &amp;quot;gdal_calc&amp;quot; in the search box and you should see an entry &amp;quot;Raster calculator&amp;quot;. Double click on it and you will get a new dialogue window.&lt;br /&gt;
* In this dialogue:&lt;br /&gt;
** For &amp;quot;Input layer A&amp;quot; choose the raster from the previous chapter ((e.g. osm_land_scotland_5m.tif)&lt;br /&gt;
** In field &amp;quot;Calculation in gdalnumeric ...&amp;quot; write: &amp;lt;code&amp;gt;greater(A,0) * A&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Output raster type&amp;quot; choose &amp;lt;code&amp;gt;Byte&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Advanced Parameters&amp;quot; choose Profile &amp;lt;code&amp;gt;No compression&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Additional command-line parameters&amp;quot; write: &amp;lt;code&amp;gt;--hideNoData&amp;lt;/code&amp;gt;&lt;br /&gt;
** In field &amp;quot;Calculated&amp;quot; choose a file (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
** (In the &amp;quot;GDAL/OGR console call&amp;quot; it will have something similar to the follwing - just with different paths: &amp;lt;code&amp;gt;gdal_calc.py --overwrite --calc &amp;quot;greater(A ,0) * A&amp;quot; --format GTiff --type Byte -A /home/vanosten/custom-fg-scenery/data/osm_land_scotland_5m.tif --A_band 1 --co COMPRESS=NONE --co BIGTIFF=IF_NEEDED --hideNoData --outfile /home/vanosten/custom-fg-scenery/data/osm_land_scotland_allvalues_5m.tif&amp;lt;/code&amp;gt;&lt;br /&gt;
** Press the &amp;quot;Run&amp;quot; button - and when complete close the dialogue.&lt;br /&gt;
&lt;br /&gt;
You should now see a map only black and white. You can check for correctness by pressing &amp;lt;code&amp;gt;CTRL+SHIFT+I&amp;lt;/code&amp;gt; to get a cursor with an arrow and an &amp;quot;i&amp;quot;. First make sure the new raster is selected on the left side. Next click on the sea/ocean and then check in the &amp;quot;Identify Results&amp;quot; window on the right that the value is &amp;lt; 2. The click on the land and check that the value is 2.&lt;br /&gt;
&lt;br /&gt;
==== Create the Final Clipped Corine Raster Against OSM Land Data =====&lt;br /&gt;
Do the following:&lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that you have only the following two layers: the basis Corine raster (see chapter &amp;quot;Creating a Raster from a Vector Layer&amp;quot; - here e.g. corine_raster_scotland_5m.tif) and plus the raster from the previous step (e.g. osm_land_scotland_allvalues_5m.tif)&lt;br /&gt;
* Select &amp;lt;code&amp;gt;Raster-&amp;gt;Raster Calculator ...&amp;lt;/code&amp;gt; and a corresponding dialogue will open showing on the left hand side the two rasters.&lt;br /&gt;
* Choose a new &amp;quot;Output layer&amp;quot; (e.g. corine_raster_scotland_clipped_5m.tif).&lt;br /&gt;
* In the &amp;quot;Raster Calculator Expression&amp;quot; field input: &amp;lt;code&amp;gt;if (&amp;quot;osm_land_scotland_all_data_5m@1&amp;quot; &amp;lt; 2, 44, &amp;quot;corine_raster_scotland_5m@1&amp;quot;)&amp;lt;/code&amp;gt;&lt;br /&gt;
* Press button &amp;quot;OK&amp;quot; and wait a while (you will see a new dialogue with showing the progress.&lt;br /&gt;
&lt;br /&gt;
Done. You have now a raster (e.g. corine_raster_scotland_clipped_5m.tif) which does not have land in areas, where OSM data has sea/ocean.&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139993</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=139993"/>
		<updated>2024-06-22T12:28:47Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Add target extent field and adapt title for clipping&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 bin scripts&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/genwaterraster.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;
=== Clipping a Raster Layer with OSM data for Land ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that the raster data is loaded.&lt;br /&gt;
* Choose menu &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Extraction&amp;quot; &amp;quot;Clip Raster by Mask Layer ...&amp;quot;&lt;br /&gt;
* In the dialogue:&lt;br /&gt;
** Make sure the &amp;quot;Input layer&amp;quot; filed is pointing to the correct raster file and with the correct projection (&amp;quot;EPSG:4326&amp;quot;)&lt;br /&gt;
** Download land polygons based on OSM data as a Shapefile from [https://osmdata.openstreetmap.de/data/land-polygons.html Land Polygons] and make sure to pick the WGS84 projected download with split polygons (&amp;quot;Large polygons are split, use for larger scales&amp;quot;). Once downloaded unzip the content into a directory.&lt;br /&gt;
** For the &amp;quot;Mask layer&amp;quot; browse for layer and find the &amp;quot;land_polygon.shp&amp;quot; in the previously downloaded folder.&lt;br /&gt;
** Target extent: In the drop-down on the right side choose &amp;quot;Calculate from layer...&amp;quot; and choose the same as the input layer&lt;br /&gt;
** Assign a specified nodata value ...: set to 0&lt;br /&gt;
** Checkboxes: only &amp;quot;Keep resolution of input raster&amp;quot; should be marked.&lt;br /&gt;
** Leave everything else as is.&lt;br /&gt;
** In &amp;quot;Advanced Parameters&amp;quot; choose the &amp;quot;No Compression&amp;quot; profile.&lt;br /&gt;
** Field &amp;quot;Clipped (mask)&amp;quot; should point to a new .tif file, which will be the new clipped raster file.&lt;br /&gt;
** Hit &amp;quot;Run&amp;quot; - that will take many minutes.&lt;br /&gt;
 &lt;br /&gt;
NB: You do not have to use QGIS. In the QGIS dialog there is a GDAL/OGR console call window, which shows the needed command line to run. You can use that to get a start for an automated script.&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139992</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=139992"/>
		<updated>2024-06-22T11:51:34Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Correct from ocean to land polygons for clipping&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 bin scripts&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/genwaterraster.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;
=== Clipping a Raster Layer with OSM data for Oceans/Seas ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that the raster data is loaded.&lt;br /&gt;
* Choose menu &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Extraction&amp;quot; &amp;quot;Clip Raster by Mask Layer ...&amp;quot;&lt;br /&gt;
* In the dialogue:&lt;br /&gt;
** Make sure the &amp;quot;Input layer&amp;quot; filed is pointing to the correct raster file and with the correct projection (&amp;quot;EPSG:4326&amp;quot;)&lt;br /&gt;
** Download land polygons based on OSM data as a Shapefile from [https://osmdata.openstreetmap.de/data/land-polygons.html Land Polygons] and make sure to pick the WGS84 projected download with split polygons (&amp;quot;Large polygons are split, use for larger scales&amp;quot;). Once downloaded unzip the content into a directory.&lt;br /&gt;
** For the &amp;quot;Mask layer&amp;quot; browse for layer and find the &amp;quot;land_polygon.shp&amp;quot; in the previously downloaded folder.&lt;br /&gt;
** Make sure the checkbox &amp;quot;Match the extent of the clipped raster to the extent of the mask layer&amp;quot; is not set.&lt;br /&gt;
** Leave everything else as is.&lt;br /&gt;
** In &amp;quot;Advanced Parameters&amp;quot; choose the &amp;quot;No Compression&amp;quot; profile.&lt;br /&gt;
** Field &amp;quot;Clipped (mask)&amp;quot; should point to a new .tif file, which will be the new clipped raster file.&lt;br /&gt;
** Hit &amp;quot;Run&amp;quot; - that will take many minutes.&lt;br /&gt;
 &lt;br /&gt;
NB: You do not have to use QGIS. In the QGIS dialog there is a GDAL/OGR console call window, which shows the needed command line to run. You can use that to get a start for an automated script.&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139991</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=139991"/>
		<updated>2024-06-22T07:56:57Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Small correction to path in QGIS for clipping&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 bin scripts&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/genwaterraster.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;
=== Clipping a Raster Layer with OSM data for Oceans/Seas ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that the raster data is loaded.&lt;br /&gt;
* Choose menu &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Extraction&amp;quot; &amp;quot;Clip Raster by Mask Layer ...&amp;quot;&lt;br /&gt;
* In the dialogue:&lt;br /&gt;
** Make sure the &amp;quot;Input layer&amp;quot; filed is pointing to the correct raster file and with the correct projection (&amp;quot;EPSG:4326&amp;quot;)&lt;br /&gt;
** Download ocean/sea waterbodies from OSM as a Shapefile from [https://osmdata.openstreetmap.de/data/water-polygons.html Water Polygons] and make sure to pick the WGS84 projected download. Once downloaded unzip the content into a directory.&lt;br /&gt;
** For the &amp;quot;Mask layer&amp;quot; browse for layer and find the &amp;quot;water_polygon.shp&amp;quot; in the previously downloaded folder.¨&lt;br /&gt;
** Make sure the checkbox &amp;quot;Match the extent of the clipped raster to the extent of the mask layer&amp;quot; is not set.&lt;br /&gt;
** Leave everything else as is.&lt;br /&gt;
** In &amp;quot;Advanced Parameters&amp;quot; choose the &amp;quot;No Compression&amp;quot; profile.&lt;br /&gt;
** Field &amp;quot;Clipped (mask)&amp;quot; should point to a new .tif file, which will be the new clipped raster file.&lt;br /&gt;
** Hit &amp;quot;Run&amp;quot; - that will take many minutes.&lt;br /&gt;
 &lt;br /&gt;
NB: You do not have to use QGIS. In the QGIS dialog there is a GDAL/OGR console call window, which shows the needed command line to run. You can use that to get a start for an automated script.&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139990</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=139990"/>
		<updated>2024-06-22T07:51:42Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Clipping raster against OSM oceans and seas&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 bin scripts&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/genwaterraster.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;
=== Clipping a Raster Layer with OSM data for Oceans/Seas ===&lt;br /&gt;
The Corine dataset does not match OSM coastlines exactly. The following process makes sure, that no Corine land-use is in the water as defined by OSM. &lt;br /&gt;
&lt;br /&gt;
* In QGIS make sure that the raster data is loaded.&lt;br /&gt;
* Choose menu &amp;quot;Raster&amp;quot; -&amp;gt; &amp;quot;Clip Raster by Mask Layer&amp;quot;&lt;br /&gt;
* In the dialogue:&lt;br /&gt;
** Make sure the &amp;quot;Input layer&amp;quot; filed is pointing to the correct raster file and with the correct projection (&amp;quot;EPSG:4326&amp;quot;)&lt;br /&gt;
** Download ocean/sea waterbodies from OSM as a Shapefile from [https://osmdata.openstreetmap.de/data/water-polygons.html Water Polygons] and make sure to pick the WGS84 projected download. Once downloaded unzip the content into a directory.&lt;br /&gt;
** For the &amp;quot;Mask layer&amp;quot; browse for layer and find the &amp;quot;water_polygon.shp&amp;quot; in the previously downloaded folder.¨&lt;br /&gt;
** Make sure the checkbox &amp;quot;Match the extent of the clipped raster to the extent of the mask layer&amp;quot; is not set.&lt;br /&gt;
** Leave everything else as is.&lt;br /&gt;
** In &amp;quot;Advanced Parameters&amp;quot; choose the &amp;quot;No Compression&amp;quot; profile.&lt;br /&gt;
** Field &amp;quot;Clipped (mask)&amp;quot; should point to a new .tif file, which will be the new clipped raster file.&lt;br /&gt;
** Hit &amp;quot;Run&amp;quot; - that will take many minutes.&lt;br /&gt;
 &lt;br /&gt;
NB: You do not have to use QGIS. In the QGIS dialog there is a GDAL/OGR console call window, which shows the needed command line to run. You can use that to get a start for an automated script.&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139989</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=139989"/>
		<updated>2024-06-21T15:38:03Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Correcting command (copy error)&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 bin scripts&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/genwaterraster.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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Howto:Create_WS3.0_terrain&amp;diff=139988</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=139988"/>
		<updated>2024-06-21T15:24:59Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Add other dirs in docker from ls command for clarity&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 bin scripts&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139945</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=139945"/>
		<updated>2024-06-09T07:37:10Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: NL osm2city scenery&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/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;
|-&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/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;
|-&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&lt;br /&gt;
|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&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139912</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=139912"/>
		<updated>2024-06-05T05:54:23Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: New column for available scenery table&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/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;
|-&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&lt;br /&gt;
|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;
|-&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;
|-&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&lt;br /&gt;
|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&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=World_Scenery_3.0&amp;diff=139911</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=139911"/>
		<updated>2024-06-05T05:43:07Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Launcher settings for WS3.0&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;
!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 Nia'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://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;
|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 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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139074</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=139074"/>
		<updated>2024-02-04T19:03:46Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Discussion Topics */&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;
* Street lamps have good heuristics in osm2city - better than the data in OSM = ditto&lt;br /&gt;
* The reflection of mesh buildings vs. random buildings is different = why?&lt;br /&gt;
* Migrate lessons learned from random buildings - incl. normal maps, reflections, roof shader = waiting for random buildings to 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 2023.4: &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;
    * Consider updating the manual to include end-user stuff for osm2city choices in rendering dialog.&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? E.g. EDDM for photo scenery (Bavaria).&lt;br /&gt;
    * Update airports list?&lt;br /&gt;
    * Also kept up to date for NEXT? &lt;br /&gt;
&lt;br /&gt;
=== Topic: Night Textures ===&lt;br /&gt;
* Have several lightmaps for different points during the night? =&amp;gt; No too much work for artists. Should be able to do with shaders to use lightmaps more or less during night.&lt;br /&gt;
&lt;br /&gt;
=== Topic: Screes etc. in mountains ===&lt;br /&gt;
* Doing the same as for water in WS3 might not be the right approach. Probably better to update the underlying (Corine) data at e.g. 10m resolution based on normals and/or OSM data for screes.&lt;br /&gt;
&lt;br /&gt;
=== Topic: WS3 underlying landclasses ===&lt;br /&gt;
* Which source for different areas - outside of America and Europe?&lt;br /&gt;
* SENTINEL could be one source. Needs to be investigated how to do the mapping - and whether it can be generalized across regions.&lt;br /&gt;
* Need to distribute work to different people to find the right data sources in different regions.&lt;br /&gt;
* Pipelines need to be automated - manual work kills the possibility to build the world regularly.&lt;br /&gt;
&lt;br /&gt;
=== Topic: Shared models vs. osm2city ===&lt;br /&gt;
* Consider turning off shared models in scenery database. Use OSM data (probably through osm2city) is a better source.&lt;br /&gt;
* Possibly delete existing shared stuff for NEXT, not 2020.4.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery|Scenery]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139073</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=139073"/>
		<updated>2024-02-04T18:56:58Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Topic: Shared models vs. osm2city */&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;
* Street lamps have good heuristics in osm2city - better than the data in OSM = ditto&lt;br /&gt;
* The reflection of mesh buildings vs. random buildings is different = why?&lt;br /&gt;
* Migrate lessons learned from random buildings - incl. normal maps, reflections, roof shader = waiting for random buildings to 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: Night Textures ===&lt;br /&gt;
* Have several lightmaps for different points during the night? =&amp;gt; No too much work for artists. Should be able to do with shaders to use lightmaps more or less during night.&lt;br /&gt;
&lt;br /&gt;
=== Topic: Screes etc. in mountains ===&lt;br /&gt;
* Doing the same as for water in WS3 might not be the right approach. Probably better to update the underlying (Corine) data at e.g. 10m resolution based on normals and/or OSM data for screes.&lt;br /&gt;
&lt;br /&gt;
=== Topic: WS3 underlying landclasses ===&lt;br /&gt;
* Which source for different areas - outside of America and Europe?&lt;br /&gt;
* SENTINEL could be one source. Needs to be investigated how to do the mapping - and whether it can be generalized across regions.&lt;br /&gt;
* Need to distribute work to different people to find the right data sources in different regions.&lt;br /&gt;
* Pipelines need to be automated - manual work kills the possibility to build the world regularly.&lt;br /&gt;
&lt;br /&gt;
=== Topic: Shared models vs. osm2city ===&lt;br /&gt;
* Consider turning off shared models in scenery database. Use OSM data (probably through osm2city) is a better source.&lt;br /&gt;
* Possibly delete existing shared stuff for NEXT, not 2020.4.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery|Scenery]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139072</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=139072"/>
		<updated>2024-02-04T18:51:16Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Discussion Topics */&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;
* Street lamps have good heuristics in osm2city - better than the data in OSM = ditto&lt;br /&gt;
* The reflection of mesh buildings vs. random buildings is different = why?&lt;br /&gt;
* Migrate lessons learned from random buildings - incl. normal maps, reflections, roof shader = waiting for random buildings to 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: Night Textures ===&lt;br /&gt;
* Have several lightmaps for different points during the night? =&amp;gt; No too much work for artists. Should be able to do with shaders to use lightmaps more or less during night.&lt;br /&gt;
&lt;br /&gt;
=== Topic: Screes etc. in mountains ===&lt;br /&gt;
* Doing the same as for water in WS3 might not be the right approach. Probably better to update the underlying (Corine) data at e.g. 10m resolution based on normals and/or OSM data for screes.&lt;br /&gt;
&lt;br /&gt;
=== Topic: WS3 underlying landclasses ===&lt;br /&gt;
* Which source for different areas - outside of America and Europe?&lt;br /&gt;
* SENTINEL could be one source. Needs to be investigated how to do the mapping - and whether it can be generalized across regions.&lt;br /&gt;
* Need to distribute work to different people to find the right data sources in different regions.&lt;br /&gt;
* Pipelines need to be automated - manual work kills the possibility to build the world regularly.&lt;br /&gt;
&lt;br /&gt;
=== Topic: Shared models vs. osm2city ===&lt;br /&gt;
* Consider turning off shared models in scenery database. Use OSM data (probably through osm2city) is a better source.&lt;br /&gt;
* Possibly delete existing shared stuff for NEXT, not 202x.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery|Scenery]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139071</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=139071"/>
		<updated>2024-02-04T18:36:39Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Topic Y */&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;
* Street lamps have good heuristics in osm2city - better than the data in OSM = ditto&lt;br /&gt;
* The reflection of mesh buildings vs. random buildings is different = why?&lt;br /&gt;
* Migrate lessons learned from random buildings - incl. normal maps, reflections, roof shader = waiting for random buildings to 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: Night Textures ===&lt;br /&gt;
* Have several lightmaps for different points during the night? =&amp;gt; No too much work for artists. Should be able to do with shaders to use lightmaps more or less during night.&lt;br /&gt;
&lt;br /&gt;
=== Topic: Screes etc. in mountains ===&lt;br /&gt;
* Doing the same as for water in WS3 might not be the right approach. Probably better to update the underlying (Corine) data at e.g. 10m resolution based on normals and/or OSM data for screes.&lt;br /&gt;
&lt;br /&gt;
=== Topic WS3 underlying landclasses ===&lt;br /&gt;
* Which source for different areas - outside of America and Europe?&lt;br /&gt;
* SENTINEL could be one source. Needs to be investigated how to do the mapping - and whether it can be generalized across regions.&lt;br /&gt;
* Need to distribute work to different people to find the right data sources in different regions.&lt;br /&gt;
* Pipelines need to be automated - manual work kills the possibility to build the world regularly.&lt;br /&gt;
&lt;br /&gt;
[[Category:Scenery|Scenery]]&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139070</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=139070"/>
		<updated>2024-02-04T18:12:53Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Topic X */&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;
* Street lamps have good heuristics in osm2city - better than the data in OSM = ditto&lt;br /&gt;
* The reflection of mesh buildings vs. random buildings is different = why?&lt;br /&gt;
* Migrate lessons learned from random buildings - incl. normal maps, reflections, roof shader = waiting for random buildings to 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: Night Textures ===&lt;br /&gt;
* Have several lightmaps for different points during the night? =&amp;gt; No too much work for artists. Should be able to do with shaders to use lightmaps more or less during night.&lt;br /&gt;
&lt;br /&gt;
=== Topic: Screes etc. in mountains ===&lt;br /&gt;
* Doing the same as for water in WS3 might not be the right approach. Probably better to update the underlying (Corine) data at e.g. 10m resolution based on normals and/or OSM data for screes.&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139069</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=139069"/>
		<updated>2024-02-04T18:00:08Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* 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;
* Street lamps have good heuristics in osm2city - better than the data in OSM = ditto&lt;br /&gt;
* The reflection of mesh buildings vs. random buildings is different = why?&lt;br /&gt;
* Migrate lessons learned from random buildings - incl. normal maps, reflections, roof shader = waiting for random buildings to 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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139068</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=139068"/>
		<updated>2024-02-04T17:46:46Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* 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;
* Street lamps have good heuristics in osm2city - better than the data in OSM&lt;br /&gt;
* The reflection of mesh buildings vs. random buildings is different - why?&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139067</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=139067"/>
		<updated>2024-02-04T17:43:21Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* 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;
* Street lamps have good heuristics in osm2city - better than the data in OSM&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139063</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=139063"/>
		<updated>2024-02-03T13:20:58Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Discussion Topics */&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;
| Example || Example || Example || Example&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139032</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=139032"/>
		<updated>2024-01-30T08:31:17Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: add proposed discussion topics&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;
| Example || Example || Example || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Discussion Topics ==&lt;br /&gt;
Proposed topics:&lt;br /&gt;
* Scenery build for 2024.1: if based on WS2.0: use FGMS data to select areas with actual traffic to cut down on processing needs (e.g. for osm2city)? Do we change the default airport?&lt;br /&gt;
* Scenery build for WS3.0: which area(s) to pick with a commitment to &amp;quot;often&amp;quot; rebuild / adapt to latest changes in code/features&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139024</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=139024"/>
		<updated>2024-01-29T07:02:33Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Added OSM stuff&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;
| Example || Example || Example || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Discussion Topics ==&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scenery_status_meet_Feb_2024&amp;diff=139023</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=139023"/>
		<updated>2024-01-29T06:48:05Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Created page with &amp;quot;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....&amp;quot;&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.&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;
| Example || Example || Example || Example&lt;br /&gt;
|-&lt;br /&gt;
| Example || Example || Example || Example&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Discussion Topics ==&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>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139022</id>
		<title>Grumman F-14 Tomcat Weapons Operations</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139022"/>
		<updated>2024-01-29T06:20:44Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: Modes list now in table&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to operate weapons and the related radar modes for the [[Grumman_F-14_Tomcat|Grumman F-14 Tomcat]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version Warning ==&lt;br /&gt;
{{Note|&lt;br /&gt;
Be aware that the documentation in this page refers to the development version of the F-14, which is maintained in a [https://github.com/Zaretto/fg-aircraft GitHub repository]. Some features might therefore not be available, if you use the less frequently updated version from [[FGAddon|FGAddon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The development of the weapons and radar in the F-14 are related to [https://discord.gg/MBWnqHC4 Operation Red Flag], the premier military aviation organization for the flight simulator FlightGear!&lt;br /&gt;
&lt;br /&gt;
== Weapons Operation ==&lt;br /&gt;
NB: Especially for gunning you might want to set SAS Roll to off to prevent the plane from oscillating when using aggressive stick input.&lt;br /&gt;
&lt;br /&gt;
NB: In some new versions of FlightGear, the {{Key press|w}} key is replaced by the {{Key press|m}} key to select weapons.&lt;br /&gt;
&lt;br /&gt;
===M61A1 Vulcan (gun)===&lt;br /&gt;
*At startup, the ammunition store is filled with 675 round. There is an option on the '''Fuel and Stores''' dialog in the '''Tomcat Controls''' Menu to allow the gun to be reloaded&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available {{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}. Having the HUD in this mode is not mandatory however when the HUD is in the right mode the guidance symbology will assist with target identification and aiming.&lt;br /&gt;
*Select Gun mode with the Stick Weapon Mode Selector ({{Key press|w}}). A pipper, the G symbol with a number showing approximately the remaining rounds x 100 and a closure rate scale are displayed in the HUD. The closure rate scale is active only if a target has been locked ({{Key press|y}}) by the radar with TWS AUTO mode (diamond on the HUD).&lt;br /&gt;
*Switch Master Arm on cycle with {{Key press|CTRL-w}}, the X on the G symbol means Master Arm off or in training mode.&lt;br /&gt;
* Press {{Key press|e}} to fire the gun.&lt;br /&gt;
&lt;br /&gt;
===AIM-9M Sidewinders===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD light&amp;quot; has 4 sidewinders, &amp;quot;FAD&amp;quot;, &amp;quot;FAD heavy&amp;quot; and &amp;quot;Bombcat&amp;quot; have 2 of them.&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available ({{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}).&lt;br /&gt;
* Select &amp;quot;SW&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Switch to the RIO view ({{Key press|Ctrl|v}}).&lt;br /&gt;
*Select pylons 1 and 8, down position, on the Armament panel, on RIO's left console. A shortcut toggles these two switches so you can select or deselect all AIM-9 in one keyboard stroke ({{Key press|Ctrl|m}}) without leaving pilot's view. If you have 4 sidewinders, then after shooting the first 2 you need to toggle the pylons 1 and 8 into the up position.&lt;br /&gt;
*Switch back to the pilot's view ({{Key press|Ctrl|v}}).&lt;br /&gt;
* Switch Master Arm on, you hear the search signal of the seeker head, a low volume buzz sound.&lt;br /&gt;
*Now prior to be fired, the AIM-9 must have a lock on a target. Multiplayers, AI aircraft, and AI tankers can be locked (radar lock with {{Key press|y}}). The minimal lock distance is 10 NM, the target must be approximately inside a 80° cone centred on datum line. When locked, the signal buzz volume becomes louder and the 2 red &amp;quot;LOCK&amp;quot; lights at the top of the canopy frame are lit. For best results try to shoot ({{Key press|e}}) at a 3 to 6 NM range and with the target centred on the aircraft velocity vector (when the 2 red &amp;quot;SHOOT&amp;quot; lights at the top of the canopy frame are lit). The missile will explode at the smaller distance possible. However if this distance is above 70 meters, it will continue its trajectory without guidance.&lt;br /&gt;
&lt;br /&gt;
===AIM-7 Sparrow and AIM-54 Phoenix===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD&amp;quot; has 2 Sparrows and 4 Phoenix, &amp;quot;FAD light&amp;quot; has 4 Sparrows, &amp;quot;FAD heavy&amp;quot; has 6 Phoenix.&lt;br /&gt;
*Select A/A Mode, master arm etc. as with Sidewinders.&lt;br /&gt;
*Select &amp;quot;SP-PH&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6 for the pylons below the belly, 1 and 8 under the wing in up position for &amp;quot;FAD&amp;quot; (2 Sparrows, the 2 Sidewinders are selected in the down position of 1/8.&lt;br /&gt;
*Obtain a radar lock by using {{Key press|y}} the the next target and {{Key press|Ctrl|y}} the the previous target.&lt;br /&gt;
*Launching the missiles is the same as for the Sidewinders, but there is no growling sound and the max shooting range are larger: up to 30+ nm for the {{Wikipedia|AIM-7_Sparrow}} and 100+ nm for the {{Wikipedia|AIM-54_Phoenix}}.&lt;br /&gt;
&lt;br /&gt;
===Bombs===&lt;br /&gt;
NB: only CCIP mode is implemented - and only dumb low-drag unguided bombs - and only single release.&lt;br /&gt;
*Select the right weapons' set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;Bombcat&amp;quot; has 4 Mk83 bombs.&lt;br /&gt;
*Master arm on&lt;br /&gt;
*Select A/G Mode&lt;br /&gt;
*Select &amp;quot;Off&amp;quot; mode with the Stick Weapon Mode Selector (yes, off - you will still be able to pull the trigger in A/G mode).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6.&lt;br /&gt;
*No need for locking with the radar. There is a CCIP in the HUD.&lt;br /&gt;
*Set wing sweep to manual and 55 deg.&lt;br /&gt;
*Make sure you are high above terrain (e.g. 10000 ft) and initiate a steep dive to 40 degs. Deploy speed brakes in order not to get too fast. Make sure wings are levelled, otherwise the bomb will not hit even though the pipper is on the target (there is currently no vertical bomb fall line implemented in the HUD).&lt;br /&gt;
*Release the bomb when the target is within the circle around the bottom of the HUD and before you reach 2000 ft above ground.&lt;br /&gt;
&lt;br /&gt;
Find out what is working for you - it is not that simple.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radar Scan Modes==&lt;br /&gt;
===Key Bindings===&lt;br /&gt;
{{Key press|y}}: Next target&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|y}}: Cycle azimuth field width&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|u}}: Undesignate (very useful for PAL mode)&lt;br /&gt;
&lt;br /&gt;
{{Key press|i}}: Tilt radar up&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|i}}: Tilt radar down&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|d}}: Cycle number of bars&lt;br /&gt;
&lt;br /&gt;
{{Key press|Ctrl|n}}: Cycle radar scan modes&lt;br /&gt;
&lt;br /&gt;
{{Key press|d}}: Pilot Auto Lockon mode (PAL) [click {{Key press|Ctrl|n}} to exit]&lt;br /&gt;
&lt;br /&gt;
{{Key press|r}}: Single Target Track mode (STT)&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|e}} and {{Key press|r}}: Radar range when not in PAL mode.&lt;br /&gt;
&lt;br /&gt;
{{Key press|q}}: Radar standby&lt;br /&gt;
&lt;br /&gt;
===Modes===&lt;br /&gt;
Use {{Key press|Ctrl|n}} to cycle between radar scan modes (alternatively press the corresponding buttons on the RIO's front console).&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Mode !! Notes&lt;br /&gt;
|-&lt;br /&gt;
| '''PD SEARCH''' || Has the longest RCS sensitivity of the modes. Will only show targets that has above/below a certain closure-rate. Notchable. Will not show targets altitude or heading.&lt;br /&gt;
|-&lt;br /&gt;
| '''RWS''' || Medium RCS sensitivity. Notchable.&lt;br /&gt;
|-&lt;br /&gt;
| '''P SEARCH''' || Basically a ground/sea radar. Cannot be notched.&lt;br /&gt;
|-&lt;br /&gt;
| '''PAL''' || Scans the area around the HUD, fixed at 10nm range. Automatically enters STT for anything it sees. Note that when in this mode, none of the RIO mode push buttons will lit up.&lt;br /&gt;
|-&lt;br /&gt;
| '''P STT''' || Single target track. Cannot be notched, wont produce closure-rate output.&lt;br /&gt;
|-&lt;br /&gt;
| '''PD STT''' || Single target track. Can be notched.&lt;br /&gt;
|-&lt;br /&gt;
| '''TWS MAN''' || Once a target has been scanned twice within some seconds, groundtrack (headings) is displayed on TID. Only has 2 options for bars/az combinations. Has the shortest RCS sensitivity of the modes. Notchable.&lt;br /&gt;
|-&lt;br /&gt;
| '''TWS AUTO''' || Is disabled / does not work.&lt;br /&gt;
|} &lt;br /&gt;
&lt;br /&gt;
==== Missile Notes ====&lt;br /&gt;
&lt;br /&gt;
* AIM-7 needs STT mode.&lt;br /&gt;
&lt;br /&gt;
* AIM-9 needs STT mode or TWS mode with something selected. Or radar in standby, then it will lock onto whatever is at bore.&lt;br /&gt;
&lt;br /&gt;
* AIM-54 need either STT or TWS with something selected (in which case it will go active immediately with reduced range).&lt;br /&gt;
&lt;br /&gt;
====How to Notch====&lt;br /&gt;
Notching means flying manoeuvrers to make an aircraft less detectable on radar/evade it. It is sometimes called beaming.&lt;br /&gt;
&lt;br /&gt;
If you are flying against an F-14, keep the F-14 on your 3 or 9 o'clock and make sure that seen from the F-14 point of view that he will see terrain behind you.&lt;br /&gt;
&lt;br /&gt;
====Datalink====&lt;br /&gt;
&lt;br /&gt;
Aircraft on datalink that are inside the radar field will be shown on TID (even if the radar is standby). The backseater needs to take care to enter the datalink channel at the top of the right panel (IFF is taken care of by the pilot at the top of the pilot's right panel).&lt;br /&gt;
&lt;br /&gt;
====Misc====&lt;br /&gt;
&lt;br /&gt;
RWS/TWS MAN/PDSearch/PSearch will able to show 19 targets, MP or not. TWS can show groundtrack on max 10 of them.&lt;br /&gt;
&lt;br /&gt;
Radar elevation, commanded and actual, is shown on gauge left of DDD display. It is in relation to horizon in all modes except PAL.&lt;br /&gt;
&lt;br /&gt;
Each mode remembers its own bars and az settings. So if you switch to 1 bar in RWS, and then switch to PD SEARCH it might have 8 bars, when you switch back to RWS you will have 1 bar again. Radar antennae elevation/azimuth is shared between modes though.&lt;br /&gt;
&lt;br /&gt;
====Moving Radar Azimuth Field Left and Right====&lt;br /&gt;
&lt;br /&gt;
There are no key bindings for moving the radar azimuth field left and right when not 120. To use this, enable it from FG joystick dialog.&lt;br /&gt;
&lt;br /&gt;
====Dual Control====&lt;br /&gt;
&lt;br /&gt;
When connecting as a Radar Intercept Officer (RIO aka. [https://en.wikipedia.org/wiki/Weapon_systems_officer WSO]), the pilot will no longer be able to control the radar - it is all done from the dual control RIO MP seat. The RIO is able to control the station switches.&lt;br /&gt;
&lt;br /&gt;
Make sure that you as a RIO do not switch modes and stuff too fast, allow for a short moment for each change you make to propagate to the pilot.&lt;br /&gt;
&lt;br /&gt;
If the RIO selects something and it fails pilot screen will show selection handover fails, the pilot could try to press y to repeat the handover and if successful, and then ask RIO to cycle modes if RIO had commanded STT, to make the pilots radar try to enter STT again.&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
{{#ev:youtube|ibHrZyAQ1C4|||A tutorial video explaining how to fire the F-14B's missiles.|frame}}&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139021</id>
		<title>Grumman F-14 Tomcat Weapons Operations</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139021"/>
		<updated>2024-01-29T06:13:59Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Dual Control */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to operate weapons and the related radar modes for the [[Grumman_F-14_Tomcat|Grumman F-14 Tomcat]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version Warning ==&lt;br /&gt;
{{Note|&lt;br /&gt;
Be aware that the documentation in this page refers to the development version of the F-14, which is maintained in a [https://github.com/Zaretto/fg-aircraft GitHub repository]. Some features might therefore not be available, if you use the less frequently updated version from [[FGAddon|FGAddon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The development of the weapons and radar in the F-14 are related to [https://discord.gg/MBWnqHC4 Operation Red Flag], the premier military aviation organization for the flight simulator FlightGear!&lt;br /&gt;
&lt;br /&gt;
== Weapons Operation ==&lt;br /&gt;
NB: Especially for gunning you might want to set SAS Roll to off to prevent the plane from oscillating when using aggressive stick input.&lt;br /&gt;
&lt;br /&gt;
NB: In some new versions of FlightGear, the {{Key press|w}} key is replaced by the {{Key press|m}} key to select weapons.&lt;br /&gt;
&lt;br /&gt;
===M61A1 Vulcan (gun)===&lt;br /&gt;
*At startup, the ammunition store is filled with 675 round. There is an option on the '''Fuel and Stores''' dialog in the '''Tomcat Controls''' Menu to allow the gun to be reloaded&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available {{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}. Having the HUD in this mode is not mandatory however when the HUD is in the right mode the guidance symbology will assist with target identification and aiming.&lt;br /&gt;
*Select Gun mode with the Stick Weapon Mode Selector ({{Key press|w}}). A pipper, the G symbol with a number showing approximately the remaining rounds x 100 and a closure rate scale are displayed in the HUD. The closure rate scale is active only if a target has been locked ({{Key press|y}}) by the radar with TWS AUTO mode (diamond on the HUD).&lt;br /&gt;
*Switch Master Arm on cycle with {{Key press|CTRL-w}}, the X on the G symbol means Master Arm off or in training mode.&lt;br /&gt;
* Press {{Key press|e}} to fire the gun.&lt;br /&gt;
&lt;br /&gt;
===AIM-9M Sidewinders===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD light&amp;quot; has 4 sidewinders, &amp;quot;FAD&amp;quot;, &amp;quot;FAD heavy&amp;quot; and &amp;quot;Bombcat&amp;quot; have 2 of them.&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available ({{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}).&lt;br /&gt;
* Select &amp;quot;SW&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Switch to the RIO view ({{Key press|Ctrl|v}}).&lt;br /&gt;
*Select pylons 1 and 8, down position, on the Armament panel, on RIO's left console. A shortcut toggles these two switches so you can select or deselect all AIM-9 in one keyboard stroke ({{Key press|Ctrl|m}}) without leaving pilot's view. If you have 4 sidewinders, then after shooting the first 2 you need to toggle the pylons 1 and 8 into the up position.&lt;br /&gt;
*Switch back to the pilot's view ({{Key press|Ctrl|v}}).&lt;br /&gt;
* Switch Master Arm on, you hear the search signal of the seeker head, a low volume buzz sound.&lt;br /&gt;
*Now prior to be fired, the AIM-9 must have a lock on a target. Multiplayers, AI aircraft, and AI tankers can be locked (radar lock with {{Key press|y}}). The minimal lock distance is 10 NM, the target must be approximately inside a 80° cone centred on datum line. When locked, the signal buzz volume becomes louder and the 2 red &amp;quot;LOCK&amp;quot; lights at the top of the canopy frame are lit. For best results try to shoot ({{Key press|e}}) at a 3 to 6 NM range and with the target centred on the aircraft velocity vector (when the 2 red &amp;quot;SHOOT&amp;quot; lights at the top of the canopy frame are lit). The missile will explode at the smaller distance possible. However if this distance is above 70 meters, it will continue its trajectory without guidance.&lt;br /&gt;
&lt;br /&gt;
===AIM-7 Sparrow and AIM-54 Phoenix===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD&amp;quot; has 2 Sparrows and 4 Phoenix, &amp;quot;FAD light&amp;quot; has 4 Sparrows, &amp;quot;FAD heavy&amp;quot; has 6 Phoenix.&lt;br /&gt;
*Select A/A Mode, master arm etc. as with Sidewinders.&lt;br /&gt;
*Select &amp;quot;SP-PH&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6 for the pylons below the belly, 1 and 8 under the wing in up position for &amp;quot;FAD&amp;quot; (2 Sparrows, the 2 Sidewinders are selected in the down position of 1/8.&lt;br /&gt;
*Obtain a radar lock by using {{Key press|y}} the the next target and {{Key press|Ctrl|y}} the the previous target.&lt;br /&gt;
*Launching the missiles is the same as for the Sidewinders, but there is no growling sound and the max shooting range are larger: up to 30+ nm for the {{Wikipedia|AIM-7_Sparrow}} and 100+ nm for the {{Wikipedia|AIM-54_Phoenix}}.&lt;br /&gt;
&lt;br /&gt;
===Bombs===&lt;br /&gt;
NB: only CCIP mode is implemented - and only dumb low-drag unguided bombs - and only single release.&lt;br /&gt;
*Select the right weapons' set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;Bombcat&amp;quot; has 4 Mk83 bombs.&lt;br /&gt;
*Master arm on&lt;br /&gt;
*Select A/G Mode&lt;br /&gt;
*Select &amp;quot;Off&amp;quot; mode with the Stick Weapon Mode Selector (yes, off - you will still be able to pull the trigger in A/G mode).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6.&lt;br /&gt;
*No need for locking with the radar. There is a CCIP in the HUD.&lt;br /&gt;
*Set wing sweep to manual and 55 deg.&lt;br /&gt;
*Make sure you are high above terrain (e.g. 10000 ft) and initiate a steep dive to 40 degs. Deploy speed brakes in order not to get too fast. Make sure wings are levelled, otherwise the bomb will not hit even though the pipper is on the target (there is currently no vertical bomb fall line implemented in the HUD).&lt;br /&gt;
*Release the bomb when the target is within the circle around the bottom of the HUD and before you reach 2000 ft above ground.&lt;br /&gt;
&lt;br /&gt;
Find out what is working for you - it is not that simple.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radar Scan Modes==&lt;br /&gt;
===Key Bindings===&lt;br /&gt;
{{Key press|y}}: Next target&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|y}}: Cycle azimuth field width&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|u}}: Undesignate (very useful for PAL mode)&lt;br /&gt;
&lt;br /&gt;
{{Key press|i}}: Tilt radar up&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|i}}: Tilt radar down&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|d}}: Cycle number of bars&lt;br /&gt;
&lt;br /&gt;
{{Key press|Ctrl|n}}: Cycle radar scan modes&lt;br /&gt;
&lt;br /&gt;
{{Key press|d}}: Pilot Auto Lockon mode (PAL) [click {{Key press|Ctrl|n}} to exit]&lt;br /&gt;
&lt;br /&gt;
{{Key press|r}}: Single Target Track mode (STT)&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|e}} and {{Key press|r}}: Radar range when not in PAL mode.&lt;br /&gt;
&lt;br /&gt;
{{Key press|q}}: Radar standby&lt;br /&gt;
&lt;br /&gt;
===Modes===&lt;br /&gt;
Use {{Key press|Ctrl|n}} to cycle between radar scan modes (alternatively press the corresponding buttons on the RIO's front console).&lt;br /&gt;
&lt;br /&gt;
'''PD SEARCH''': Has the longest RCS sensitivity of the modes. Will only show targets that has above/below a certain closure-rate. Notchable. Will not show targets altitude or heading.&lt;br /&gt;
&lt;br /&gt;
'''RWS''': Medium RCS sensitivity. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''P SEARCH''': Basically a ground/sea radar. Cannot be notched.&lt;br /&gt;
&lt;br /&gt;
'''PAL''': Scans the area around the HUD, fixed at 10nm range. Automatically enters STT for anything it sees. Note that when in this mode, none of the RIO mode push buttons will lit up.&lt;br /&gt;
&lt;br /&gt;
'''P STT''': Single target track. Cannot be notched, wont produce closure-rate output.&lt;br /&gt;
&lt;br /&gt;
'''PD STT''': Single target track. Can be notched.&lt;br /&gt;
&lt;br /&gt;
'''TWS MAN''': Once a target has been scanned twice within some seconds, groundtrack (headings) is displayed on TID. Only has 2 options for bars/az combinations. Has the shortest RCS sensitivity of the modes. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''TWS AUTO''': Is disabled / does not work.&lt;br /&gt;
&lt;br /&gt;
==== Missile Notes ====&lt;br /&gt;
&lt;br /&gt;
* AIM-7 needs STT mode.&lt;br /&gt;
&lt;br /&gt;
* AIM-9 needs STT mode or TWS mode with something selected. Or radar in standby, then it will lock onto whatever is at bore.&lt;br /&gt;
&lt;br /&gt;
* AIM-54 need either STT or TWS with something selected (in which case it will go active immediately with reduced range).&lt;br /&gt;
&lt;br /&gt;
====How to Notch====&lt;br /&gt;
Notching means flying manoeuvrers to make an aircraft less detectable on radar/evade it. It is sometimes called beaming.&lt;br /&gt;
&lt;br /&gt;
If you are flying against an F-14, keep the F-14 on your 3 or 9 o'clock and make sure that seen from the F-14 point of view that he will see terrain behind you.&lt;br /&gt;
&lt;br /&gt;
====Datalink====&lt;br /&gt;
&lt;br /&gt;
Aircraft on datalink that are inside the radar field will be shown on TID (even if the radar is standby). The backseater needs to take care to enter the datalink channel at the top of the right panel (IFF is taken care of by the pilot at the top of the pilot's right panel).&lt;br /&gt;
&lt;br /&gt;
====Misc====&lt;br /&gt;
&lt;br /&gt;
RWS/TWS MAN/PDSearch/PSearch will able to show 19 targets, MP or not. TWS can show groundtrack on max 10 of them.&lt;br /&gt;
&lt;br /&gt;
Radar elevation, commanded and actual, is shown on gauge left of DDD display. It is in relation to horizon in all modes except PAL.&lt;br /&gt;
&lt;br /&gt;
Each mode remembers its own bars and az settings. So if you switch to 1 bar in RWS, and then switch to PD SEARCH it might have 8 bars, when you switch back to RWS you will have 1 bar again. Radar antennae elevation/azimuth is shared between modes though.&lt;br /&gt;
&lt;br /&gt;
====Moving Radar Azimuth Field Left and Right====&lt;br /&gt;
&lt;br /&gt;
There are no key bindings for moving the radar azimuth field left and right when not 120. To use this, enable it from FG joystick dialog.&lt;br /&gt;
&lt;br /&gt;
====Dual Control====&lt;br /&gt;
&lt;br /&gt;
When connecting as a Radar Intercept Officer (RIO aka. [https://en.wikipedia.org/wiki/Weapon_systems_officer WSO]), the pilot will no longer be able to control the radar - it is all done from the dual control RIO MP seat. The RIO is able to control the station switches.&lt;br /&gt;
&lt;br /&gt;
Make sure that you as a RIO do not switch modes and stuff too fast, allow for a short moment for each change you make to propagate to the pilot.&lt;br /&gt;
&lt;br /&gt;
If the RIO selects something and it fails pilot screen will show selection handover fails, the pilot could try to press y to repeat the handover and if successful, and then ask RIO to cycle modes if RIO had commanded STT, to make the pilots radar try to enter STT again.&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
{{#ev:youtube|ibHrZyAQ1C4|||A tutorial video explaining how to fire the F-14B's missiles.|frame}}&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139020</id>
		<title>Grumman F-14 Tomcat Weapons Operations</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139020"/>
		<updated>2024-01-29T06:11:12Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to operate weapons and the related radar modes for the [[Grumman_F-14_Tomcat|Grumman F-14 Tomcat]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version Warning ==&lt;br /&gt;
{{Note|&lt;br /&gt;
Be aware that the documentation in this page refers to the development version of the F-14, which is maintained in a [https://github.com/Zaretto/fg-aircraft GitHub repository]. Some features might therefore not be available, if you use the less frequently updated version from [[FGAddon|FGAddon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The development of the weapons and radar in the F-14 are related to [https://discord.gg/MBWnqHC4 Operation Red Flag], the premier military aviation organization for the flight simulator FlightGear!&lt;br /&gt;
&lt;br /&gt;
== Weapons Operation ==&lt;br /&gt;
NB: Especially for gunning you might want to set SAS Roll to off to prevent the plane from oscillating when using aggressive stick input.&lt;br /&gt;
&lt;br /&gt;
NB: In some new versions of FlightGear, the {{Key press|w}} key is replaced by the {{Key press|m}} key to select weapons.&lt;br /&gt;
&lt;br /&gt;
===M61A1 Vulcan (gun)===&lt;br /&gt;
*At startup, the ammunition store is filled with 675 round. There is an option on the '''Fuel and Stores''' dialog in the '''Tomcat Controls''' Menu to allow the gun to be reloaded&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available {{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}. Having the HUD in this mode is not mandatory however when the HUD is in the right mode the guidance symbology will assist with target identification and aiming.&lt;br /&gt;
*Select Gun mode with the Stick Weapon Mode Selector ({{Key press|w}}). A pipper, the G symbol with a number showing approximately the remaining rounds x 100 and a closure rate scale are displayed in the HUD. The closure rate scale is active only if a target has been locked ({{Key press|y}}) by the radar with TWS AUTO mode (diamond on the HUD).&lt;br /&gt;
*Switch Master Arm on cycle with {{Key press|CTRL-w}}, the X on the G symbol means Master Arm off or in training mode.&lt;br /&gt;
* Press {{Key press|e}} to fire the gun.&lt;br /&gt;
&lt;br /&gt;
===AIM-9M Sidewinders===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD light&amp;quot; has 4 sidewinders, &amp;quot;FAD&amp;quot;, &amp;quot;FAD heavy&amp;quot; and &amp;quot;Bombcat&amp;quot; have 2 of them.&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available ({{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}).&lt;br /&gt;
* Select &amp;quot;SW&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Switch to the RIO view ({{Key press|Ctrl|v}}).&lt;br /&gt;
*Select pylons 1 and 8, down position, on the Armament panel, on RIO's left console. A shortcut toggles these two switches so you can select or deselect all AIM-9 in one keyboard stroke ({{Key press|Ctrl|m}}) without leaving pilot's view. If you have 4 sidewinders, then after shooting the first 2 you need to toggle the pylons 1 and 8 into the up position.&lt;br /&gt;
*Switch back to the pilot's view ({{Key press|Ctrl|v}}).&lt;br /&gt;
* Switch Master Arm on, you hear the search signal of the seeker head, a low volume buzz sound.&lt;br /&gt;
*Now prior to be fired, the AIM-9 must have a lock on a target. Multiplayers, AI aircraft, and AI tankers can be locked (radar lock with {{Key press|y}}). The minimal lock distance is 10 NM, the target must be approximately inside a 80° cone centred on datum line. When locked, the signal buzz volume becomes louder and the 2 red &amp;quot;LOCK&amp;quot; lights at the top of the canopy frame are lit. For best results try to shoot ({{Key press|e}}) at a 3 to 6 NM range and with the target centred on the aircraft velocity vector (when the 2 red &amp;quot;SHOOT&amp;quot; lights at the top of the canopy frame are lit). The missile will explode at the smaller distance possible. However if this distance is above 70 meters, it will continue its trajectory without guidance.&lt;br /&gt;
&lt;br /&gt;
===AIM-7 Sparrow and AIM-54 Phoenix===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD&amp;quot; has 2 Sparrows and 4 Phoenix, &amp;quot;FAD light&amp;quot; has 4 Sparrows, &amp;quot;FAD heavy&amp;quot; has 6 Phoenix.&lt;br /&gt;
*Select A/A Mode, master arm etc. as with Sidewinders.&lt;br /&gt;
*Select &amp;quot;SP-PH&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6 for the pylons below the belly, 1 and 8 under the wing in up position for &amp;quot;FAD&amp;quot; (2 Sparrows, the 2 Sidewinders are selected in the down position of 1/8.&lt;br /&gt;
*Obtain a radar lock by using {{Key press|y}} the the next target and {{Key press|Ctrl|y}} the the previous target.&lt;br /&gt;
*Launching the missiles is the same as for the Sidewinders, but there is no growling sound and the max shooting range are larger: up to 30+ nm for the {{Wikipedia|AIM-7_Sparrow}} and 100+ nm for the {{Wikipedia|AIM-54_Phoenix}}.&lt;br /&gt;
&lt;br /&gt;
===Bombs===&lt;br /&gt;
NB: only CCIP mode is implemented - and only dumb low-drag unguided bombs - and only single release.&lt;br /&gt;
*Select the right weapons' set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;Bombcat&amp;quot; has 4 Mk83 bombs.&lt;br /&gt;
*Master arm on&lt;br /&gt;
*Select A/G Mode&lt;br /&gt;
*Select &amp;quot;Off&amp;quot; mode with the Stick Weapon Mode Selector (yes, off - you will still be able to pull the trigger in A/G mode).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6.&lt;br /&gt;
*No need for locking with the radar. There is a CCIP in the HUD.&lt;br /&gt;
*Set wing sweep to manual and 55 deg.&lt;br /&gt;
*Make sure you are high above terrain (e.g. 10000 ft) and initiate a steep dive to 40 degs. Deploy speed brakes in order not to get too fast. Make sure wings are levelled, otherwise the bomb will not hit even though the pipper is on the target (there is currently no vertical bomb fall line implemented in the HUD).&lt;br /&gt;
*Release the bomb when the target is within the circle around the bottom of the HUD and before you reach 2000 ft above ground.&lt;br /&gt;
&lt;br /&gt;
Find out what is working for you - it is not that simple.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radar Scan Modes==&lt;br /&gt;
===Key Bindings===&lt;br /&gt;
{{Key press|y}}: Next target&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|y}}: Cycle azimuth field width&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|u}}: Undesignate (very useful for PAL mode)&lt;br /&gt;
&lt;br /&gt;
{{Key press|i}}: Tilt radar up&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|i}}: Tilt radar down&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|d}}: Cycle number of bars&lt;br /&gt;
&lt;br /&gt;
{{Key press|Ctrl|n}}: Cycle radar scan modes&lt;br /&gt;
&lt;br /&gt;
{{Key press|d}}: Pilot Auto Lockon mode (PAL) [click {{Key press|Ctrl|n}} to exit]&lt;br /&gt;
&lt;br /&gt;
{{Key press|r}}: Single Target Track mode (STT)&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|e}} and {{Key press|r}}: Radar range when not in PAL mode.&lt;br /&gt;
&lt;br /&gt;
{{Key press|q}}: Radar standby&lt;br /&gt;
&lt;br /&gt;
===Modes===&lt;br /&gt;
Use {{Key press|Ctrl|n}} to cycle between radar scan modes (alternatively press the corresponding buttons on the RIO's front console).&lt;br /&gt;
&lt;br /&gt;
'''PD SEARCH''': Has the longest RCS sensitivity of the modes. Will only show targets that has above/below a certain closure-rate. Notchable. Will not show targets altitude or heading.&lt;br /&gt;
&lt;br /&gt;
'''RWS''': Medium RCS sensitivity. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''P SEARCH''': Basically a ground/sea radar. Cannot be notched.&lt;br /&gt;
&lt;br /&gt;
'''PAL''': Scans the area around the HUD, fixed at 10nm range. Automatically enters STT for anything it sees. Note that when in this mode, none of the RIO mode push buttons will lit up.&lt;br /&gt;
&lt;br /&gt;
'''P STT''': Single target track. Cannot be notched, wont produce closure-rate output.&lt;br /&gt;
&lt;br /&gt;
'''PD STT''': Single target track. Can be notched.&lt;br /&gt;
&lt;br /&gt;
'''TWS MAN''': Once a target has been scanned twice within some seconds, groundtrack (headings) is displayed on TID. Only has 2 options for bars/az combinations. Has the shortest RCS sensitivity of the modes. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''TWS AUTO''': Is disabled / does not work.&lt;br /&gt;
&lt;br /&gt;
==== Missile Notes ====&lt;br /&gt;
&lt;br /&gt;
* AIM-7 needs STT mode.&lt;br /&gt;
&lt;br /&gt;
* AIM-9 needs STT mode or TWS mode with something selected. Or radar in standby, then it will lock onto whatever is at bore.&lt;br /&gt;
&lt;br /&gt;
* AIM-54 need either STT or TWS with something selected (in which case it will go active immediately with reduced range).&lt;br /&gt;
&lt;br /&gt;
====How to Notch====&lt;br /&gt;
Notching means flying manoeuvrers to make an aircraft less detectable on radar/evade it. It is sometimes called beaming.&lt;br /&gt;
&lt;br /&gt;
If you are flying against an F-14, keep the F-14 on your 3 or 9 o'clock and make sure that seen from the F-14 point of view that he will see terrain behind you.&lt;br /&gt;
&lt;br /&gt;
====Datalink====&lt;br /&gt;
&lt;br /&gt;
Aircraft on datalink that are inside the radar field will be shown on TID (even if the radar is standby). The backseater needs to take care to enter the datalink channel at the top of the right panel (IFF is taken care of by the pilot at the top of the pilot's right panel).&lt;br /&gt;
&lt;br /&gt;
====Misc====&lt;br /&gt;
&lt;br /&gt;
RWS/TWS MAN/PDSearch/PSearch will able to show 19 targets, MP or not. TWS can show groundtrack on max 10 of them.&lt;br /&gt;
&lt;br /&gt;
Radar elevation, commanded and actual, is shown on gauge left of DDD display. It is in relation to horizon in all modes except PAL.&lt;br /&gt;
&lt;br /&gt;
Each mode remembers its own bars and az settings. So if you switch to 1 bar in RWS, and then switch to PD SEARCH it might have 8 bars, when you switch back to RWS you will have 1 bar again. Radar antennae elevation/azimuth is shared between modes though.&lt;br /&gt;
&lt;br /&gt;
====Moving Radar Azimuth Field Left and Right====&lt;br /&gt;
&lt;br /&gt;
There are no key bindings for moving the radar azimuth field left and right when not 120. To use this, enable it from FG joystick dialog.&lt;br /&gt;
&lt;br /&gt;
====Dual Control====&lt;br /&gt;
&lt;br /&gt;
When connecting the pilot will no longer be able to control the radar - it is all done from the dual control RIO MP seat. The RIO is able to control the station switches.&lt;br /&gt;
&lt;br /&gt;
Make sure that you as a RIO do not switch modes and stuff too fast, allow for a short moment for each change you make to propagate to the pilot.&lt;br /&gt;
&lt;br /&gt;
If the RIO selects something and it fails pilot screen will show selection handover fails, the pilot could try to press y to repeat the handover and if successful, and then ask RIO to cycle modes if RIO had commanded STT, to make the pilots radar try to enter STT again.&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
{{#ev:youtube|ibHrZyAQ1C4|||A tutorial video explaining how to fire the F-14B's missiles.|frame}}&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139019</id>
		<title>Grumman F-14 Tomcat Weapons Operations</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139019"/>
		<updated>2024-01-29T06:05:20Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Datalink */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to operate weapons and the related radar modes for the [[Grumman_F-14_Tomcat|Grumman F-14 Tomcat]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version Warning ==&lt;br /&gt;
{{Note|&lt;br /&gt;
Be aware that the documentation in this page refers to the development version of the F-14, which is maintained in a [https://github.com/Zaretto/fg-aircraft GitHub repository]. Some features might therefore not be available, if you use the less frequently updated version from [[FGAddon|FGAddon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The development of the weapons and radar in the F-14 are related to [https://discord.gg/MBWnqHC4 Operation Red Flag], the premier military aviation organization for the flight simulator FlightGear!&lt;br /&gt;
&lt;br /&gt;
== Weapons Operation ==&lt;br /&gt;
NB: Especially for gunning you might want to set SAS Roll to off to prevent the plane from oscillating when using aggressive stick input.&lt;br /&gt;
&lt;br /&gt;
NB: In some new versions of FlightGear, the {{Key press|w}} key is replaced by the {{Key press|m}} key to select weapons.&lt;br /&gt;
&lt;br /&gt;
===M61A1 Vulcan (gun)===&lt;br /&gt;
*At startup, the ammunition store is filled with 675 round. There is an option on the '''Fuel and Stores''' dialog in the '''Tomcat Controls''' Menu to allow the gun to be reloaded&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available {{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}. Having the HUD in this mode is not mandatory however when the HUD is in the right mode the guidance symbology will assist with target identification and aiming.&lt;br /&gt;
*Select Gun mode with the Stick Weapon Mode Selector ({{Key press|w}}). A pipper, the G symbol with a number showing approximately the remaining rounds x 100 and a closure rate scale are displayed in the HUD. The closure rate scale is active only if a target has been locked ({{Key press|y}}) by the radar with TWS AUTO mode (diamond on the HUD).&lt;br /&gt;
*Switch Master Arm on cycle with {{Key press|CTRL-w}}, the X on the G symbol means Master Arm off or in training mode.&lt;br /&gt;
* Press {{Key press|e}} to fire the gun.&lt;br /&gt;
&lt;br /&gt;
===AIM-9M Sidewinders===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD light&amp;quot; has 4 sidewinders, &amp;quot;FAD&amp;quot;, &amp;quot;FAD heavy&amp;quot; and &amp;quot;Bombcat&amp;quot; have 2 of them.&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available ({{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}).&lt;br /&gt;
* Select &amp;quot;SW&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Switch to the RIO view ({{Key press|Ctrl|v}}).&lt;br /&gt;
*Select pylons 1 and 8, down position, on the Armament panel, on RIO's left console. A shortcut toggles these two switches so you can select or deselect all AIM-9 in one keyboard stroke ({{Key press|Ctrl|m}}) without leaving pilot's view. If you have 4 sidewinders, then after shooting the first 2 you need to toggle the pylons 1 and 8 into the up position.&lt;br /&gt;
*Switch back to the pilot's view ({{Key press|Ctrl|v}}).&lt;br /&gt;
* Switch Master Arm on, you hear the search signal of the seeker head, a low volume buzz sound.&lt;br /&gt;
*Now prior to be fired, the AIM-9 must have a lock on a target. Multiplayers, AI aircraft, and AI tankers can be locked (radar lock with {{Key press|y}}). The minimal lock distance is 10 NM, the target must be approximately inside a 80° cone centred on datum line. When locked, the signal buzz volume becomes louder and the 2 red &amp;quot;LOCK&amp;quot; lights at the top of the canopy frame are lit. For best results try to shoot ({{Key press|e}}) at a 3 to 6 NM range and with the target centred on the aircraft velocity vector (when the 2 red &amp;quot;SHOOT&amp;quot; lights at the top of the canopy frame are lit). The missile will explode at the smaller distance possible. However if this distance is above 70 meters, it will continue its trajectory without guidance.&lt;br /&gt;
&lt;br /&gt;
===AIM-7 Sparrow and AIM-54 Phoenix===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD&amp;quot; has 2 Sparrows and 4 Phoenix, &amp;quot;FAD light&amp;quot; has 4 Sparrows, &amp;quot;FAD heavy&amp;quot; has 6 Phoenix.&lt;br /&gt;
*Select A/A Mode, master arm etc. as with Sidewinders.&lt;br /&gt;
*Select &amp;quot;SP-PH&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6 for the pylons below the belly, 1 and 8 under the wing in up position for &amp;quot;FAD&amp;quot; (2 Sparrows, the 2 Sidewinders are selected in the down position of 1/8.&lt;br /&gt;
*Obtain a radar lock by using {{Key press|y}} the the next target and {{Key press|Ctrl|y}} the the previous target.&lt;br /&gt;
*Launching the missiles is the same as for the Sidewinders, but there is no growling sound and the max shooting range are larger: up to 30+ nm for the {{Wikipedia|AIM-7_Sparrow}} and 100+ nm for the {{Wikipedia|AIM-54_Phoenix}}.&lt;br /&gt;
&lt;br /&gt;
===Bombs===&lt;br /&gt;
NB: only CCIP mode is implemented - and only dumb low-drag unguided bombs - and only single release.&lt;br /&gt;
*Select the right weapons' set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;Bombcat&amp;quot; has 4 Mk83 bombs.&lt;br /&gt;
*Master arm on&lt;br /&gt;
*Select A/G Mode&lt;br /&gt;
*Select &amp;quot;Off&amp;quot; mode with the Stick Weapon Mode Selector (yes, off - you will still be able to pull the trigger in A/G mode).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6.&lt;br /&gt;
*No need for locking with the radar. There is a CCIP in the HUD.&lt;br /&gt;
*Set wing sweep to manual and 55 deg.&lt;br /&gt;
*Make sure you are high above terrain (e.g. 10000 ft) and initiate a steep dive to 40 degs. Deploy speed brakes in order not to get too fast. Make sure wings are levelled, otherwise the bomb will not hit even though the pipper is on the target (there is currently no vertical bomb fall line implemented in the HUD).&lt;br /&gt;
*Release the bomb when the target is within the circle around the bottom of the HUD and before you reach 2000 ft above ground.&lt;br /&gt;
&lt;br /&gt;
Find out what is working for you - it is not that simple.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radar Scan Modes==&lt;br /&gt;
===Key Bindings===&lt;br /&gt;
{{Key press|y}}: Next target&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|y}}: Cycle azimuth field width&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|u}}: Undesignate (very useful for PAL mode)&lt;br /&gt;
&lt;br /&gt;
{{Key press|i}}: Tilt radar up&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|i}}: Tilt radar down&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|d}}: Cycle number of bars&lt;br /&gt;
&lt;br /&gt;
{{Key press|Ctrl|n}}: Cycle radar scan modes&lt;br /&gt;
&lt;br /&gt;
{{Key press|d}}: Pilot Auto Lockon mode (PAL) [click {{Key press|Ctrl|n}} to exit]&lt;br /&gt;
&lt;br /&gt;
{{Key press|r}}: Single Target Track mode (STT)&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|e}} and {{Key press|r}}: Radar range when not in PAL mode.&lt;br /&gt;
&lt;br /&gt;
{{Key press|q}}: Radar standby&lt;br /&gt;
&lt;br /&gt;
===Modes===&lt;br /&gt;
Use {{Key press|Ctrl|n}} to cycle between radar scan modes (alternatively press the corresponding buttons on the RIO's front console).&lt;br /&gt;
&lt;br /&gt;
'''PD SEARCH''': Has the longest RCS sensitivity of the modes. Will only show targets that has above/below a certain closure-rate. Notchable. Will not show targets altitude or heading.&lt;br /&gt;
&lt;br /&gt;
'''RWS''': Medium RCS sensitivity. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''P SEARCH''': Basically a ground/sea radar. Cannot be notched.&lt;br /&gt;
&lt;br /&gt;
'''PAL''': Scans the area around the HUD, fixed at 10nm range. Automatically enters STT for anything it sees. Note that when in this mode, none of the RIO mode push buttons will lit up.&lt;br /&gt;
&lt;br /&gt;
'''P STT''': Single target track. Cannot be notched, wont produce closure-rate output.&lt;br /&gt;
&lt;br /&gt;
'''PD STT''': Single target track. Can be notched.&lt;br /&gt;
&lt;br /&gt;
'''TWS MAN''': Once a target has been scanned twice within some seconds, groundtrack (headings) is displayed on TID. Only has 2 options for bars/az combinations. Has the shortest RCS sensitivity of the modes. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''TWS AUTO''': Is disabled / does not work.&lt;br /&gt;
&lt;br /&gt;
==== Missile Notes ====&lt;br /&gt;
&lt;br /&gt;
* AIM-7 needs STT mode.&lt;br /&gt;
&lt;br /&gt;
* AIM-9 needs STT mode or TWS mode with something selected. Or radar in standby, then it will lock onto whatever is at bore.&lt;br /&gt;
&lt;br /&gt;
* AIM-54 need either STT or TWS with something selected (in which case it will go active immediately with reduced range).&lt;br /&gt;
&lt;br /&gt;
====How to Notch====&lt;br /&gt;
Notching means flying manoeuvrers to make an aircraft less detectable on radar/evade it. It is sometimes called beaming.&lt;br /&gt;
&lt;br /&gt;
If you are flying against an F-14, keep the F-14 on your 3 or 9 o'clock and make sure that seen from the F-14 point of view that he will see terrain behind you.&lt;br /&gt;
&lt;br /&gt;
====Datalink====&lt;br /&gt;
&lt;br /&gt;
Aircraft on datalink that are inside the radar field will be shown on TID (even if the radar is standby). The backseater needs to take care to enter the datalink channel at the top of the right panel (IFF is taken care of by the pilot at the top of the pilot's right panel).&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
{{#ev:youtube|ibHrZyAQ1C4|||A tutorial video explaining how to fire the F-14B's missiles.|frame}}&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139018</id>
		<title>Grumman F-14 Tomcat Weapons Operations</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139018"/>
		<updated>2024-01-29T06:03:24Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* How to Notch */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to operate weapons and the related radar modes for the [[Grumman_F-14_Tomcat|Grumman F-14 Tomcat]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version Warning ==&lt;br /&gt;
{{Note|&lt;br /&gt;
Be aware that the documentation in this page refers to the development version of the F-14, which is maintained in a [https://github.com/Zaretto/fg-aircraft GitHub repository]. Some features might therefore not be available, if you use the less frequently updated version from [[FGAddon|FGAddon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The development of the weapons and radar in the F-14 are related to [https://discord.gg/MBWnqHC4 Operation Red Flag], the premier military aviation organization for the flight simulator FlightGear!&lt;br /&gt;
&lt;br /&gt;
== Weapons Operation ==&lt;br /&gt;
NB: Especially for gunning you might want to set SAS Roll to off to prevent the plane from oscillating when using aggressive stick input.&lt;br /&gt;
&lt;br /&gt;
NB: In some new versions of FlightGear, the {{Key press|w}} key is replaced by the {{Key press|m}} key to select weapons.&lt;br /&gt;
&lt;br /&gt;
===M61A1 Vulcan (gun)===&lt;br /&gt;
*At startup, the ammunition store is filled with 675 round. There is an option on the '''Fuel and Stores''' dialog in the '''Tomcat Controls''' Menu to allow the gun to be reloaded&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available {{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}. Having the HUD in this mode is not mandatory however when the HUD is in the right mode the guidance symbology will assist with target identification and aiming.&lt;br /&gt;
*Select Gun mode with the Stick Weapon Mode Selector ({{Key press|w}}). A pipper, the G symbol with a number showing approximately the remaining rounds x 100 and a closure rate scale are displayed in the HUD. The closure rate scale is active only if a target has been locked ({{Key press|y}}) by the radar with TWS AUTO mode (diamond on the HUD).&lt;br /&gt;
*Switch Master Arm on cycle with {{Key press|CTRL-w}}, the X on the G symbol means Master Arm off or in training mode.&lt;br /&gt;
* Press {{Key press|e}} to fire the gun.&lt;br /&gt;
&lt;br /&gt;
===AIM-9M Sidewinders===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD light&amp;quot; has 4 sidewinders, &amp;quot;FAD&amp;quot;, &amp;quot;FAD heavy&amp;quot; and &amp;quot;Bombcat&amp;quot; have 2 of them.&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available ({{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}).&lt;br /&gt;
* Select &amp;quot;SW&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Switch to the RIO view ({{Key press|Ctrl|v}}).&lt;br /&gt;
*Select pylons 1 and 8, down position, on the Armament panel, on RIO's left console. A shortcut toggles these two switches so you can select or deselect all AIM-9 in one keyboard stroke ({{Key press|Ctrl|m}}) without leaving pilot's view. If you have 4 sidewinders, then after shooting the first 2 you need to toggle the pylons 1 and 8 into the up position.&lt;br /&gt;
*Switch back to the pilot's view ({{Key press|Ctrl|v}}).&lt;br /&gt;
* Switch Master Arm on, you hear the search signal of the seeker head, a low volume buzz sound.&lt;br /&gt;
*Now prior to be fired, the AIM-9 must have a lock on a target. Multiplayers, AI aircraft, and AI tankers can be locked (radar lock with {{Key press|y}}). The minimal lock distance is 10 NM, the target must be approximately inside a 80° cone centred on datum line. When locked, the signal buzz volume becomes louder and the 2 red &amp;quot;LOCK&amp;quot; lights at the top of the canopy frame are lit. For best results try to shoot ({{Key press|e}}) at a 3 to 6 NM range and with the target centred on the aircraft velocity vector (when the 2 red &amp;quot;SHOOT&amp;quot; lights at the top of the canopy frame are lit). The missile will explode at the smaller distance possible. However if this distance is above 70 meters, it will continue its trajectory without guidance.&lt;br /&gt;
&lt;br /&gt;
===AIM-7 Sparrow and AIM-54 Phoenix===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD&amp;quot; has 2 Sparrows and 4 Phoenix, &amp;quot;FAD light&amp;quot; has 4 Sparrows, &amp;quot;FAD heavy&amp;quot; has 6 Phoenix.&lt;br /&gt;
*Select A/A Mode, master arm etc. as with Sidewinders.&lt;br /&gt;
*Select &amp;quot;SP-PH&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6 for the pylons below the belly, 1 and 8 under the wing in up position for &amp;quot;FAD&amp;quot; (2 Sparrows, the 2 Sidewinders are selected in the down position of 1/8.&lt;br /&gt;
*Obtain a radar lock by using {{Key press|y}} the the next target and {{Key press|Ctrl|y}} the the previous target.&lt;br /&gt;
*Launching the missiles is the same as for the Sidewinders, but there is no growling sound and the max shooting range are larger: up to 30+ nm for the {{Wikipedia|AIM-7_Sparrow}} and 100+ nm for the {{Wikipedia|AIM-54_Phoenix}}.&lt;br /&gt;
&lt;br /&gt;
===Bombs===&lt;br /&gt;
NB: only CCIP mode is implemented - and only dumb low-drag unguided bombs - and only single release.&lt;br /&gt;
*Select the right weapons' set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;Bombcat&amp;quot; has 4 Mk83 bombs.&lt;br /&gt;
*Master arm on&lt;br /&gt;
*Select A/G Mode&lt;br /&gt;
*Select &amp;quot;Off&amp;quot; mode with the Stick Weapon Mode Selector (yes, off - you will still be able to pull the trigger in A/G mode).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6.&lt;br /&gt;
*No need for locking with the radar. There is a CCIP in the HUD.&lt;br /&gt;
*Set wing sweep to manual and 55 deg.&lt;br /&gt;
*Make sure you are high above terrain (e.g. 10000 ft) and initiate a steep dive to 40 degs. Deploy speed brakes in order not to get too fast. Make sure wings are levelled, otherwise the bomb will not hit even though the pipper is on the target (there is currently no vertical bomb fall line implemented in the HUD).&lt;br /&gt;
*Release the bomb when the target is within the circle around the bottom of the HUD and before you reach 2000 ft above ground.&lt;br /&gt;
&lt;br /&gt;
Find out what is working for you - it is not that simple.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radar Scan Modes==&lt;br /&gt;
===Key Bindings===&lt;br /&gt;
{{Key press|y}}: Next target&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|y}}: Cycle azimuth field width&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|u}}: Undesignate (very useful for PAL mode)&lt;br /&gt;
&lt;br /&gt;
{{Key press|i}}: Tilt radar up&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|i}}: Tilt radar down&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|d}}: Cycle number of bars&lt;br /&gt;
&lt;br /&gt;
{{Key press|Ctrl|n}}: Cycle radar scan modes&lt;br /&gt;
&lt;br /&gt;
{{Key press|d}}: Pilot Auto Lockon mode (PAL) [click {{Key press|Ctrl|n}} to exit]&lt;br /&gt;
&lt;br /&gt;
{{Key press|r}}: Single Target Track mode (STT)&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|e}} and {{Key press|r}}: Radar range when not in PAL mode.&lt;br /&gt;
&lt;br /&gt;
{{Key press|q}}: Radar standby&lt;br /&gt;
&lt;br /&gt;
===Modes===&lt;br /&gt;
Use {{Key press|Ctrl|n}} to cycle between radar scan modes (alternatively press the corresponding buttons on the RIO's front console).&lt;br /&gt;
&lt;br /&gt;
'''PD SEARCH''': Has the longest RCS sensitivity of the modes. Will only show targets that has above/below a certain closure-rate. Notchable. Will not show targets altitude or heading.&lt;br /&gt;
&lt;br /&gt;
'''RWS''': Medium RCS sensitivity. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''P SEARCH''': Basically a ground/sea radar. Cannot be notched.&lt;br /&gt;
&lt;br /&gt;
'''PAL''': Scans the area around the HUD, fixed at 10nm range. Automatically enters STT for anything it sees. Note that when in this mode, none of the RIO mode push buttons will lit up.&lt;br /&gt;
&lt;br /&gt;
'''P STT''': Single target track. Cannot be notched, wont produce closure-rate output.&lt;br /&gt;
&lt;br /&gt;
'''PD STT''': Single target track. Can be notched.&lt;br /&gt;
&lt;br /&gt;
'''TWS MAN''': Once a target has been scanned twice within some seconds, groundtrack (headings) is displayed on TID. Only has 2 options for bars/az combinations. Has the shortest RCS sensitivity of the modes. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''TWS AUTO''': Is disabled / does not work.&lt;br /&gt;
&lt;br /&gt;
==== Missile Notes ====&lt;br /&gt;
&lt;br /&gt;
* AIM-7 needs STT mode.&lt;br /&gt;
&lt;br /&gt;
* AIM-9 needs STT mode or TWS mode with something selected. Or radar in standby, then it will lock onto whatever is at bore.&lt;br /&gt;
&lt;br /&gt;
* AIM-54 need either STT or TWS with something selected (in which case it will go active immediately with reduced range).&lt;br /&gt;
&lt;br /&gt;
====How to Notch====&lt;br /&gt;
Notching means flying manoeuvrers to make an aircraft less detectable on radar/evade it. It is sometimes called beaming.&lt;br /&gt;
&lt;br /&gt;
If you are flying against an F-14, keep the F-14 on your 3 or 9 o'clock and make sure that seen from the F-14 point of view that he will see terrain behind you.&lt;br /&gt;
&lt;br /&gt;
====Datalink====&lt;br /&gt;
&lt;br /&gt;
Aircraft on datalink that is inside the radar field will be shown on TID (even if radar is standby). Dual seaters should take care to enter same datalink channel.&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
{{#ev:youtube|ibHrZyAQ1C4|||A tutorial video explaining how to fire the F-14B's missiles.|frame}}&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139017</id>
		<title>Grumman F-14 Tomcat Weapons Operations</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139017"/>
		<updated>2024-01-27T13:49:46Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to operate weapons and the related radar modes for the [[Grumman_F-14_Tomcat|Grumman F-14 Tomcat]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version Warning ==&lt;br /&gt;
{{Note|&lt;br /&gt;
Be aware that the documentation in this page refers to the development version of the F-14, which is maintained in a [https://github.com/Zaretto/fg-aircraft GitHub repository]. Some features might therefore not be available, if you use the less frequently updated version from [[FGAddon|FGAddon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The development of the weapons and radar in the F-14 are related to [https://discord.gg/MBWnqHC4 Operation Red Flag], the premier military aviation organization for the flight simulator FlightGear!&lt;br /&gt;
&lt;br /&gt;
== Weapons Operation ==&lt;br /&gt;
NB: Especially for gunning you might want to set SAS Roll to off to prevent the plane from oscillating when using aggressive stick input.&lt;br /&gt;
&lt;br /&gt;
NB: In some new versions of FlightGear, the {{Key press|w}} key is replaced by the {{Key press|m}} key to select weapons.&lt;br /&gt;
&lt;br /&gt;
===M61A1 Vulcan (gun)===&lt;br /&gt;
*At startup, the ammunition store is filled with 675 round. There is an option on the '''Fuel and Stores''' dialog in the '''Tomcat Controls''' Menu to allow the gun to be reloaded&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available {{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}. Having the HUD in this mode is not mandatory however when the HUD is in the right mode the guidance symbology will assist with target identification and aiming.&lt;br /&gt;
*Select Gun mode with the Stick Weapon Mode Selector ({{Key press|w}}). A pipper, the G symbol with a number showing approximately the remaining rounds x 100 and a closure rate scale are displayed in the HUD. The closure rate scale is active only if a target has been locked ({{Key press|y}}) by the radar with TWS AUTO mode (diamond on the HUD).&lt;br /&gt;
*Switch Master Arm on cycle with {{Key press|CTRL-w}}, the X on the G symbol means Master Arm off or in training mode.&lt;br /&gt;
* Press {{Key press|e}} to fire the gun.&lt;br /&gt;
&lt;br /&gt;
===AIM-9M Sidewinders===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD light&amp;quot; has 4 sidewinders, &amp;quot;FAD&amp;quot;, &amp;quot;FAD heavy&amp;quot; and &amp;quot;Bombcat&amp;quot; have 2 of them.&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available ({{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}).&lt;br /&gt;
* Select &amp;quot;SW&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Switch to the RIO view ({{Key press|Ctrl|v}}).&lt;br /&gt;
*Select pylons 1 and 8, down position, on the Armament panel, on RIO's left console. A shortcut toggles these two switches so you can select or deselect all AIM-9 in one keyboard stroke ({{Key press|Ctrl|m}}) without leaving pilot's view. If you have 4 sidewinders, then after shooting the first 2 you need to toggle the pylons 1 and 8 into the up position.&lt;br /&gt;
*Switch back to the pilot's view ({{Key press|Ctrl|v}}).&lt;br /&gt;
* Switch Master Arm on, you hear the search signal of the seeker head, a low volume buzz sound.&lt;br /&gt;
*Now prior to be fired, the AIM-9 must have a lock on a target. Multiplayers, AI aircraft, and AI tankers can be locked (radar lock with {{Key press|y}}). The minimal lock distance is 10 NM, the target must be approximately inside a 80° cone centred on datum line. When locked, the signal buzz volume becomes louder and the 2 red &amp;quot;LOCK&amp;quot; lights at the top of the canopy frame are lit. For best results try to shoot ({{Key press|e}}) at a 3 to 6 NM range and with the target centred on the aircraft velocity vector (when the 2 red &amp;quot;SHOOT&amp;quot; lights at the top of the canopy frame are lit). The missile will explode at the smaller distance possible. However if this distance is above 70 meters, it will continue its trajectory without guidance.&lt;br /&gt;
&lt;br /&gt;
===AIM-7 Sparrow and AIM-54 Phoenix===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD&amp;quot; has 2 Sparrows and 4 Phoenix, &amp;quot;FAD light&amp;quot; has 4 Sparrows, &amp;quot;FAD heavy&amp;quot; has 6 Phoenix.&lt;br /&gt;
*Select A/A Mode, master arm etc. as with Sidewinders.&lt;br /&gt;
*Select &amp;quot;SP-PH&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6 for the pylons below the belly, 1 and 8 under the wing in up position for &amp;quot;FAD&amp;quot; (2 Sparrows, the 2 Sidewinders are selected in the down position of 1/8.&lt;br /&gt;
*Obtain a radar lock by using {{Key press|y}} the the next target and {{Key press|Ctrl|y}} the the previous target.&lt;br /&gt;
*Launching the missiles is the same as for the Sidewinders, but there is no growling sound and the max shooting range are larger: up to 30+ nm for the {{Wikipedia|AIM-7_Sparrow}} and 100+ nm for the {{Wikipedia|AIM-54_Phoenix}}.&lt;br /&gt;
&lt;br /&gt;
===Bombs===&lt;br /&gt;
NB: only CCIP mode is implemented - and only dumb low-drag unguided bombs - and only single release.&lt;br /&gt;
*Select the right weapons' set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;Bombcat&amp;quot; has 4 Mk83 bombs.&lt;br /&gt;
*Master arm on&lt;br /&gt;
*Select A/G Mode&lt;br /&gt;
*Select &amp;quot;Off&amp;quot; mode with the Stick Weapon Mode Selector (yes, off - you will still be able to pull the trigger in A/G mode).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6.&lt;br /&gt;
*No need for locking with the radar. There is a CCIP in the HUD.&lt;br /&gt;
*Set wing sweep to manual and 55 deg.&lt;br /&gt;
*Make sure you are high above terrain (e.g. 10000 ft) and initiate a steep dive to 40 degs. Deploy speed brakes in order not to get too fast. Make sure wings are levelled, otherwise the bomb will not hit even though the pipper is on the target (there is currently no vertical bomb fall line implemented in the HUD).&lt;br /&gt;
*Release the bomb when the target is within the circle around the bottom of the HUD and before you reach 2000 ft above ground.&lt;br /&gt;
&lt;br /&gt;
Find out what is working for you - it is not that simple.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radar Scan Modes==&lt;br /&gt;
===Key Bindings===&lt;br /&gt;
{{Key press|y}}: Next target&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|y}}: Cycle azimuth field width&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|u}}: Undesignate (very useful for PAL mode)&lt;br /&gt;
&lt;br /&gt;
{{Key press|i}}: Tilt radar up&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|i}}: Tilt radar down&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|d}}: Cycle number of bars&lt;br /&gt;
&lt;br /&gt;
{{Key press|Ctrl|n}}: Cycle radar scan modes&lt;br /&gt;
&lt;br /&gt;
{{Key press|d}}: Pilot Auto Lockon mode (PAL) [click {{Key press|Ctrl|n}} to exit]&lt;br /&gt;
&lt;br /&gt;
{{Key press|r}}: Single Target Track mode (STT)&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|e}} and {{Key press|r}}: Radar range when not in PAL mode.&lt;br /&gt;
&lt;br /&gt;
{{Key press|q}}: Radar standby&lt;br /&gt;
&lt;br /&gt;
===Modes===&lt;br /&gt;
Use {{Key press|Ctrl|n}} to cycle between radar scan modes (alternatively press the corresponding buttons on the RIO's front console).&lt;br /&gt;
&lt;br /&gt;
'''PD SEARCH''': Has the longest RCS sensitivity of the modes. Will only show targets that has above/below a certain closure-rate. Notchable. Will not show targets altitude or heading.&lt;br /&gt;
&lt;br /&gt;
'''RWS''': Medium RCS sensitivity. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''P SEARCH''': Basically a ground/sea radar. Cannot be notched.&lt;br /&gt;
&lt;br /&gt;
'''PAL''': Scans the area around the HUD, fixed at 10nm range. Automatically enters STT for anything it sees. Note that when in this mode, none of the RIO mode push buttons will lit up.&lt;br /&gt;
&lt;br /&gt;
'''P STT''': Single target track. Cannot be notched, wont produce closure-rate output.&lt;br /&gt;
&lt;br /&gt;
'''PD STT''': Single target track. Can be notched.&lt;br /&gt;
&lt;br /&gt;
'''TWS MAN''': Once a target has been scanned twice within some seconds, groundtrack (headings) is displayed on TID. Only has 2 options for bars/az combinations. Has the shortest RCS sensitivity of the modes. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''TWS AUTO''': Is disabled / does not work.&lt;br /&gt;
&lt;br /&gt;
==== Missile Notes ====&lt;br /&gt;
&lt;br /&gt;
* AIM-7 needs STT mode.&lt;br /&gt;
&lt;br /&gt;
* AIM-9 needs STT mode or TWS mode with something selected. Or radar in standby, then it will lock onto whatever is at bore.&lt;br /&gt;
&lt;br /&gt;
* AIM-54 need either STT or TWS with something selected (in which case it will go active immediately with reduced range).&lt;br /&gt;
&lt;br /&gt;
====How to Notch====&lt;br /&gt;
&lt;br /&gt;
If you are flying against an F-14, keep the F-14 on your 3 or 9 o'clock and make sure that seen from the F-14 point of view that he will see terrain behind you.&lt;br /&gt;
&lt;br /&gt;
====Datalink====&lt;br /&gt;
&lt;br /&gt;
Aircraft on datalink that is inside the radar field will be shown on TID (even if radar is standby). Dual seaters should take care to enter same datalink channel.&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
{{#ev:youtube|ibHrZyAQ1C4|||A tutorial video explaining how to fire the F-14B's missiles.|frame}}&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139016</id>
		<title>Grumman F-14 Tomcat Weapons Operations</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139016"/>
		<updated>2024-01-27T13:46:29Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to operate weapons and the related radar modes for the [[Grumman_F-14_Tomcat|Grumman F-14 Tomcat]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version Warning ==&lt;br /&gt;
{{Note|&lt;br /&gt;
Be aware that the documentation in this page refers to the development version of the F-14, which is maintained in a [https://github.com/Zaretto/fg-aircraft GitHub repository]. Some features might therefore not be available, if you use the less frequently updated version from [[FGAddon|FGAddon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The development of the weapons and radar in the F-14 are related to [https://discord.gg/MBWnqHC4 Operation Red Flag], the premier military aviation organization for the flight simulator FlightGear!&lt;br /&gt;
&lt;br /&gt;
== Weapons Operation ==&lt;br /&gt;
NB: Especially for gunning you might want to set SAS Roll to off to prevent the plane from oscillating when using aggressive stick input.&lt;br /&gt;
&lt;br /&gt;
NB: In some new versions of FlightGear, the {{Key press|w}} key is replaced by the {{Key press|m}} key to select weapons.&lt;br /&gt;
&lt;br /&gt;
===M61A1 Vulcan (gun)===&lt;br /&gt;
*At startup, the ammunition store is filled with 675 round. There is an option on the '''Fuel and Stores''' dialog in the '''Tomcat Controls''' Menu to allow the gun to be reloaded&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available {{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}. Having the HUD in this mode is not mandatory however when the HUD is in the right mode the guidance symbology will assist with target identification and aiming.&lt;br /&gt;
*Select Gun mode with the Stick Weapon Mode Selector ({{Key press|w}}). A pipper, the G symbol with a number showing approximately the remaining rounds x 100 and a closure rate scale are displayed in the HUD. The closure rate scale is active only if a target has been locked ({{Key press|y}}) by the radar with TWS AUTO mode (diamond on the HUD).&lt;br /&gt;
*Switch Master Arm on cycle with {{Key press|CTRL-w}}, the X on the G symbol means Master Arm off or in training mode.&lt;br /&gt;
* Press {{Key press|e}} to fire the gun.&lt;br /&gt;
&lt;br /&gt;
===AIM-9M Sidewinders===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD light&amp;quot; has 4 sidewinders, &amp;quot;FAD&amp;quot;, &amp;quot;FAD heavy&amp;quot; and &amp;quot;Bombcat&amp;quot; have 2 of them.&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available ({{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}).&lt;br /&gt;
* Select &amp;quot;SW&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Switch to the RIO view ({{Key press|Ctrl|v}}).&lt;br /&gt;
*Select pylons 1 and 8, down position, on the Armament panel, on RIO's left console. A shortcut toggles these two switches so you can select or deselect all AIM-9 in one keyboard stroke ({{Key press|Ctrl|m}}) without leaving pilot's view. If you have 4 sidewinders, then after shooting the first 2 you need to toggle the pylons 1 and 8 into the up position.&lt;br /&gt;
*Switch back to the pilot's view ({{Key press|Ctrl|v}}).&lt;br /&gt;
* Switch Master Arm on, you hear the search signal of the seeker head, a low volume buzz sound.&lt;br /&gt;
*Now prior to be fired, the AIM-9 must have a lock on a target. Multiplayers, AI aircraft, and AI tankers can be locked (radar lock with {{Key press|y}}). The minimal lock distance is 10 NM, the target must be approximately inside a 80° cone centred on datum line. When locked, the signal buzz volume becomes louder and the 2 red &amp;quot;LOCK&amp;quot; lights at the top of the canopy frame are lit. For best results try to shoot ({{Key press|e}}) at a 3 to 6 NM range and with the target centred on the aircraft velocity vector (when the 2 red &amp;quot;SHOOT&amp;quot; lights at the top of the canopy frame are lit). The missile will explode at the smaller distance possible. However if this distance is above 70 meters, it will continue its trajectory without guidance.&lt;br /&gt;
&lt;br /&gt;
===AIM-7 Sparrow and AIM-54 Phoenix===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD&amp;quot; has 2 Sparrows and 4 Phoenix, &amp;quot;FAD light&amp;quot; has 4 Sparrows, &amp;quot;FAD heavy&amp;quot; has 6 Phoenix.&lt;br /&gt;
*Select A/A Mode, master arm etc. as with Sidewinders.&lt;br /&gt;
*Select &amp;quot;SP-PH&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6 for the pylons below the belly, 1 and 8 under the wing in up position for &amp;quot;FAD&amp;quot; (2 Sparrows, the 2 Sidewinders are selected in the down position of 1/8.&lt;br /&gt;
*Obtain a radar lock by using {{Key press|y}} the the next target and {{Key press|Ctrl|y}} the the previous target.&lt;br /&gt;
*Launching the missiles is the same as for the Sidewinders, but there is no growling sound and the max shooting range are larger: up to 30+ nm for the {{Wikipedia|AIM-7_Sparrow}} and 100+ nm for the {{Wikipedia|AIM-54_Phoenix}}.&lt;br /&gt;
&lt;br /&gt;
===Bombs===&lt;br /&gt;
NB: only CCIP mode is implemented - and only dumb low-drag unguided bombs - and only single release.&lt;br /&gt;
*Select the right weapons' set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;Bombcat&amp;quot; has 4 Mk83 bombs.&lt;br /&gt;
*Master arm on&lt;br /&gt;
*Select A/G Mode&lt;br /&gt;
*Select &amp;quot;Off&amp;quot; mode with the Stick Weapon Mode Selector (yes, off - you will still be able to pull the trigger in A/G mode).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6.&lt;br /&gt;
*No need for locking with the radar. There is a CCIP in the HUD.&lt;br /&gt;
*Set wing sweep to manual and 55 deg.&lt;br /&gt;
*Make sure you are high above terrain (e.g. 10000 ft) and initiate a steep dive to 40 degs. Deploy speed brakes in order not to get too fast. Make sure wings are levelled, otherwise the bomb will not hit even though the pipper is on the target (there is currently no vertical bomb fall line implemented in the HUD).&lt;br /&gt;
*Release the bomb when the target is within the circle around the bottom of the HUD and before you reach 2000 ft above ground.&lt;br /&gt;
&lt;br /&gt;
Find out what is working for you - it is not that simple.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radar Scan Modes==&lt;br /&gt;
===Key Bindings===&lt;br /&gt;
{{Key press|y}}: Next target&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|y}}: Cycle azimuth field width&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|u}}: Undesignate (very useful for PAL mode)&lt;br /&gt;
&lt;br /&gt;
{{Key press|i}}: Tilt radar up&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|i}}: Tilt radar down&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|d}}: Cycle number of bars&lt;br /&gt;
&lt;br /&gt;
{{Key press|Ctrl|n}}: Cycle radar scan modes&lt;br /&gt;
&lt;br /&gt;
{{Key press|d}}: Pilot Auto Lockon mode (PAL) [click {{Key press|Ctrl|n}} to exit]&lt;br /&gt;
&lt;br /&gt;
{{Key press|r}}: Single Target Track mode (STT)&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|e}} and {{Key press|r}}: Radar range when not in PAL mode.&lt;br /&gt;
&lt;br /&gt;
{{Key press|q}}: Radar standby&lt;br /&gt;
&lt;br /&gt;
===Modes===&lt;br /&gt;
Use {{Key press|Ctrl|n}} to cycle between radar scan modes (alternatively press the corresponding buttons on the RIO's front console).&lt;br /&gt;
&lt;br /&gt;
'''PD SEARCH''': Has the longest RCS sensitivity of the modes. Will only show targets that has above/below a certain closure-rate. Notchable. Will not show targets altitude or heading.&lt;br /&gt;
&lt;br /&gt;
'''RWS''': Medium RCS sensitivity. Notchable.&lt;br /&gt;
&lt;br /&gt;
'''P SEARCH''': Basically a ground/sea radar. Cannot be notched.&lt;br /&gt;
&lt;br /&gt;
'''PAL''': Scans the area around the HUD, fixed at 10nm range. Automatically enters STT for anything it sees. Note that when in this mode, none of the RIO mode push buttons will lit up.&lt;br /&gt;
&lt;br /&gt;
'''P STT''': Single target track. Cannot be notched, wont produce closure-rate output.&lt;br /&gt;
&lt;br /&gt;
'''PD STT''': Single target track. Can be notched.&lt;br /&gt;
&lt;br /&gt;
'''TWS MAN''': Once a target has been scanned twice within some seconds, groundtrack (headings) is displayed on TID. Only has 2 options for bars/az combinations. Has the shortest RCS sensitivity of the modes. Notchable.&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
{{#ev:youtube|ibHrZyAQ1C4|||A tutorial video explaining how to fire the F-14B's missiles.|frame}}&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139015</id>
		<title>Grumman F-14 Tomcat Weapons Operations</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Grumman_F-14_Tomcat_Weapons_Operations&amp;diff=139015"/>
		<updated>2024-01-27T13:44:11Z</updated>

		<summary type="html">&lt;p&gt;Vanosten: /* Radar Scan Modes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page explains how to operate weapons and the related radar modes for the [[Grumman_F-14_Tomcat|Grumman F-14 Tomcat]].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Version Warning ==&lt;br /&gt;
{{Note|&lt;br /&gt;
Be aware that the documentation in this page refers to the development version of the F-14, which is maintained in a [https://github.com/Zaretto/fg-aircraft GitHub repository]. Some features might therefore not be available, if you use the less frequently updated version from [[FGAddon|FGAddon]].&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
The development of the weapons and radar in the F-14 are related to [https://discord.gg/MBWnqHC4 Operation Red Flag], the premier military aviation organization for the flight simulator FlightGear!&lt;br /&gt;
&lt;br /&gt;
== Weapons Operation ==&lt;br /&gt;
NB: Especially for gunning you might want to set SAS Roll to off to prevent the plane from oscillating when using aggressive stick input.&lt;br /&gt;
&lt;br /&gt;
NB: In some new versions of FlightGear, the {{Key press|w}} key is replaced by the {{Key press|m}} key to select weapons.&lt;br /&gt;
&lt;br /&gt;
===M61A1 Vulcan (gun)===&lt;br /&gt;
*At startup, the ammunition store is filled with 675 round. There is an option on the '''Fuel and Stores''' dialog in the '''Tomcat Controls''' Menu to allow the gun to be reloaded&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available {{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}. Having the HUD in this mode is not mandatory however when the HUD is in the right mode the guidance symbology will assist with target identification and aiming.&lt;br /&gt;
*Select Gun mode with the Stick Weapon Mode Selector ({{Key press|w}}). A pipper, the G symbol with a number showing approximately the remaining rounds x 100 and a closure rate scale are displayed in the HUD. The closure rate scale is active only if a target has been locked ({{Key press|y}}) by the radar with TWS AUTO mode (diamond on the HUD).&lt;br /&gt;
*Switch Master Arm on cycle with {{Key press|CTRL-w}}, the X on the G symbol means Master Arm off or in training mode.&lt;br /&gt;
* Press {{Key press|e}} to fire the gun.&lt;br /&gt;
&lt;br /&gt;
===AIM-9M Sidewinders===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD light&amp;quot; has 4 sidewinders, &amp;quot;FAD&amp;quot;, &amp;quot;FAD heavy&amp;quot; and &amp;quot;Bombcat&amp;quot; have 2 of them.&lt;br /&gt;
*Select HUD A/A Mode on the Display panel, on pilot's right console. A multikey shortcut is also available ({{Key press|:}}{{Key press|A}}{{Key press|H}}{{Key press|a}}).&lt;br /&gt;
* Select &amp;quot;SW&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Switch to the RIO view ({{Key press|Ctrl|v}}).&lt;br /&gt;
*Select pylons 1 and 8, down position, on the Armament panel, on RIO's left console. A shortcut toggles these two switches so you can select or deselect all AIM-9 in one keyboard stroke ({{Key press|Ctrl|m}}) without leaving pilot's view. If you have 4 sidewinders, then after shooting the first 2 you need to toggle the pylons 1 and 8 into the up position.&lt;br /&gt;
*Switch back to the pilot's view ({{Key press|Ctrl|v}}).&lt;br /&gt;
* Switch Master Arm on, you hear the search signal of the seeker head, a low volume buzz sound.&lt;br /&gt;
*Now prior to be fired, the AIM-9 must have a lock on a target. Multiplayers, AI aircraft, and AI tankers can be locked (radar lock with {{Key press|y}}). The minimal lock distance is 10 NM, the target must be approximately inside a 80° cone centred on datum line. When locked, the signal buzz volume becomes louder and the 2 red &amp;quot;LOCK&amp;quot; lights at the top of the canopy frame are lit. For best results try to shoot ({{Key press|e}}) at a 3 to 6 NM range and with the target centred on the aircraft velocity vector (when the 2 red &amp;quot;SHOOT&amp;quot; lights at the top of the canopy frame are lit). The missile will explode at the smaller distance possible. However if this distance is above 70 meters, it will continue its trajectory without guidance.&lt;br /&gt;
&lt;br /&gt;
===AIM-7 Sparrow and AIM-54 Phoenix===&lt;br /&gt;
*Select a weapons set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;FAD&amp;quot; has 2 Sparrows and 4 Phoenix, &amp;quot;FAD light&amp;quot; has 4 Sparrows, &amp;quot;FAD heavy&amp;quot; has 6 Phoenix.&lt;br /&gt;
*Select A/A Mode, master arm etc. as with Sidewinders.&lt;br /&gt;
*Select &amp;quot;SP-PH&amp;quot; mode with the Stick Weapon Mode Selector ({{Key press|w}}).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6 for the pylons below the belly, 1 and 8 under the wing in up position for &amp;quot;FAD&amp;quot; (2 Sparrows, the 2 Sidewinders are selected in the down position of 1/8.&lt;br /&gt;
*Obtain a radar lock by using {{Key press|y}} the the next target and {{Key press|Ctrl|y}} the the previous target.&lt;br /&gt;
*Launching the missiles is the same as for the Sidewinders, but there is no growling sound and the max shooting range are larger: up to 30+ nm for the {{Wikipedia|AIM-7_Sparrow}} and 100+ nm for the {{Wikipedia|AIM-54_Phoenix}}.&lt;br /&gt;
&lt;br /&gt;
===Bombs===&lt;br /&gt;
NB: only CCIP mode is implemented - and only dumb low-drag unguided bombs - and only single release.&lt;br /&gt;
*Select the right weapons' set using the menu: Tomcat Controls &amp;gt; Fuel and Stores: &amp;quot;Bombcat&amp;quot; has 4 Mk83 bombs.&lt;br /&gt;
*Master arm on&lt;br /&gt;
*Select A/G Mode&lt;br /&gt;
*Select &amp;quot;Off&amp;quot; mode with the Stick Weapon Mode Selector (yes, off - you will still be able to pull the trigger in A/G mode).&lt;br /&gt;
*Set the appropriate pylons into the up position: 3, 4, 5, 6.&lt;br /&gt;
*No need for locking with the radar. There is a CCIP in the HUD.&lt;br /&gt;
*Set wing sweep to manual and 55 deg.&lt;br /&gt;
*Make sure you are high above terrain (e.g. 10000 ft) and initiate a steep dive to 40 degs. Deploy speed brakes in order not to get too fast. Make sure wings are levelled, otherwise the bomb will not hit even though the pipper is on the target (there is currently no vertical bomb fall line implemented in the HUD).&lt;br /&gt;
*Release the bomb when the target is within the circle around the bottom of the HUD and before you reach 2000 ft above ground.&lt;br /&gt;
&lt;br /&gt;
Find out what is working for you - it is not that simple.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Radar Scan Modes==&lt;br /&gt;
===Key Bindings===&lt;br /&gt;
{{Key press|y}}: Next target&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|y}}: Cycle azimuth field width&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|u}}: Undesignate (very useful for PAL mode)&lt;br /&gt;
&lt;br /&gt;
{{Key press|i}}: Tilt radar up&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|i}}: Tilt radar down&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|d}}: Cycle number of bars&lt;br /&gt;
&lt;br /&gt;
{{Key press|Ctrl|n}}: Cycle radar scan modes&lt;br /&gt;
&lt;br /&gt;
{{Key press|d}}: Pilot Auto Lockon mode (PAL) [click {{Key press|Ctrl|n}} to exit]&lt;br /&gt;
&lt;br /&gt;
{{Key press|r}}: Single Target Track mode (STT)&lt;br /&gt;
&lt;br /&gt;
{{Key press|Shift|e}} and {{Key press|r}}: Radar range when not in PAL mode.&lt;br /&gt;
&lt;br /&gt;
{{Key press|q}}: Radar standby&lt;br /&gt;
&lt;br /&gt;
===Modes===&lt;br /&gt;
Use {{Key press|Ctrl|n}} to cycle betwee radar scan modes (alternatively press the corresponding buttons on the RIO's front console).&lt;br /&gt;
&lt;br /&gt;
==Related Information==&lt;br /&gt;
{{#ev:youtube|ibHrZyAQ1C4|||A tutorial video explaining how to fire the F-14B's missiles.|frame}}&lt;/div&gt;</summary>
		<author><name>Vanosten</name></author>
	</entry>
</feed>