<profile> Element

A profile is a geospatial context for rendering data. That is, it defines how pixels in an image map to real-world coordinates.

In order to render imagery or elevation data on a map, osgEarth needs to know (a) the profile of each data source, and (b) the profile of the map it is rendering.

  • The map profile is the geospatial description of the actual map that osgEarth is rendering. This could be the whole globe (which is usually an ellipsoid of some type), or it might be a flat projected area of the world. In either case, the map profile describes this geospatial context. osgEarth uses this information to render images and heightfield at the correct locations.
  • Each data source (or "layer") has its own profile that describes how the data in that layer is organized. This is important because osgEarth needs to know how to transform data from that layer into the map profile described above.

Components of a profile

A profile consists of the following:

  • A spatial reference system (SRS)
  • A vertical datum (VSRS)
  • Geographic extents (i.e., the bounding box)
  • A tiling scheme

Attributes

name Readable name of the profile. optional
srs The SRS initialization string. You can use  PROJ4 or  WKT strings optional
vsrs The Vertical SRS initialization string. This defines the vertical datum for the profile (i.e., how to interpret height values in an elevation grid). By default, the vertical datum is an ellipsoidal datum (meters above the SRS reference ellipsoid). Currently, the only available option is "egm96-meters". optional
xmin, ymin, xmax, ymax Geographic extents of the profile, expressed relative to the SRS. optional

Examples

The following defines a standard WGS84 global profile, using a PROJ4 SRS string.

    <profile name="WGS84">
        <srs>+prog=latlong +ellps=WGS84 +datum=WGS84</srs>
    </profile>

Global WGS84 is such a common profile that there is a shorthand "well-known" definition:

    <profile>global-geodetic</profile>

Another "well-known" profile is a global profile based on the spherical mercator projection. This one is used for many web-based data sources (like Yahoo!, Google, Microsoft, and OpenStreetMap?). This profile has the advantage of rendering text properly at all latitudes, and or preserving area.

    <profile>global-mercator</profile>

You can create a custom ellipsoid too. For example, you might want to make a profile for a clouds layer. Here we use a PROJ4 SRS initialization string to make a custom spheroid (+a = semi-major axis, +b = semi-minor axis).

    <profile>
        <srs>+proj=latlong +a=6800000 +b=6800000</srs>
    </profile>

If you want to define a profile that only covers a subset of the map, define the extents like so:

    <profile>
        <srs>+prog=latlong +ellps=WGS84 +datum=WGS84</srs>
        <xmin>-10.2</xmin>
        <xmax>10.6</xmax>
        <ymin>-18.34</ymin>
        <ymax>10.0</ymax>
    </profile>

Perhaps you need to define a profile for a projected map. Here is one for a State Plane terrain:

    <profile name="NAD83 Maryland State Plane (meters)">
        <srs>+proj=lcc +lat_1=38.3 +lat_2=39.45 +lat_0=37.66666666666666 +lon_0=-77 +x_0=399999.9999999999 +y_0=0 +ellps=GRS80 +datum=NAD83 +to_meter=1.0 +no_defs</srs>
        <xmin>390021</xmin><ymin>126298</ymin>
        <xmax>407833</xmax><ymax>147521</ymax>
    </profile>

This profile defines an EGM96 (MSL) vertical datum, which is the height geoid used in DTED data:

    <profile name="MSL/WGS84">
        <srs>+prog=latlong +ellps=WGS84 +datum=WGS84</srs>
        <vsrs>egm96-meters</vsrs>
    </profile>