Board index FlightGear Development Scenery

tg-construct 2.1.0 won't construct my scenery  Topic is solved

Questions and discussion about enhancing and populating the FlightGear world.

Re: tg-construct 2.1.0 won't construct my scenery

Postby TheEagle » Mon Jul 26, 2021 12:27 am

@wkitty: Can you tell me where the elevation data for the world scenery 2.0 was taken from ? If I would use that, it should be fine … But why can't FG just add the runway lamps and the runway texture on top of the existing terrain and done ? Why is this so complicated ?
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: tg-construct 2.1.0 won't construct my scenery

Postby wkitty42 » Mon Jul 26, 2021 12:46 am

i don't know where the data came from... i do know that it needed to be massaged in some places... this is why the seashore has roads and buildings in it, for one thing...

as for why it is so complicated, part of it is because the current method cuts the mesh to fit the airports in... WS3 will drape them over the terrain mesh so things are much easier...

but i'm not sure about the runway terrain and lamps, either... i don't recall those being placed in the stuff i did... at least not the lamps... i didn't place them, anyway... i think they are placed another way but it has been several years since i dug into scenery stuff... i gave up because it was so complicated and decided to learn more about other parts of FG, instead... plus there was already word/discussion about WS3 and how it might work compared to WS2... so i decided to wait and bide my time until the work was done by others more knowledgeable than myself in those areas of code...

to clarify, what i toyed about with was building Diego Garcia to try to remove some z-fighting that was going on in the terrain for the island... it was annoyingly distracting and almost seizure inducing for me flying low and slow looking at everything...
"You get more air close to the ground," said Angalo. "I read that in a book. You get lots of air low down, and not much when you go up."
"Why not?" said Gurder.
"Dunno. It's frightened of heights, I guess."
User avatar
wkitty42
 
Posts: 9148
Joined: Fri Feb 20, 2015 4:46 pm
Location: central NC, USA
Callsign: wk42
Version: git next
OS: Kubuntu 20.04

Re: tg-construct 2.1.0 won't construct my scenery

Postby V12 » Mon Jul 26, 2021 3:55 am

TheEagle wrote in Mon Jul 26, 2021 12:27 am:Why is this so complicated ?

Reason is simple. 20 years ago computers had not enough power to realtime mesh calculations and one mesh for all was better solution than local airport mesh blended with base terrain (MS FSX solution). One mesh is faster, but very problematic for additional modification.
Fly high, fly fast - fly Concorde !
V12
 
Posts: 2757
Joined: Thu Jan 12, 2017 5:27 pm
Location: LZIB
Callsign: BAWV12

Re: tg-construct 2.1.0 won't construct my scenery

Postby TheEagle » Tue Jul 27, 2021 10:30 am

Okay, last try: Is there any way I can get .hgt files / .arr + .fit files from the TerraSync terrain and put my airport on that ?
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: tg-construct 2.1.0 won't construct my scenery

Postby TheEagle » Tue Jul 27, 2021 10:13 pm

I have narrowed down the source of the elevation problems by running tg-construct only with the AirportArea data:
Code: Select all
~$ tg-construct --threads=9999 --priorities=tg-prio.txt --work-dir=./work --output-dir=../fgscenery/MtBrocken-landing-strip/Terrain --tile-id=3122034 AirportArea
    0.01 [ALRT]:general    tg-construct version 2.1.0

    0.01 [ALRT]:general    Output directory is ../fgscenery/MtBrocken-landing-strip/Terrain
    0.01 [ALRT]:general    Working directory is ./work
    0.01 [ALRT]:general    Shared directory is ./work/Shared
    0.01 [ALRT]:general    Match directory is
    0.01 [ALRT]:general    Tile id is 3122034
    0.01 [ALRT]:general    Nudge is 0
    0.01 [ALRT]:general    Load directory: AirportArea
    0.01 [ALRT]:general    Priorities file is tg-prio.txt
    0.01 [ALRT]:general    Building tile 3122034
    0.04 [ALRT]:general    3122034 - Construct in e010n50/e010n51 tile 1 of 1 using thread 139739428542208
    0.04 [ALRT]:general    3122034 - Loading landclass polys
    0.05 [ALRT]:general    3122034 - Clipping landclass polys
    0.06 [ALRT]:general    3122034 - Cleaning landclass polys
    1.45 [ALRT]:general    3122034 - Construct in e010n50/e010n51 tile 1 of 1 using thread 139739536783104
    1.45 [ALRT]:general    3122034 - Fix T-Junctions
    1.45 [ALRT]:general    3122034 - Tesselate
    1.47 [ALRT]:general    3122034 - Lookup Nodes Per Vertex
    1.47 [ALRT]:general    3122034 - Calculate Elevation Per Node
    1.47 [ALRT]:general    3122034 - Lookup Faces Per Node
    2.89 [ALRT]:general    3122034 - Construct in e010n50/e010n51 tile 1 of 1 using thread 139655535302400
    2.89 [ALRT]:general    3122034 - Lookup Faces Per Node (again)
    2.89 [ALRT]:general    3122034 - Average Edge Node Elevations
    2.89 [ALRT]:general    3122034 - Calculate Face Normals
    2.89 [ALRT]:general    3122034 - Calculate Point Normals
    2.89 [ALRT]:general    3122034 - Calculate Texture Coordinates
    2.89 [ALRT]:general    3122034 - Generate BTG File
    2.91 [ALRT]:general    3122034 - Generate Custom Objects
    4.35 [ALRT]:general    [Finished successfully]

Elapsed time: 4.35512 seconds

This is the result:
Image
Exactly the same result. But when I run tg-construct with the AirportObj, SRTM-3 and Default data
Code: Select all
~$ tg-construct --threads --priorities=tg-prio.txt --work-dir=./work --output-dir=../fgscenery/MtBrocken-landing-strip/Terrain --tile-id=3122034 AirportObj SRTM-3 Default
    0.01 [ALRT]:general    tg-construct version 2.1.0

    0.01 [ALRT]:general    Output directory is ../fgscenery/MtBrocken-landing-strip/Terrain
    0.01 [ALRT]:general    Working directory is ./work
    0.01 [ALRT]:general    Shared directory is ./work/Shared
    0.01 [ALRT]:general    Match directory is
    0.01 [ALRT]:general    Tile id is 3122034
    0.01 [ALRT]:general    Nudge is 0
    0.01 [ALRT]:general    Load directory: AirportObj
    0.01 [ALRT]:general    Load directory: SRTM-3
    0.01 [ALRT]:general    Load directory: Default
    0.01 [ALRT]:general    Priorities file is tg-prio.txt
    0.01 [ALRT]:general    Building tile 3122034
    0.04 [ALRT]:general    3122034 - Construct in e010n50/e010n51 tile 1 of 1 using thread 140542651844352
    0.32 [ALRT]:general    3122034 - Loading landclass polys
    0.33 [ALRT]:general    3122034 - Clipping landclass polys
    0.33 [ALRT]:general    3122034 - Cleaning landclass polys
    1.86 [ALRT]:general    3122034 - Construct in e010n50/e010n51 tile 1 of 1 using thread 140542643451648
    2.28 [ALRT]:general    3122034 - Fix T-Junctions
    3.13 [ALRT]:general    3122034 - Tesselate
    4.61 [ALRT]:general    3122034 - Lookup Nodes Per Vertex
    4.66 [ALRT]:general    3122034 - Calculate Elevation Per Node
    4.67 [ALRT]:general    3122034 - Lookup Faces Per Node
    6.14 [ALRT]:general    3122034 - Construct in e010n50/e010n51 tile 1 of 1 using thread 140458635405056
    7.16 [ALRT]:general    3122034 - Lookup Faces Per Node (again)
    7.26 [ALRT]:general    3122034 - Average Edge Node Elevations
    7.26 [ALRT]:general    3122034 - Calculate Face Normals
    7.30 [ALRT]:general    3122034 - Calculate Point Normals
    7.32 [ALRT]:general    3122034 - Calculate Texture Coordinates
    7.66 [ALRT]:general    3122034 - Generate BTG File
   10.66 [ALRT]:general    3122034 - Generate Custom Objects
   10.82 [ALRT]:general    [Finished successfully]

Elapsed time: 10.8251 seconds

it looks alright:
Image
The only problem is that part of the airport is covered by terrain.
Can I possibly have done anything wrong when running genapts850 (which generates the AirportArea and AirportObj folders) ?

Also I would like to know why my terrain is so much different from the default terrain. This is the one generated above (with AirportObj SRTM-3 Default):
Image
And this is the default terrain:
Image
These two photos were taken from exactly the same position !
The terrain generated by me has much more mountains - you cannot find Mt. Brocken anymore. This is easy in the default terrain. Any fixes ? I am using hgtchop and terrafit from the docker ws2.0 branch and genapts and tg-construct from the docker latest branch.
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: tg-construct 2.1.0 won't construct my scenery

Postby TheEagle » Tue Jul 27, 2021 11:20 pm

wkitty42 wrote in Fri Jul 23, 2021 9:47 pm:let it run... you'll soon figure out why a full world scenery build took months and months to run to completion

Oh yeah … you told a me the painful truth … :cry: :shock:

I've got it working !!!! :lol:
The solution was to use gdalchop instead of hgtchop ! Looks really great now:

Image

(not quite if you go for the textures, but that doesn't matter - I am going to use orthophotos, anyways). Additionally, it will look better once I add back all the landclasses I removed for testing. But there is just one problem left - my airport is partly covered by terrain :shock: :roll:

Image

These are the command lines with which above shown scenery was generated (in this order):
Code: Select all
~$ gdalchop work/SRTM-3/ data/SRTM-3/N51E010.hgt
~$ terrafit -e 5 -x 20000 -f -j 4 work/SRTM-3/
~$ genapts850 --input=data/airports/MBLS.dat --work=work --dem-path=work/SRTM-3/ --max-slope=50 --threads=4 --verbose
~$ tg-construct --threads=9999 --priorities=tg-prio.txt --work-dir=./work --output-dir=../fgscenery/MtBrocken-landing-strip/Terrain --tile-id=3122034 AirportObj SRTM-3 Default EvergreenForest

Anything wrong ? The order maybe ?
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: tg-construct 2.1.0 won't construct my scenery

Postby Fahim Dalvi » Wed Jul 28, 2021 6:40 am

I think you are missing an "AirportArea" in your tg-construct command; its likely the reason why part of your airport is underground!
User avatar
Fahim Dalvi
 
Posts: 1352
Joined: Sun Oct 14, 2007 2:08 pm
Location: Qatar
Callsign: Fahim
Version: 2020.3.11
OS: macOS

Re: tg-construct 2.1.0 won't construct my scenery

Postby TheEagle » Wed Jul 28, 2021 9:37 am

@Fahim: you are completely right … :cry: but when I add that, I get these elevation errors back :( Just trying to compile terragear from source again … (the ws2.0 branch)
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: tg-construct 2.1.0 won't construct my scenery  

Postby TheEagle » Thu Jul 29, 2021 12:24 pm

@Fahim ITS WORKING !!! :D :D :D Looks like it's not a good idea to use latest and ws2.0 terragear binaries mixed - I now used just the ws2.0 binaries, et voilà, it works perfectly !
Image
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: tg-construct 2.1.0 won't construct my scenery

Postby Fahim Dalvi » Thu Jul 29, 2021 12:51 pm

Thats great news! I'm glad it worked out in the end.
User avatar
Fahim Dalvi
 
Posts: 1352
Joined: Sun Oct 14, 2007 2:08 pm
Location: Qatar
Callsign: Fahim
Version: 2020.3.11
OS: macOS

Re: tg-construct 2.1.0 won't construct my scenery

Postby TheEagle » Thu Jul 29, 2021 12:55 pm

wkitty42 wrote in Mon Jul 26, 2021 12:22 am:why there are height differences is another question... apparently the height data is not the same as originally used...

I have also found an answer to that - it's because I didn't change the max error and max nodes arguments for terrafit, and it used the defaults. Now when I specified -e 5 -x 20000, the elevation differences are minimal ! :D
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: tg-construct 2.1.0 won't construct my scenery

Postby TheEagle » Thu Jul 29, 2021 12:56 pm

Fahim Dalvi wrote in Thu Jul 29, 2021 12:51 pm:Thats great news! I'm glad it worked out in the end.

Yeah, I think I'm going to write a wiki article "TerraGear FAQ" :idea: , where I'll write down the experiences I made with TerraGear in the last days. what do you think :?:
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: tg-construct 2.1.0 won't construct my scenery

Postby TheEagle » Thu Jul 29, 2021 1:23 pm

Sorry, but I need help again. I downloaded the shapefiles from download.geofabrik.de (it's OSM data). Suppose I am currently working on the roads (osm_roads_free_1.shp). How would I extract for example all tertiary highways ? I tried the command from https://wiki.flightgear.org/TerraGear_C ... _Landcover in a modified version:
Code: Select all
~$ ogr2ogr -where "type in ('tertiary')" BrockenSceneryWorkspace/data/shapefiles/highways_tertiary.shp BrockenSceneryWorkspace/data/shapefiles/osm_roads/osm_roads.shp
ERROR 1: "type" not recognised as an available field.
ERROR 1: SetAttributeFilter(type in ('tertiary')) on layer 'osm_roads' failed.

I understand that the fields in the OSM shapefiles are different from the CORINE ones. But how do I filter out tertiary highways, then ?

Thanks to this document, I found out that in the OSM shapefiles the right "field" is not type, but fclass. This one works:
Code: Select all
~$ ogr2ogr -where "fclass = 'tertiary'" BrockenSceneryWorkspace/data/shapefiles/highways_tertiary.shp BrockenSceneryWorkspace/data/shapefiles/osm_roads/osm_roads.shp

But, does someone know the command that lists all available fields of a shapefile and their types ?
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

Re: tg-construct 2.1.0 won't construct my scenery

Postby Fahim Dalvi » Sun Aug 01, 2021 6:27 am

Hello Eagle,

I'm not sure about the airport landclass uses you mentioned in the other thread, but its easy to see all the fields using ogrinfo. I wrote a little helper script a while ago that takes an OSM shapefile and splits it into all its individual fclass shapefiles:

Code: Select all
#!/bin/bash

# Check arguments
if [ $# -lt 2 ]; then
    echo "Usage: bash extract_features_shapefile.sh <path-to-shapefile> <path-to-output-dir>"
    exit
fi
src_shp=$1
dest_dir=$2

# Extract available feature list in supplied shapefile
echo "Extracting available features..."
feature_list=$(ogrinfo -al $src_shp | grep 'fclass (String)' | tr -s ' ' | cut -d' ' -f5 | sort | uniq)

echo "Found following features:"
for feat in ${feature_list}; do
    echo $feat
done

# Create shapefile per feature from supplied shapefile
echo "Creating new shapefiles..."
mkdir -p $dest_dir
for feat in ${feature_list}; do
    echo "Processing $feat..."
    mkdir -p $dest_dir/osm_$feat
    ogr2ogr -where "FCLASS LIKE '"$feat"'" $dest_dir/osm_$feat/osm_$feat.shp $src_shp
done


The section under "# Extract available feature list in supplied shapefile" will give you a list of features if thats all you are looking for.

TheEagle wrote in Thu Jul 29, 2021 12:56 pm:Yeah, I think I'm going to write a wiki article "TerraGear FAQ" :idea: , where I'll write down the experiences I made with TerraGear in the last days. what do you think :?:


I think thats a good idea, that was my exact reasoning for writing the terragear docker article on the wiki!

Best Regards,
Fahim
User avatar
Fahim Dalvi
 
Posts: 1352
Joined: Sun Oct 14, 2007 2:08 pm
Location: Qatar
Callsign: Fahim
Version: 2020.3.11
OS: macOS

Re: tg-construct 2.1.0 won't construct my scenery

Postby TheEagle » Sun Aug 01, 2021 11:46 am

Thanks again Fahim - but is it also possible to see all fields ? The above only gives me all values of the fclass field ?
Cessna 210 (Wiki)
My other aircraft: my wiki profile !
Other: FGTools (GitHub)
World tour: View on SkyVector
Please consider donating $1 / €1 to help me finance a new camera !
User avatar
TheEagle
 
Posts: 3411
Joined: Sat May 01, 2021 3:27 pm
Location: France
Pronouns: You, he
Callsign: F-EAGLE
IRC name: none
Version: Git next
OS: Ubuntu Studio 22.04

PreviousNext

Return to Scenery

Who is online

Users browsing this forum: No registered users and 7 guests