Board index FlightGear Support Tools Atlas

Script to let Map update tiles for a custom scenery

Atlas is an addon that lets FlightGear users display a real-time "moving-map" of their flight.

Script to let Map update tiles for a custom scenery

Postby sgofferj » Mon Jan 16, 2012 5:36 am

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 my a specific custom scenery and then have Map rerender them. Just in case, anything goes wrong, it automatically calls Map again and let 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.

Code: Select all
#!/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 --------------------------------------------------------------------------------------------
FG 3.1 GIT / Opensuse 12.3 / Phenom II X4 / GForce GTX560
Stefan's little Flightgear corner | The Finnish Weather Center | Wolves in Finland

Working on: EFTP
COM: IAX2:home.gofferje.net/stefan (MO-FR 0700-2000 UTC, SA+SU 0900-2000 UTC)
sgofferj
 
Posts: 789
Joined: Mon Dec 05, 2011 5:13 pm
Location: EFTP
Callsign: OH-SW
Version: 3.1 GIT
OS: Opensuse

Return to Atlas

Who is online

Users browsing this forum: No registered users and 2 guests