Page 1 of 2

[HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 5:01 am
by IAHM-COL
[HOWTO] Update an airport Layout for terraGIT

Hi All. (and @SM)

I promised a How-To explaining how to update an airport layout for terraGIT.

This howto assumes

  1. you know how to obtain (gateway) and modify (WED) the airport layout
  2. you know how to compile the terrain for Flightgear using terragear.

(if not, those 2 points above are howtos in their own right)

Part I: Beforehand, build enough terrain

Tipically, assuming you are updating only 1 airport, you will be building no more than 1x1 degree tiles. Which is very fast terragear processing. Maybe, you need to have preprocessed v0 landclasses, that are offered for the whole world, and this is a pre-processing slower step! (Worldwide v0 landclasses)

I recommend you actually build a 3x3 degree tile, which center is the tile of interest.

Example: let's update Quantico (KNYG)

wikipedia wrote:Marine Corps Air Facility Quantico (MCAF Quantico) (IATA: NYG, ICAO: KNYG, FAA LID: NYG) is a United States Marine Corps airfield located within Marine Corps Base Quantico, Virginia. It was commissioned in 1919 and is currently home to HMX-1, the squadron that flies the President of the United States.


The gateway: https://gateway.x-plane.com/scenery/page/KNYG
Tells us the location (or tile) is 38(N) -77(W) [+ is N or E, - is S or W respectively]

This means the KNYG layout (btg file) should be in the 10x10 degree tile corresponding to w080n30/w078n38.

(think why w080 and w078 respectively!)

In any case. Fair enough, it that tile repository
https://github.com/FGMEMBERS-TERRAGIT/w080n30
in the branch Terrain
https://github.com/FGMEMBERS-TERRAGIT/w080n30/tree/Terrain
in the directory w078n38
https://github.com/FGMEMBERS-TERRAGIT/w080n30/tree/Terrain/w078n38
we find the KNYG current layout to be updated
https://github.com/FGMEMBERS-TERRAGIT/w080n30/blob/Terrain/w078n38/KNYG.btg.gz

But we also learnt that there are several more aiports in that 1x1 degree subdirectory
Again: here:https://github.com/FGMEMBERS-TERRAGIT/w080n30/tree/Terrain/w078n38

Basically, the first recommendation is build a 3x3 degree tile (making sure airports stepping the tile boundary are not chopped off if rebuilt, and guaranteing a good tile seam merging)
in this case, the terragear runs with a --min-lat=37 and a --max-lat=39 (38, the target, centered!) and a --min-lon=-78 --max=lon=-76, centered around -77.

Part II: Did you ran genapts for enough airports?

If you are just replacing an airport, in principle, you should be golden with running genapts850 only in the airport of interest.
Not really. Almost, but not quite. You will need to rebuild any airport in the same scenery quad.

What?
Simple. Let's look at the KNYG directory again. There are terrain objects like 1679400.btg.gz, and airport objects like KDCA.btg.gz. There is also stg files that indicate flightgear what models or airports to place in the given quad. Like 1679400.stg. Clearly this quad does not contain KNYG!. So the question is which one?

You need to figure out. I use grep (a linux application to search all stg in the directory like this)

Code: Select all

grep KNYG *stg


which returns

Code: Select all

1679394.stg:OBJECT KNYG.btg


Telling me what stg file to read.

https://github.com/FGMEMBERS-TERRAGIT/w080n30/blob/Terrain/w078n38/1679394.stg

By reading it, I learn that in the same quad I'll find another airport MD39, which I'll need to get from the gateway
https://gateway.x-plane.com/scenery/page/MD39
And run genapts850 as well (in addition to) KNYG

Re: [HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 5:16 am
by IAHM-COL
Part III. Fork the correct Tile-Repository

At this point, after you ran terragear for 3x3 degree tiles, with genapts850 in 2 airports (both in the quad-tile, including the target KNYG), you are going to want to fork the Tile-repository
In this case: w080n30

Image

And clone your fork, using a git software.

Code: Select all

git clone git@github.com:YOURID/w080n30.git


Cloning your fork guarantees you will have push access. If you are a FGMEMBERS-TERRAGIT member, you may have push access to the repo without needing to fork, but use this with caution :D It is always the safest path to push to your fork first!

PART IV Always work terraGIT in branches!!

enter your cloned repository, and create a branch for the new layout

Code: Select all

git branch KNYG
git checkout KNYG


Part V. Replace the correct set of files

In the output of your terragear you will have several directories, within w080n30 (since you build the terrain boundaries described above, but the actual coordinates vary per location). One of these is w078n38, and inside this, you will have terrain files, plus 2 aiports (unlike the original terraGIT repo where you had several airports! :D)

  • Replace the airport layout target (logically) with the one built [that is KNYG.btg.gz]
  • Also replace the terrain quad where the airport is located: [that is 1679394.btg.gz]
  • Replace the airport layout of the other aiport in this quad [that is MD39.btg.gz] (maybe none or maybe several!!)
  • Finally also replace the stg. [that is 1679394.stg]
DON'T REPLACE the whole terrain generated. You are going to be deleting features from the terrain if done so. Think, per example the many other airports you did not generate in this tile, such as Ronald Reagan (KDCA) does not exist in your terragear output!

Re: [HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 5:34 am
by IAHM-COL
Part VI. Commit your changes in the branch

Code: Select all

git status


Image

Code: Select all

git add .
git commit -m "Replace Quantico layout"


Image

Push your branch to your fork

Code: Select all

git push git@github.com:YOUR-ID/w080n30.git KNYG


Create a Pull Request from your new Terrain branch to FGMEMBERS-TERRAGIT Terrain branch respectively

(if you are a FGMEMBERS-TERRAGIT you can push the new branch to the Tile on FGMEMBERS. For safety reasons, avoid pushing to master directly!)

Image


https://github.com/FGMEMBERS-TERRAGIT/w080n30/pull/1

Good Hint: Add notes, images, and sort to your pull request!.

(note: Make sure to pull into the correct branch. That is terrain branch!)

Re: [HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 5:35 am
by IAHM-COL
Be prepared for revisions and maybe to build more airports around :P

Particularly, if an aiport lies close to a tile quad margin (like quantico), then replacing a single tile quad is not enough.
Building more aiports may be due.

We may advise you so before fully merging your pull request :D

Thanks!!

IH-COL

Re: [HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 5:37 am
by IAHM-COL
Image


After the merge, terraGIT will be updated to fetch your new layout


terraGIT
Image

terraSYNC
Image

Re: [HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 7:47 pm
by legoboyvdlp
Miami Intl updated with the latest layout from the gateway. No gaps visible, pull request open!
I know that Miami is already very nice in TerraSync, but this is slightly better.

Re: [HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 7:51 pm
by IAHM-COL
Awesome. I am merging then :D

Maybe place a snapshot of the new version in the comment of the PR so we can see the cool stuff coming?

BTW, I 'll rebuild all new layouts for Venezuela soon, so make sure you've got them uploaded to the gate :D ...

Im glad you liked Curacao.
It is one of my favorite Scenerios, and it had been broken for a while. Now is fully operative and terraGIT automated and synced.
(several errors were fixed bfore I pushed)

Re: [HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 7:56 pm
by legoboyvdlp
Image

Hardly any change.

Re: [HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 8:13 pm
by legoboyvdlp
KMIA terminals were buried -- now fixed and pushed!

Re: [HOWTO] Update an airport Layout for terraGIT

Posted: Thu May 05, 2016 8:19 pm
by IAHM-COL
I so wonder if these models are anywhere to be found.
It would be awesome to push them up if they are GPLed.


https://forum.flightgear.org/viewtopic.php?f=5&t=15587