Print This Post

GML Profiles

While the GML schemas are arranged in a modular fashion (e.g. one need only import geometryBasic0D1D.xsd for many applications), many have felt the need to have a lower bar to facilitate the broader and more rapid adoption of GML. This is accomodated in GML by the use of profiles. GML defines a profile (in the specification) and a number of profiles have been created or are being proposed, including:

  • A very simple GML Point Profile aimed at specification developers that have point geometric data but do not want to use the GML grammar.
  • A simple GML for Simple Features profile aimed at supporting vector feature requests and transactions (e.g. to/from a WFS).
  • A GML profile for GMJP2 (GML in JPEG 2000)
  • A GML profile for RSS (discussed below)

In addition, the GML specification provides a subset tool that can automatically generate compliant profiles of GML containing a user-specified list of components.

I believe that each of these are important steps forward in increasing the acceptance of GML.

We should note that Profiles are not to be confused with Application Schemas. Profiles live in the GML namespaces (http://www.opengeospatial.org/standards/gml) and define restricted subsets of GML. Application schemas are XML vocabularies defined using GML and which 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, namely a gml:Point. It can be used in any XML Schema simply be 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
  <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/MyGoodPhotos.xsd">
    <items>
      <Item>
        <name> Lynn Valley</name>
        <description>A shot of the falls from the suspension bridge</description>
        <where>North Vancouver</where>
        <position>
          <gml:Point srsDimension="2" srsName="urn:ogc:def:crs:EPSG:6.6:4326">
            <gml:pos>49.40 -123.26</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.

Simple and Stupid is Often Best

The GML Profile for Simple Features is a more complete profile of GML than the Point Profile and provides sufficient support for a wide range of vector feature objects. It includes:

  1. reduced geometry model allowing 0d, 1d and 2d linear geometric objects (all based on linear interpolation) and the corresponding aggregate geometries (gml:MultiPoint, gml:MultiCurve, etc).
  2. simplified feature model which can only be one level deep (in the general GML model, arbitrary nesting of features and feature properties is not permitted).
  3. All non-geometric properties must be XML Schema simple types – i.e. cannot contain nested elements.
  4. Remote property value references (xlink:href) just like in the main GML specification.

Since the profile aims to provide a simple entry point it does not provide support for:

  • coverages
  • topology
  • observations
  • value objects (for real time sensor data)
  • nor support for dynamic features.

Nonetheless it will support a good variety of real world problems.

A Possible Profile for RSS

The RSS community may have need for a different GML profile, one that DOES NOT have the complexity of the Simple Features Profile from a geometry perspective, but DOES have items needed in a news feed, like:

  • time (Time position, time duration)
  • dynamic features
  • observations
  • simple geometry (Points, LineStrings, Polygons)
  • features

Here is a draft of this profile:

For those who want more:

Although it is not all that widely known, GML has incorporated a profiling tool as part of the specification since GML 3. This profiling tool is referred to as a subset tool and is a pair of XSLT scripts written by Paul Daisey of the US Census Bureau. These scripts permit the automatic generation of a profile or a profile starting point should you wish to additional manual editing or schema restriction (remember that a profile is always a strict restriction of the full GML specification, and any application schema that can be generated using a profile must also be a valid application schema with respect to the full GML specification). In fact, both of the profiles above were generated using the subset tool, followed by some manual edits to enforce some specific schema restrictions.

The subset tool can be used to generate profiles for many other reasons as well. Simply list the elements/attributes you want included in the resultant profile schema and run the tool. The result, a single profile schema file containing only the user-specified items and all of the element, attribute and type declarations on which the specified items depend. Profile schemas have been created in this manner for a range of other specifications including IHO S-57 and GML in JPEG 2000. This ensures that the application schemas developed on these profiles do not carry around any components that will never be used.

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>