Welcome to my little Flightgear corner!

Flightgear is a highly accurate and very realistic open source flight simulator, available for Windows, Linux and MacOS. Flight simulation is one of my hobbies and in this section you find some of my Flightgear stuff.

I like my Atlas map to reflect the actual scenery, I am using and not the default scenery from Terrasync. Especially when using high quality addon scenery, it does make a pretty big difference.
That is why I wrote myself this little script. It selectively deletes the map tiles which are covered by a specific custom scenery and then has Map rerender them. Just in case, anything goes wrong, it automatically calls Map again and lets it render potentially missing tiles from the Terrasync dir. The script expects the custom scenery to have the Terrain dir directly under the respective scenery subdir, e.g. CustomScenery/StattosMiami/Terrain. I made it as configureable as possible. The only parameter is the custom scenery subdir for which the maps should be rerendered.

    #!/bin/bash
    STARTDIR=$(pwd)
    MAP="/usr/bin/Map"
    FGROOT="/usr/share/flightgear"
    CUSTOMSCENERY="/home/sgofferj/flightgear/CustomScenery"
    TERRASYNC="/home/sgofferj/flightgear/TerraSync"
    SCENERYDIR=$1
    MAPDIR="/usr/share/flightgear/Atlas"
    echo --------------------------------------------------------------------------------------------
    cd $SCENERYDIR/Terrain
    for TILEDIR in * ; do
      if [ -d ${TILEDIR} ]; then
        cd ${TILEDIR}
        pwd
        echo $TILEDIR
        for TILE in [ew]* ; do
          if [ -d ${TILE} ]; then
       echo $TILE
       rm ${MAPDIR}/10/$TILE.jpg
       rm ${MAPDIR}/8/$TILE.jpg
       rm ${MAPDIR}/6/$TILE.jpg
       rm ${MAPDIR}/4/$TILE.jpg
          fi
        done
        cd ..
      fi
    done
    cd ${STARTDIR}
    echo --------------------------------------------------------------------------------------------
    ${MAP} --verbose --fg-scenery=${CUSTOMSCENERY}/${SCENERYDIR}
    echo --------------------------------------------------------------------------------------------
    ${MAP}  --verbose --fg-scenery=${TERRASYNC}
    echo --------------------------------------------------------------------------------------------