Board index FlightGear Development Scenery

apt.dat - local version(s)

Questions and discussion about enhancing and populating the FlightGear world.

Re: apt.dat - local version(s)

Postby rominet » Tue Oct 25, 2016 4:23 pm

The $ indicates the expansion of an environment variable, in this case FG_ROOT. This is Unix shell syntax, but used symbolically in FG documentation and on the forum. This is justified by the fact that FG's main data folder can be set using the FG_ROOT environment variable (but not when using the built-in launcher).

Concerning scenery paths and their precedence, you list them in Additional scenery locations in the Add-ons tab. If you put download_dir/TerraSync (which is $FG_HOME/TerraSync unless you changed the download location) in this list, this will determine the precedence of your TerraSync folder relatively to other scenery paths in this list, otherwise it will come after all scenery paths you have explicitely defined and before the last default, $FG_ROOT/Scenery:
Code: Select all
void QtLauncher::setSceneryPaths() // static method
{
    globals->clear_fg_scenery();

// mimic what optionss.cxx does, so we can find airport data for parking
// positions
    QSettings settings;
    // append explicit scenery paths
    Q_FOREACH(QString path, settings.value("scenery-paths").toStringList()) {
        globals->append_fg_scenery(path.toStdString());
    }

    // append the TerraSync path
    QString downloadDir = settings.value("download-dir").toString();
    if (downloadDir.isEmpty()) {
        downloadDir = QString::fromStdString(flightgear::defaultDownloadDir().utf8Str());
    }

    SGPath terraSyncDir(downloadDir.toStdString());
    terraSyncDir.append("TerraSync");
    if (terraSyncDir.exists()) {
        globals->append_fg_scenery(terraSyncDir);
    }

    // add the installation path since it contains default airport data,
    // if terrasync is disabled or on first-launch
    globals->append_fg_scenery(globals->get_fg_root() / "Scenery");

}

(this is the corresponding code in the built-in launcher, it is almost the same but not quite once "normal FG" has started, see https://sourceforge.net/p/flightgear/fl ... .cxx#l2320 [OptionResult Options::processOptions()] for those who can read C++).

As for how the "mix" between several scenery paths is done, this is explained here:
FlightGear searches these scenery paths sequentially. The first terrain found for each tile is loaded. Objects for a tile are loaded from all directories visited before (and including the one where) the terrain was found.

as well as in $FG_ROOT/Docs/README.scenery.
rominet
 
Posts: 605
Joined: Sat Nov 01, 2014 2:33 pm
Callsign: F-KATS
Version: Git next
OS: Debian GNU/Linux

Re: apt.dat - local version(s)

Postby f-ojac » Sat Oct 29, 2016 6:38 am

@rogue55 you can use TGWeb to build the runways and taxiways for you and so make sure the layout is OK. Check http://ns334561.ip-5-196-65.eu/tgweb/
f-ojac
 
Posts: 1304
Joined: Fri Mar 07, 2008 10:50 am
Version: GIT
OS: GNU/Linux

Re: apt.dat - local version(s)

Postby pommesschranke » Fri Dec 23, 2016 12:33 pm

I'm testing KDFW.dat from the gateway which has >100 parking locations, but FG(git) ignores them, only shows those few from the main apt.dat.gz. The log messages look good:

Code: Select all
NavCache: main cache rebuild required
NavCache at:Path "/SDB2/dot-fgfs/navdata_2017_1.cache"
will create tables
Opened apt.dat file: '/SDB2/scenery/fgo/NavData/apt/KDFW.dat'
apt.dat format version (/SDB2/scenery/fgo/NavData/apt/KDFW.dat): 1050
Opened apt.dat file: '/SDB2/fg-fgmeta/next/install/flightgear/fgdata/Airports/apt.dat.gz'
apt.dat format version (/SDB2/fg-fgmeta/next/install/flightgear/fgdata/Airports/apt.dat.gz): 1050
/SDB2/fg-fgmeta/next/install/flightgear/fgdata/Airports/apt.dat.gz:598708: skipping airport KDFW (already defined earlier)
/SDB2/fg-fgmeta/next/install/flightgear/fgdata/Airports/apt.dat.gz:2453063: invalid Comm Frequency line (row code 54): at least 3 fields are required
/SDB2/fg-fgmeta/next/install/flightgear/fgdata/Airports/apt.dat.gz:136124: invalid Comm Frequency line (row code 51): at least 3 fields are required
Loaded data for 34721 airports
apt.dat files load took:5750
fix.dat load took:2207


ooops, I forgot: FG is still not reading parking locations from apt.dat !
I have to convert it to KDFW.groundnet.xml


Image
Image
pommesschranke
 
Posts: 1117
Joined: Sat Apr 27, 2013 8:58 pm
Location: EDLM & LJCE
Callsign: d-laser
IRC name: laserman
Version: git
OS: Linux Kubuntu 22.04

Re: apt.dat - local version(s)

Postby rominet » Fri Dec 23, 2016 2:08 pm

pommesschranke wrote in Fri Dec 23, 2016 12:33 pm:ooops, I forgot: FG is still not reading parking locations from apt.dat !
I have to convert it to KDFW.groundnet.xml

Yes, I know. The main problem from my POV is that there isn't a clear 1:1 mapping from the parking metadata allowed by apt.dat files to that allowed in groundnet.xml files (for one, the flight type / type of location / airplane type fields are clearly different in both formats). Since groundnet.xml files are heavily used for FlightGear AI traffic, adding support for the X-Plane metadata requires the input of someone familiar with this AI code, which I am not. And as you should know, the last time this was raised on flightgear-devel, there hasn't been much of a reaction from this side...
rominet
 
Posts: 605
Joined: Sat Nov 01, 2014 2:33 pm
Callsign: F-KATS
Version: Git next
OS: Debian GNU/Linux

Re: apt.dat - local version(s)

Postby david.megginson » Sat Dec 17, 2022 6:48 pm

Reviving a very old thread -- has anyone developed a script to generate the Airports/ directory from the information in apt.dat format files when building custom scenery?
David MEGGINSON (he/him)
I need more tea.
Scenery: FlightGear Americas Scenery
Fediverse: @david_megginson@mstdn.ca
User avatar
david.megginson
 
Posts: 601
Joined: Sat Dec 10, 2016 8:25 pm
Location: CYRO (Ottawa, Canada)
Pronouns: he/him
Version: next
OS: Linux Ubuntu

Re: apt.dat - local version(s)

Postby TheEagle » Sun Dec 18, 2022 10:56 pm

Yes - there are for once the d-laser-fgtools apt2sqlite.py and sqlite2xml.py which AFAIK can only do the groundnets, and I have written my own (you can find it at https://github.com/TheFGFSEagle/fgtools ... ortsxml.py) which outputs all of tower, ILS, threshold and groundnet files (each file is only when the corresponding data is available in the apt.dat file), but it does not produce working pushback routes yet IIRC.
Last edited by TheEagle on Mon Dec 19, 2022 12:03 am, edited 1 time in total.
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: apt.dat - local version(s)

Postby merspieler » Sun Dec 18, 2022 11:58 pm

Nice tool...
I guess I "steal" that for my airport update container :D

(just fyi, you link gives me a 404 ;-) )
Nia (you&, she/her)

Please use gender neutral terms when referring to a group of people!

Be the change you wish to see in the world, be an ally to all!

Join the official matrix space
merspieler
 
Posts: 2241
Joined: Thu Oct 26, 2017 11:43 am
Location: Wish to be in YBCS
Pronouns: you&, she/her
Callsign: you&, she/her
IRC name: merspieler
Version: next
OS: NixOS

Re: apt.dat - local version(s)

Postby TheEagle » Mon Dec 19, 2022 12:03 am

Sorry, fixed the link ! :)
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

Previous

Return to Scenery

Who is online

Users browsing this forum: No registered users and 13 guests