Building osgEarth

osgEarth is a cross-platform library. It uses the  CMake cross-platform build system, version 2.8 or newer. This is the same build system that  OpenSceneGraph uses.


GET THE SOURCE CODE

Option 1: use GIT

osgEarth source is hosted on GitHub. You will need a git client to access it. We recommend  TortoiseGit for Windows users.

To clone the repository, point your client at:

 git://github.com/gwaldron/osgearth.git

The latest tagged release is Version 2.3. The git tag  osgearth-2.3.

Option 2: download a tarball

To download a tarball, visit the  Tags Page and select the one you want.

GET THE DEPENDENCIES

The following are REQUIRED DEPENDENCIES:

  •  GDAL 1.6 or later - Geospatial Data Abstraction Layer (version 1.5 will work too)
  •  CURL - HTTP transfer library (comes with OSG 3rd party library distros)

The following are OPTIONAL DEPENDENCIES. osgEarth will compile without them, but some functionality will be missing:

  •  GEOS 3.2.0 or later - C++ library for topological operations. This library is used by the osgEarthFeatures module to perform various geometry manipulation operations like buffering and intersection. If you plan to display vector/feature data in osgEarth, get this.
  •  MiniZip - zip file extractor; include this is you want to read KMZ files. (Win32/VS9 binary at the bottom of this page)
  •  SQLite 3.6 or later - embedded relational database engine. This is used by the cache_sqlite driver to cache tile data to an sqlite3 database.
  •  V8 - Google's JavaScript interpreter. Inlcude this if you want to embed JavaScript code in your earth file.

Option: get the pre-built 3rd Party Binaries for Win32

BUILD IT

osgEarth uses the  CMake build system, version 2.8 or newer.

Tips:

  • For optional dependencies (like GEOS or V8) you can just leave the entries blank (even if CMake complains).
  • For OSG, just input the OSG_DIR variable, generate, and CMake will find all the other OSG folder automatically.
  • Ensure the "DYNAMIC_OSGEARTH" flag is ON. Building osgEarth as a static library does not yet work on all platforms.
  • For the OPTIONAL dependencies listed above, just leave the corresponding entries blank if you don't want to use them.
  • Sometimes CMake will complain that it cannot run osgversion. You can safely ignore this in most cases.

GET PRE-BUILT BINARIES

Debian/Ubuntu? Packages

osgEarth is available pre-built for Debian Sid, Ubuntu Lucid, Maverick and Natty. Ubuntu packages are available from the UbuntuGis PPA. Installation:

sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable 
sudo aptitude install osgearth osgearth-data 

For trying osgEarth without installation you can download the OSGeo Live-DVD from  http://live.osgeo.org/

Thanks to Pirmin Kalberer for developing and maintaining these packages.

Windows Pacakges


Testing

Sample earth files are located within the subversion repository  here. Simple use 'osgviewer' (from the OpenSceneGraph distribution) to view a .earth file:

osgviewer gdal_tiff.earth

Basic Troubleshooting

The most common pitfall is shared libraries missing from your path. Your path should include:

  • OSG and osgEarth binaries
  • All of osgEarth's dependencies (Expat, CURL, and GDAL shared libs)
  • OSG's 3rd-party dependencies (particularly zlib and the libpng)

If you get an error complaining about a missing CURL plugin:

  • The CURL plugin is optional in the OSG CMake configuration. Make sure you enable and build it.

If you cannot get the GDAL driver to work properly:

  • Make sure the GDAL shared library is in your path
  • Set the GDAL_DATA environment variable to point to the folder containing GDAL's .csv files

If you still have problems, please  search the forums or post a question.

Attachments