Concepts

osgEarth brings web-based geospatial visualization to  OpenSceneGraph applications. It operates in a manner similar to the technology that underlies products like  NASA WorldWind,  Google Earth, and  Microsoft Virtual Earth. Like those systems, osgEarth relies heavily on map tiling and caching techniques in order to achieve high levels of performance and scalability.

Introduction

First this: osgEarth is not intended as an all-encompassing, general-purpose geospatial data library. You cannot simply throw arbitrary data sets together and expect to see a unified map. The primary purpose of osgEarth is to leverage the explosion in web mapping technologies and data; the ability to merge together dissimilar data sets is of secondary concern.

Web mapping technologies are based on the idea of tiled map caches. Take for example Google Maps, Yahoo! Maps, or any similar service. Instead of rendering arbitrary map extents on the fly, they pre-generate all their map tiles at various levels of resolution across the globe. As a result, publishing and displaying the map data is extremely fast and is reduced to a file-fetching exercise.

While this is very good for performance and scalability, the trade-off is that you limit the user to a set of predetermined resolutions and images. However, while this may not be acceptable in advanced GIS or CAD applications, it is usually quite acceptable for mapping and visualization.  OpenSceneGraph embraces this idea in the design of osgTerrain -- upon which osgEarth is based -- employing a hierarchy of discretely sized tiles to represent the world.

Tile Sources

A map contains one or more tile sources. Each tile source defines exactly how osgEarth reads imagery or heightfield data and how it incorporates it into the map. There are two kinds of tile sources: image sources and heightfield sources.

Here is a map with two image tiles sources and one elevation tile source:

   <map name="my globe" type="geocentric" version="2">

      <image name="satellite imagery" driver="tms">
          <url>http://server/imagery/satellite/</url>
      </image>

      <image name="miami inset" driver="gdal">
          <url>http://server/insets/miami.tif</url>
          <tile_size>256</tile_size>
          <format>jpg</format>
      </image>

      <elevation name="srtm30plus" driver="tms">
          <url>http://server/dem/srtm30plus/</url>
      </elevation>

   </map>

osgEarth will composite multiple image sources together. The ordering of sources in the map affects how this happens. The first image source is rendered first (on the "bottom" on the stack).

Drivers

Each tile source specifies the use of a particular driver. The driver is the module responsible for fetching source data and turning it into map tiles that osgEarth can composite into the final terrain model. osgEarth comes with a variety of drivers that can handle different web service protocols, data formats, and tiling schemes. You can also extend osgEarth's capabilities by [Extending building your own driver].

Profiles

What if different tile sources point to data in different geospatial projections or with different tiling schemes? Profiles address this issue.

A profile conveys the organization of a geospatial dataset. It defines three things:

  • The spatial reference (or projection)
  • The geospatial extents
  • The tiling scheme

Every tile source has a profile (whether implicit or explicit). In turn the entire map has a single profile that ultimately defines how map tiles turn into osgTerrain objects. osgEarth creates a quadtree of tiles from a profile to build the scene graph. Level 0 of any profile is a single tile covering the entire profile. Each tile in the quadtree can be uniquely referenced using the osgEarth TileKey? class.

Combining data with differing profiles

Whether a tile source will work in a map depends on whether its driver can create tiles that are compatible with the profile of that map. This compatibility will vary from driver to driver.

For example, if you want to see a round-earth globe, osgEarth needs the map to conform to a global profile -- specifically, to either the global-geodetic or global-mercator profile, the only two profiles that work for a globe. Therefore, any tile source that appears in your map must be able to generate data in one of those profiles.

Refer to the driver documentation for information on what profiles each driver supports.

Caching

Caching is a key technique for optimizing the performance of your application. osgEarth has a modular architecture that include a number of different caching mechanisms designed to speed up data fetching, processing, and assembly of map tiles.

Read more about creating and managing caches.


back to Documentation