Print This Post

GeoWorld: Profiles Make GML Easier to Swallow

GeoWorld Issue Date: September – 2005, Posted On: 9/1/2005

Profiles Make GML Easier to Swallow-GML DEVELOPMENT

RON LAKE, president, Galdos Systems Inc.;e-mail: rlakeatgaldosincdotcom  (%20rlakeatgaldosincdotcom)  

The release of Geography Markup Language (GML) 3.0 in 2003 greatly increased the scope of applications that GML could deal with by adding components to support real-time sensors, coverages (including imagery), topology, time and dynamic features as well as adding a large number of new geometric types. As a result, GML now is being applied to many real-world problems, including resource management, intelligent transportation systems, nautical charting and census data management.At the same time, the increase in scope has resulted in an increase in the volume and complexity of the GML specification and associated schemas. This makes implementing GML somewhat daunting for developers and vendors who are new to the technology, especially if they're new to Extensible Markup Language (XML).

Lowering the Bar

Although GML schemas are arranged in a modular fashion (e.g., one need only import geometryBasic0D1D.xsd for many applications), many people have felt the need to have a "lower bar" to facilitate the broader and more rapid adoption of GML. The Open Geospatial Consortium (OGC) responded to this need in several ways, including the following:  

    1. Defining a simple GML point profile aimed at specification developers that have point geometric data but don't want to use GML grammar.  

    2. Defining a simple GML for Simple Features profile aimed at supporting vector feature requests and transactions (e.g., to/from a Web Feature Service).  

    3. Providing a subset tool that can automatically generate compliant profiles of GML containing a user-specified list of components.

Each of these are important steps forward in increasing GML acceptance, but it should be noted that profiles aren't to be confused with application schemas.Profiles live in GML namespaces (see www.opengis. org/gml) and define restricted subsets of GML. Application schemas are XML vocabularies defined using GML that live in an application-defined target namespace. Application schemas can be built on specific GML profiles or use the full GML schema set.

When Points are Sufficient

The GML point profile contains a single GML object (i.e., gml:Point). It can be used in any XML schema by importing the point profile and referencing the point as required. A simple example might look as follows:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
  <PhotoCollection xmlns="http://www.myphotos.org"
   xmlns:gml="http://www.opengis.net/gml"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xsi:schemaLocation="http://www.myphotos.org MyPhotoExample.xsd">
    <items>
      <Item>
        <name>Stanley Park</name>
        <description>A much better shot of the park from the city</description>
        <where>Vancouver</where>
        <position>
          <gml:Point srsDimension="2" srsName="urn:ogc:def:crs:EPSG:6.6:4326">
            <gml:pos>49.27 -123.11</gml:pos>
          </gml:Point>
        </position>
      </Item>
    </items>
  </PhotoCollection>

Note that in this case, the only GML is the gml:Point object. The rest is defined by the photo-collection schema.

Keep It Simple

The GML profile for Simple Features is a more complete profile of GML and provides sufficient support for a wide range of vector feature objects, including the following:

   1. A reduced geometry model allowing 0d, 1d and 2d linear geometric objects and the corresponding aggregate geometries.
   2. A simplified feature model that can only be one level deep.
   3. All non-geometric properties must be XML schema simple types (i.e., no nested elements).
   4. Remote property value references (xlink:href) such as in the main GML specification.

Because the profile aims to provide a simple entry point, it doesn't provide support for coverages, topology, observations, value objects (for real-time sensor data) and dynamic features. Nonetheless, it will support a variety of real-world problems.

For Those Who Want More

Although it's not widely known, GML has incorporated a profiling tool (a pair of XSLT scripts) as part of the specification since GML 3. These scripts permit the automatic generation of a profile or a profile starting point should users want additional manual editing or schema restriction. In fact, the aforementioned profiles were generated using the subset tool, followed by some manual edits to enforce specific schema restrictions.

The subset tool can be used to generate profiles for many other reasons. Users simply list the elements/attributes wanted in the resultant profile schema and run the tool. The result is a single profile schema file containing only the user-specified items as well as all of the element, attribute and type declarations on which the specified items depend. 

Read the article on their website: GeoWorld.