[SOLVED] Helping Catalanoic with apt.dat question

Everything that has to do with the forum on a technical level. Logins, posts, formatting ...
User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

[SOLVED] Helping Catalanoic with apt.dat question

Postby IAHM-COL » Wed May 25, 2016 4:27 am

Catalanoic (PM) wrote:Hi! I noted that you've some experience in WED, I started a thread (official Fg forum), Aerodromes in Spain, but as you can read i've some problems to generate these BTG files. I tried to follow the instructions in the wiki and forum but no succeed because suchs links are old and incomplete. So, maybe you can generate these type of files but i think better to know how to it than you or another generate it for me (but thanks! :lol: ), i use windows and linux so no problem with that, which programs i need to install or how to do that process? You helped SHM to install it i think. Thank you very much, i will take a look at this forum and his projects but need to resolve this and other problems from the scenery region where i come, spain. :lol:

Catalanoic
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Helping Catalanoic with apt.dat question

Postby IAHM-COL » Wed May 25, 2016 4:34 am

Hi Catalanoic

Yes. I had seen your efforts on scenery creation on Spain. And that is great.

Also, I've seen you ask questions about WED, and apt.dat in the forum. And then you sent me the Private Message above, where you suggest you still don't have some of this information much clear.

First: the apt.dat format

The apt.dat format works as a "source" to the airports content as seen in FG.
It is actually a x-plane specification file, and its contents and format are thus specified by that community. Not us.
Historically, FG had decided to take advantage of all the apt.dat content that x.plane publishes for airports information, in the form of apt.dat.

The apt.dat 810 is the specification as it existed for Xplane ver 8.10. It was rather poligon based.
For Xplane version 8.50, that community released a new apt.dat specification with major revisions, and most importantly the ability to use bezier curves in most of the airport data content, and thus the name apt 850.
Currently the specification is actually apt1050, but this is nothing more than an extension of apt850

both FG and Xplane, then use the same "source" for airport data. As most sources, it is a plain text - human readable, human editable.
An example file for an apt1050 (aka apt850), is here: RJBB

Converting all the world from 810 to 850 specification is a massive undertake that has not been fully completed yet.
In FG, when you taxi an airport 810 you would immediately recognize its lower quality, squary aprons looking, compared to the more smooth, well rounded 850 airports.

Help to complete the 850 apt database is highly welcomed by both the xplane and the FG community.
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Helping Catalanoic with apt.dat question

Postby IAHM-COL » Wed May 25, 2016 4:42 am

Second: What airports are completed so far?

This is not so easy question. But again, taxiing in FG will give you a bare idea if the airport exist 850 or not yet.

Most importantly, you can consider following the cleverest map.
  • The airports in Red: Newly made by contributors,
  • The airports in Orange: Recently made by contributors, and available in the most updated x.plane --but not available in most updated FG (some exceptions are custom built for FG in custom sceneries or terraGIT, but not available for FG in terrasync, nor on any official ws2.0 scenery)
  • The aiports in Blue: Still hoping for a contributor to improve (mostly)

http://x-plane.cleverest.eu/

You can follow that map to obtain the most updated apt.dat source, or you can browse the actual xplane database (also known as the gateway)

https://gateway.x-plane.com/airports/page

Now, if you look in the cleverest map, zooming on Spain, you'll notice that most of the country is really well updated now in the gateway, and the only thing missing is for a ws3.0 version of Scenery to be available for FG (or for someone to construct and publish custom scenery for Iberia)

Image

finally, off course, that some updated 850 exists, does not imply that you cannot improve it and submit those improvements to the gateway. So if you wish so, go ahead. But more importantly, to prevent submission issues, always start by modifying the most updated version. (don't begin on outdated sources!)
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Helping Catalanoic with apt.dat question

Postby IAHM-COL » Wed May 25, 2016 4:50 am

Third: Obtaining and editing or creating new apt.dat 850

Although the format is human-readable, you should always obtain and modify it via the Xplane World Editor program , WED.
You need the latest version here:
http://developer.x-plane.com/tools/worldeditor/
Currently 1.4.1r1

Any other version won't interact well with the gateway.

This program will allow you to fetch latest source as available from the gateway, edit it, and finally resubmit changes.
Any change made to a layout is highly recommended to push it back to the gateway, to benefit all communities involved.

Content will be GPL.

Important information about running WED if you dont have Xplane:
http://wiki.flightgear.org/WorldEditor# ... first_time

The Xplane tutorial for WED artists is a great, comprehensive document from newbie to pro, and it will have everything from get you started, to be a later reference:

http://developer.x-plane.com/manuals/wed/
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Helping Catalanoic with apt.dat question

Postby IAHM-COL » Wed May 25, 2016 5:00 am

Fourth: The airport BTG

Flightgear uses the BTG format for both airport and terrain layout specifications. These are binaries files; not sources.
Flightgear actually keeps gunzipped (compressed) versions of these in the Scenery "terrain" folders.

Per example, the .btg.gz file for an updated RJBB is here: https://github.com/FGMEMBERS-SCENERY/RJ ... JBB.btg.gz

Binary files are
1. Not human readable, nor understandable, nor editable
2. Not intended to be modified directly
3. Read by the machine (interpreted) and used in running time (that means FG uses them to display terrain or aiport layouts)

In one of your questions on Curtis' forum you wanted to know how to obtain an apt.dat from a btg.
The answer, AFAIK, is,
That is not possible.

You can't obtain a source file using the compiled binary. You need to get the source file from the author, before compilation occurred, and on GPL content the source is either openly available (ie the gateway) or can be asked for (the GPL provides the requirement to provide source if asked for).

Propietary source keeps source secret/private. And this disallows users to modify/customize/improve.
GPL software is among the "open-source" family of softwares, and this is the exact reason of why/and how.

So, basically forget about converting a BTG -> apt.dat. It is just not possible.
Just ask for the apt.dat (the source) to whomever distributes the btg, and they must be able to provide you with the source.
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Helping Catalanoic with apt.dat question

Postby IAHM-COL » Wed May 25, 2016 5:07 am

Fifth: Airport Compilation

Compilation is the proccess that takes a source file and outputs the corresponding binary.
In the case of airport layouts, it means converting the apt.dat into the corresponding btg.gz file


In summary

apt.dat -> btg.gz (compilation. doable)
btg.gz -> apt.dat (not doable)

The software used to compile binaries from sources are called compilers (duh!), and the most famous one is the GNU GCC compiler (compiles C and C++ files).

FG uses an scenery compiler suite (many programs) of its own to create scenery. It's the infamous terragear.

among terragear suite, a program "genapts850" is the compiler for apt.dat 850 specification into the btg.gz file.

To create airport .btg.gz files you need a working terragear operating in your computer.
Terragear is mostly a command line suite, but Gijs (the moderator of Curtis' forum) created a gui interface (terragear_gui) which I have never used.
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Helping Catalanoic with apt.dat question

Postby IAHM-COL » Wed May 25, 2016 5:32 am

Sixth: Getting Terragear

This is where FG is not very well set to help a large number of users to have an operative terragear and allow them to be hands on in the creation of scenery.
You need to pass this bump to compile scenery by your own.

Terragear is officially available as source file in sourceforge [SF = :cry:]
https://sourceforge.net/p/flightgear/te ... ster/tree/

A few binaries may exist for windows or via the PPA for ubuntu. I don't know for sure how these toolchains are
(terragear toolchain is very sensitive)

You can attempt at compiling yourself using cmake:
http://wiki.flightgear.org/TerraGear#Compilation

You will need to satisfy dependencies first. Much importantly, make sure you have the proper versioning (for certain dependencies, terragear needs exact version, and cannot handle newer version. Usually linking to a non-standard library path gives me best result to specify exact library versions, without using a system-wide / more updated kind


1. Any dependency required to built simgear.
(even if you are not building simgear, you need to fulfill dependencies)
This list is a good start:
http://wiki.flightgear.org/Ubuntu_12.04_Package_List_and_Build_Hints
But you will also need:
plib, boost, openal, and openscenegraph

2. simgear. last version is OK (2016.3.0). If you have FG, then simgear is already installed. But, again, I recommend building it again. (I compile all FG suites myself, so I have this done). In addition you can have a terragear computer without flightgear, but you will need simgear to get terragear somewhere.

3. GDAL. Needs exact version 2.0
http://download.osgeo.org/gdal/2.0.0/gdal-2.0.0.tar.gz
Therefore, you must build from source.

4. CGAL, version 4.8 (most recent, works)

5. Then: All's well end's well. you should be having a good toolchain to cmake terragear.
You MUST build the branch scenery/ws2.0. The master branch will be of not good use until the next version of scenery is released!!

6. after building, depending on where you installed, you may need to set proper LD_LIBRARY_PATH, and PATH to your linux installation, so it can get the libraries properly linked.

***

Builiding terragear is doable on Linux. Not easy.
That's how I helped SHM, by SSHing on a laptop he set up for this job, directly doing the :job: myself.

But it can be done. I ascertain.
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Helping Catalanoic with apt.dat question

Postby IAHM-COL » Wed May 25, 2016 5:45 am

Seventh and Last: Using terragear

This is actually well documented in the wiki

http://wiki.flightgear.org/Using_TerraGear

and

Important information for Europe ONLY: Use Corine landclasses
http://wiki.flightgear.org/TerraGear_CORINE

Important - needed sources

Landclasses: v0 = https://github.com/FGMEMBERS-TERRAGIT?utf8=%E2%9C%93&query=v0
Corine = http://www.eea.europa.eu/data-and-maps/data/clc-2006-vector-data-version-3
OSM = http://download.geofabrik.de/
Custom Landclasses = https://github.com/FGMEMBERS-TERRAGIT?page=1&query=cs, various sources and some are no-where to be found.

Elevation = get from Panoramio: http://viewfinderpanoramas.org/Coverage%20map%20viewfinderpanoramas_org3.htm(SRTM3), or
http://www.viewfinderpanoramas.org/Coverage%20map%20viewfinderpanoramas_org1.htm (SRTM1 where available)

USGS has SRTM1 for USA, but the elevation is not compatible with that in terrasync, which used SRTM3 from panoramio.

airport data = Xplane Gateway : https://gateway.x-plane.com/

***
Important order

Terragear has a way

1. You can build landclasses at any time before creating terrain. You can store landclasses safely, and use them as needed.
2. SRTM (elevation) must be decoded (hgtchop) before you use genapts850, or your airport will compile at sea level!
you do need to run terrafit after hgtchop with the exact parameters

Code: Select all

-e 5 -x 20000

So the terrain tiles has most compatibility with terrasync scenery.
3. Build airports using genapt850. You must construct every aiport within the area you will generate, or you are deleting airports from your custom scenery! This must be run after decoding SRTM, and must be reran everytime you change the apt.dat. You can re-run it as many times as needed, to test for changes, as long as you don't alter the SRTM (in your work directory) you are good.
4. the scenery compilation is last step. You need to rerun this everytime you rerun genapts 850

Therefore my method is

1. landclass
2. SRTM
3. genapts
4. scenery
repeat 3 and 4 only until happy with result.

_____________
Good Luck

IH-COL
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?

User avatar
Catalanoic
Posts: 251
Joined: Sat Dec 12, 2015 11:33 am

Re: Helping Catalanoic with apt.dat question

Postby Catalanoic » Wed May 25, 2016 5:32 pm

Precious and awaited documentation in just some posts!! Thankyou very much. I'll follow it and try to reproduce the Terragear installation in Linux (for me Lubuntu) this weekend and i'll post questions if i've problems.
Maybe it can be directly copied to our wiki.
You made a great work writing, I thank you for it!!

User avatar
IAHM-COL
Posts: 6455
Joined: Sat Sep 12, 2015 3:43 pm
Location: Homey, NV (KXTA) - U.S.A
Contact:

Re: Helping Catalanoic with apt.dat question

Postby IAHM-COL » Wed May 25, 2016 5:36 pm

I personally won't. They delete stuff I add to the Wiki.
You can do it yourself, and credit me, and hope for the best, thou.
https://raw.githubusercontent.com/IAHM-COL/gpg-pubkey/master/pubkey.asc

R.M.S.
If we gave everybody in the World free software today, but we failed to teach them about the four freedoms, five years from now, would they still have it?


Return to “Technical Questions”

Who is online

Users browsing this forum: No registered users and 9 guests