fgphotoscenery
This site provides photographic scenery of selected places in the United States for the open source flight simulator www.flightgear.org. The scenery images have been created from the public domain imagery courtesy of the U.S. Geological Survey www.usgs.org, have a resolution of about 3m/pixel (10ft/pixel) and are released under the GNU General Public Licence (GPL).

fgphotoscenery coverage:
installation
In order to be able to load photographic scenery into www.flightgear.org, the program has to be compiled from the source code and patched.
step 1: installing flightgear from the git repository
First, flightgear and simgear have to be compiled from source. This is a rather long process including a 10GB download. Instructions can be found on the flightgear wiki. For Ubuntu users, two scripts are available, one from the twiki and one by Geoff McLane. If you are using Ubuntu 11.10, use this version. Run:
mkdir fgfs
cd fgfs 
dpkg --get-selections > list_of_packages_before_makefg.txt
wget -O makefg http://geoffair.org/tmp/makefg
chmod +x makefg
makefg NOFGRUN
The dpkg command saves the list of currently installed packages into a file. This allows to remove the packages installed by makefg once they are not needed any more.
step 2: patching flightgear
Once flightgear is running, some files have to be patched and the compillation has to be executed once again. The patches can be obtained from Benoît Laniel. In addition to these patches, in line 540 of fgdata/Effects/terrain-default.eff has to be changed from "<technique n="11">" to "<technique n="0">". This is butchering the code, but no better solution is known so far. A patch that contains the combined changes to simgear and fgdata for the current git version is here. Place this patch into the flightgear home directory (the directory that contains run_fgfs.sh), apply it and then recompile flightgear:
wget http://fgphotoscenery.square7.ch/flightgear_photo_combined_2.8.patch
patch -p1 -i flightgear_photo_combined_2.8.patch
makefg NOFGRUN NOPAUSE
step 3: installing the fgphotoscenery
Once this is done and the patched flightgear runs, for testing a flightgear scenery section as well as a fgphotoscenery tiles must be be installed. Go to the scenery directory,
cd fgdata/Scenery
download the w130n30 section and the fgphotoscenery_installation.zip tiles into this directory and then unpack the files.
wget http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/Scenery-v2.8.0/w130n30.tgz
tar -xzvf w130n30.tgz
wget http://fgphtoscenery.squre7.ch/fgphotoscenery_installation.zip
unzip fgphotoscenery_installation.zip
Now start flightgear to see if it has worked:
cd ../../
./run_fgfs.sh --altitude=1200 --aircraft=ufo --lat=37.8209 --lon=-122.4676 --heading=-64 --timeofday=noon
You might need to switch off additional shading when flying over the texture: View -> Rendering Options -> Shader Options: try to move some sliders to the left.

If everything worked and you see something like this



then you are done. Congratulations!

You can now remove the compressed files
rm fgdata/Scenery/w120n30.tgz fgdata/Scenery/fgphotoscenery_installation.zip
and download other flightgear scenery sections and (full) fgphotoscenery packages from the download section and install them in the same way.
troubleshooting
If you do not see the photo scenery even after modifying the shader settings, run the following command
./run_fgfs.sh --altitude=1200 --aircraft=ufo --lat=37.8209 --lon=-122.4676 --heading=-64 --timeofday=noon --log-level=info |& egrep 'node|overlay'
If you do not see lines like
"Adding node .../fgdata/Scenery/Terrain/w130n30/w123n37/942065"
then the code has not been compiled into the libraries and/or exeutable. Delete all libraries and executables and compile again
rm install/flightgear/bin/*
find . -name "*.a" -exec rm {} \;
find . -name "*.o" -exec rm {} \;
find . -name "*.so" -exec rm {} \;
makefg FGRNNO NOPAUSE
Note that this often happens when using the download_and_compile.sh script or when comiling with cmake directoy from git. If you see the Adding node lines but do not see lines like:
"Adding Adding overlay image 942065.dds"
then the .dds files have not been placed into the same directory as their .btg.gz counterparts.
gallery
This section shows videos of UFO flights through parts of the photographic scenery. Below each video flightgear command-line parameters for the start-points of the flights are given. For some videos weather or viewing positions have in addition been modified. All soundtracks are music by DanoSongs.com.
fgphotoscenery_package_01
san francisco: video [ogg], video [mp4], soundtrack [mp3]
--lat=37.303 --lon=-122.387 --altitude=4600 --heading=10 --timeofday=noon --aircraft=ufo


yosemite: video [ogg], video [mp4], soundtrack [mp3]
--lat=37.72 --lon=-119.726 --altitude=8600 --heading=90 --timeofday=noon --aircraft=ufo


mono lake: video [ogg], video [mp4], soundtrack [mp3]
--lat=38.0132 --lon=-119.051 --altitude=14000 --heading=270 --timeofday=noon --aircraft=ufo


fgphotoscenery_package_02
grand canyon: video [ogg], video [mp4], soundtrack [mp3]
--lat=36.048 --lon=-111.907 --altitude=8000 --heading=40 --timeofday=noon --aircraft=ufo


sedona: video [ogg], video [mp4], soundtrack [mp3]
--lat=34.86 --lon=-111.778 --altitude=5600 --heading=-130 --timeofday=noon --aircraft=ufo


fgphotoscenery_package_03
florida: video [ogg], video [mp4], soundtrack [mp3]
--lat=25.409 --lon=-81.137 --altitude=5000 --heading=150 --timeofday=noon --aircraft=ufo


fgphotoscenery_package_04
glacier: video [ogg], video [mp4], soundtrack [mp3]


yellowstone: video [ogg], video [mp4], soundtrack [mp3]
--lat=44.5352 --lon=-110.8383 --altitude=10000 --heading=160 --timeofday=noon --aircraft=ufo


fgphotoscenery_package_05
washington dc: video [ogg], video [mp4], soundtrack [mp3]
--lat=38.312500 --lon=-76.875000 --altitude=1000 --heading=270 --timeofday=noon --aircraft=ufo 


download
All tiles are released under the GNU Public Licence:
These images are free images: you can redistribute them and/or modify
them under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

These images are distributed in the hope that they will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
         
You should have received a copy of the GNU General Public License
along with these images.  If not, see http://www.gnu.org/licenses/.
         
         
         
In order to avoid wasting bandwidth, please ONLY download any of these packages if you have completed the installation successfully.
Interrupted downloads can be resumed, for example by using
wget -c http://<url-to-the-file-to-download>"


download package description airports fg scenery sections videos coverage
fgphotoscenery_package_01.zip [532 MB] San Francisco, Yosemite NP 6CL4, O24, KRHV, KSJC, KLVK, KHWD, KOAK, 59CA, KCCR, KNUQ, KPAO, KSFO, KSQL w120n30, w130n30 video
View Larger Map
fgphotoscenery_package_02.zip [611 MB] Grand Canyon NP, Lake Powell, Sedona 6CL4, O24, KRHV, KSJC, KLVK, KHWD, KOAK, 59CA, KCCR, KNUQ, KPAO, KSFO, KSQL w120n30 video
View Larger Map
fgphotoscenery_package_03.zip [271 MB] Miami, Everglades NP, Key Largo KFLL, KHWO, KFXE, KPMP, 5X6, 7FD0, 07FA, 6X5, FL31, 6X6, KOPF, KHST, KTMB, 6X7, 86X, 79FD, 78FD, 22FD, KMIA, 72X, X51 w090n20 video
View Larger Map
fgphotoscenery_package_04.zip [825 MB] Glacier NP, Yellowstone NP, Grand Teton NP KWYS, KDIJ, KJAC, 49S, MT60, 58S, KGPI, MT17 w120n40 video
View Larger Map
fgphotoscenery_package_05.zip [489 MB] Washington  DC 3MD0, 4MD8, MD47, MD46, MD02, W50, KGAI, KDCA, 2W5, MD83, MD65, KDAA, VA16, KIAD, MD39, KNYG, VA42, KEZF, 3W1, 5MD8, MD55, MD97, MD54, 5VA5, 1VA9, KRMN, KNDY, W29, 0W6, 3W3, MD87, MD22, 6MD5, 1MD1, MD82, MD50, 4MD0, KNHK, 4MD4, 2W6, KESN, KCGS, W00, KANP, 3MD4, MD84, MD06, 0MD2, MD49, MD81, KADW, 6MD0, KVKX, W32, MD14, MD90, MD64, KCGE, MD18, 3MD8, MD04, W18, KFME, W48, KMTN, KBWI, MD21, MD62, MD63, MD69, 0MD4, MD66, MD11, MD24, MD43, MD92, MD19, MD23, MD91, MD59 w080n30 video
View Larger Map
issues
  • At some places (for example around Key Largo), the scenery is not available which results in white rectangular regions.
  • Some overlays like roads and lakes are still visible as brighter areas on the scenery textures.
  • At some places (for example parts of the Grand Canyon), the terrain does not coincide perfectly well with the images.
  • At some places (for example the Golden Gate Bridge), the 3d models do not coincide perfectly well with the images.
  • At some places (for example north of Page), the scenery products come from two different USGS campaigns. The colors of adjaccent tiles are sometimes different.
howto
How to create photoscenery for Benoît's flightgear patch:
  1. Follow the installation instructions and compile flightgear from source with the patch to allow photoscenery to be shown.

  2. Obtain orthoimagery of the location you are interested in. This is hard to find, as the terms of service of the obvious places (google maps, yahoo maps, bing maps) do not allow the use of their imaging data outside of their applications and even less their distribution. A collection of free orthoimagery can be found here.

  3. If necessary, transform the orthoimagery into the WGS84 mercator projection. This can be done with Qgis or the gdal tools if the images are georeferenced.

  4. Get the lat/lon corner coordinates of the flightgear tiles. The tiles are the Scenery/Terrain/*/*/[0-9][0-9][0-9][0-9][0-9]*.btg.gz files. Below are two python functions to convert the tile index to lat/lon coordinates and back:
    def tileWidth(lat):
       tiletable=[[0,0.125],[22,0.25],[62,0.5],[76,1],[83,2],[86,4],[88,8],[89,360],[90,360]]  
       for i in range(len(tiletable)): 
          if abs(lat)>=tiletable[i][0] and abs(lat)<tiletable[i+1][0]:
             return float (tiletable[i][1])  
                
    def coordinatesFromTileIndex(tileindex):
       base_x    = (tileindex>>14) - 180
       base_y    = ((tileindex-((base_x+180)<<14)) >>6) - 90
       y         =  (tileindex-(((base_x+180)<<14)+ ((base_y+90) << 6))) >> 3
       x         =  tileindex-(((((base_x+180)<<14)+ ((base_y+90) << 6))) + (y << 3))
       tilewidth = tileWidth(base_y)
       return [(base_y + 0.125 * y), base_y + 0.125 * (y+1), base_x + x * tilewidth, base_x + (x+1) * tilewidth, 0.5 * (base_y+0.125*y + base_y + 0.125*(y+1)), 0.5 * (base_x + x * tilewidth + base_x + (x+1) * tilewidth)]
          
    def tileIndexFromCoordinate(lat, lon):   
       import math
       base_y    = math.floor(lat)
       y         = int((lat-base_y)*8)
       tilewidth = tileWidth(lat)
       base_x    = math.floor(math.floor(lon/tilewidth)*tilewidth)
       if base_x<-180:
          base_x=-180
       x         = int(math.floor((lon-base_x)/tilewidth))
       tileindex = int(((int(math.floor(lon))+180)<<14) + ((int(math.floor(lat))+ 90) << 6) + (y << 3) + x)
       return tileindex
    

  5. Crop the WGS84 mercator orthoimages to the lat/lon coordinates of the tile. This can again be done with Qgis or the gdal tools if the images are georeferenced.

  6. Enhance the colors of the images and resize them to a number of pixels which is a power of two. For example I use
    convert -level "25%,85%,1.0" -modulate "100,115" -resize 4096x4096! crop.tif output.tif
    

  7. Convert the file to .dds format. Two libraries that can do this are DevIL and nvcompress.

  8. Place the the .dds file next to the btg.gz file into the flightgear scenery directory.

credits
links
  • Photoscenery of Brittany by Benoît Laniel.
  • Photoscenery of Paris by Benoît Laniel.
contact
flightgear forum

fgphotoscenery [at] yahoo [dot] com

Peter