Pdf1 Documents Found in $FG ROOT/Docs As Part of Your Flightgear Installation
Total Page:16
File Type:pdf, Size:1020Kb
osm2city Documentation Release 1.0 osm2city team Feb 27, 2021 Contents 1 Using Generated Scenery [User]3 1.1 Finding and Downloading a osm2city Scenery.............................3 1.2 Adding to FG_SCENERY Path.....................................3 1.3 Adjusting Visibility of Scenery Objects.................................3 1.4 Disable Urban Shader and Random Buildings..............................4 1.5 Showing Detailed Objects........................................6 1.6 Change Materials to Hide Urban Textures................................6 1.7 Change Materials to Not Crash FG for Sceneries with Shader Buildings (BUILDING_LIST).....8 2 Installation [Builder] 11 2.1 Pre-requisites............................................... 11 2.2 Installation of osm2city......................................... 12 2.3 Setting up PostGIS............................................ 13 2.4 Other Tools................................................ 14 3 Preparation [Builder] 17 3.1 Creating a Directory Structure...................................... 17 3.2 Getting OpenStreetMap Data...................................... 18 3.3 Setting a Minimal Set of Parameters................................... 19 3.4 Generating Elevation Data........................................ 20 4 Scenery Generation [Builder] 21 4.1 Setting the Working Directory...................................... 21 4.2 Creating the Texture Atlas........................................ 21 4.3 Internet Connection for WikiData.................................... 22 4.4 Running the Generation Scripts with build_tiles.py........................... 22 4.5 Consider Sharing Your Generated Scenery Objects........................... 23 5 Parameters [Builder] 25 5.1 View a List of Parameters........................................ 25 5.2 Important Parameters........................................... 26 5.3 Buildings................................................. 27 5.4 Linear Objects (Roads, Railways).................................... 41 5.5 Land-Use................................................. 43 5.6 Textures................................................. 47 5.7 Other Parameters............................................. 47 i 6 How osm2city Works 51 6.1 Specific Stuff............................................... 52 7 Appendix 59 7.1 OSM Data in a PostGIS Database [Builder]............................... 59 7.2 Developer Information.......................................... 59 ii osm2city Documentation, Release 1.0 While the article on FlightGear’s Wiki presents in general terms what osm2city is and which features it has, this manual goes into depth with many aspects of generating scenery objects based on OpenStreetMap (OSM) data and deploying/using them in FlightGear. Before you generate your own sceneries, you might want to get familiar with the output of osm2city by first deploy- ing some of the downloadable osm2city sceneries and have a look at chapter Using Generated Scenery. See amongst others Areas populated with osm2city scenery or look for announcements in the Sceneries part of the FlightGear Forums. User in the context of this guide means the end user in FlightGear using osm2city generated sceneries. Builder means a person using osm2city to generate a scenery. Contents: Contents 1 osm2city Documentation, Release 1.0 2 Contents CHAPTER 1 Using Generated Scenery [User] 1.1 Finding and Downloading a osm2city Scenery The FlightGear wiki article Howto: Install Scenery has a general overview over installing scenery in FlightGear. Areas populated with osm2city scenery is the best way currently to find osm2city generated sceneries. That wiki page also list which sceneries can be downloaded in Terrasync and for which FlightGear version. The plan for the future is to have the whole world available in constantly updated versions — however as of spring 2017 this is not yet a reality. Even though a scenery might be available for download in TerraSync, you might want to download offline by using a tool like TerraMaster or terrasync.py, because the volume of data can be quite comprehensive — the faster you fly and the slower your internet connection, the rougher the experience will be. 1.2 Adding to FG_SCENERY Path You need to add the directory containing the Buildings, Pylons and Roads folders to the path, where Flight- Gear searches for scenery. You can to this either through the command line option --fg-scenery or setting the FG_SCENERY environment variable. This is extensively described in the README.scenery and the getstart. pdf1 documents found in $FG_ROOT/Docs as part of your FlightGear installation. If you followed the directory structure presented in chapter Preparation and we take the example of LSZS then you would e.g. use the following command line option: --fg-scenery=/home/pingu/fg_customscenery/LSZS 1.3 Adjusting Visibility of Scenery Objects The osm2city related programs and especially buildings.py are using heuristics and parameters to determine at what level of detail (LOD) scenery objects should be visible. This is done by adding the objects to one of the three 1 As of November 2016: chapters 3.1 and 4.2.2 3 osm2city Documentation, Release 1.0 FlightGear LOD schemes: “rough” or “detailed” (“bare” is not used). For buildings.py before creating a scenery you can influence into which of the two LOD ranges the objects are placed by using the following Parameters: • LOD_ALWAYS_DETAIL_BELOW_AREA • LOD_ALWAYS_ROUGH_ABOVE_AREA • LOD_ALWAYS_ROUGH_ABOVE_LEVELS • LOD_ALWAYS_DETAIL_BELOW_LEVELS • LOD_PERCENTAGE_DETAIL In FlightGear as a scenery user you influence the actual distance (in meters) for the respective ranges by one of the following ways: 1. In The FlightGear user interface use menu View > menu item Adjust LOD Ranges and then change the values manually. 2. Include command line options into your fgfsrc file or Properties in FGRun like follows (adjust the values to your needs and depending on your hardware capabilities): --prop:double:/sim/rendering/static-lod/detailed=5000 --prop:double:/sim/rendering/static-lod/rough=10000 --prop:/sim/rendering/max-paged-lod=400 See also PagedLOD. 1.4 Disable Urban Shader and Random Buildings There is no point in having both OSM building scenery objects and dynamically generated buildings in FlightGear. Therefore it is recommended to turn off the random building and urban shader features in FlightGear. Please be aware that this will also affect those areas in FlightGear, where there are no generated scenery objects from OSM. Use the FlightGear menu View, menu item Rendering Options. • Scenery layers: * Buildings: Choose OpenStreetMap Data (i.e. Randomly Generated is turned off) * Pylons and power lines: not only used for electrical power pylons and cables, but also e.g. wind turbines * Detailed Roads and Railways: draped over the grey roads and railways lines in the default scenery. • If you also enable Atmospheric Light Scattering (ALS) you also get better effects during day and night as well as moving cars. Not using ALS might give odd graphical effects. 4 Chapter 1. Using Generated Scenery [User] osm2city Documentation, Release 1.0 In the same dialog press the Shader Options button and set the slider for Urban to the far left in order to disable the urban shader. 1.4. Disable Urban Shader and Random Buildings 5 osm2city Documentation, Release 1.0 1.5 Showing Detailed Objects NB: this is only needed if you are using a FlightGear version 2020.3 or older. Some of the generated sceneries might contain a sub-folder Details apart from e.g. Buildings. If you want to show more scenery details like railway overhead lines, smaller electrical pylons and cables, railway platforms etc. (and accept that this might drain some system resources), then rename the folder to Objects. 1.6 Change Materials to Hide Urban Textures FlightGear allows to change the texture used for a given land-class. More information is available in $FG_ROOT/ Docs/README.materials as well as in the FlightGear Forum thread regarding New Regional Textures. There is not yet a good base texture replacing the urban textures. However many users find it more visually appealing to use a uniform texture like grass under the generated buildings etc. instead of urban textures (because urban textures interfere visually with ways, houses etc.). A drawback of using different textures is the absence of trees — however in many regions of the world there are lot of trees / vegetation in urban areas. An important drawback is that you will find the texturing missing when flying high over ground (due to level of distance not loading OSM objects) or for stuff far in the distance, where OSM data has not yet been loaded. E.g. for the airport LSZS in Engadin in Switzerland you would have to go to $FG_ROOT/Materials/regions and edit file europe.xml in a text editor: add name-tags for e.g. BuiltUpCover, Urban, Town, SubUrban to a material as shown below and comment out the existing name-tags using <!-- -->. Basically all name-tags, which relate to a material using <effect>Effects/urban</effect>. The outcome before and after edit (you need to restart FlightGear in between!) can be seen in the screenshots below (for illustration purposes the buildings and roads do not have textures). ... <material> (continues on next page) 6 Chapter 1. Using Generated Scenery [User] osm2city Documentation, Release 1.0 (continued from previous page) <effect>Effects/cropgrass</effect> <tree-effect>Effects/tree-european-mixed</tree-effect> <name>CropGrassCover</name> <name>CropGrass</name> <name>BuiltUpCover</name>