Geography Markup Language (GML) 2.0 – Enabling the Geospatial Web

GIS Contributor

Updated:

3. Ready for Prime Time

GML 1.0 was based on a combination of XML DTDs (Document Type Definition) and Resource Description Framework (RDF). This was an awkward but useful combination. DTDs were in widespread use, but lacked the ability to support type inheritance, had no underlying semantic model, and did not support namespaces. RDF on the other hand was less accepted but did offer namespace support, distributed schema integration, type hierarchies and a simple semantic model. While it was possible to more or less use all of these features it was at best an awkward combination.GML 2.0, which replaces GML 1.0, is based entirely on XML Schema (October 14, 2000). The adoption of XML Schema (XSD) is a major advance. XML Schema has matured greatly in the past year and now incorporates support for type inheritance, distributed schema integration, and namespaces. Moreover there are now a great variety of tools and parsers that support XML Schema and more are anticipated in the near future.GML 1.0 offered three different profiles that were referred to as GML.1, GML.2 and GML.3. Such profiles were also somewhat awkward constructs in GML 1.0 as they overlapped different encoding methods (XML 1.0 (DTD) and RDF) with different approaches to the encoding of schemas. GML 2.0 provides a single encoding method (XML Schema) and a single approach to the creation of feature schemas. A simple example illustrates the difference between GML 1.0 and GML 2.0.

<Feature typeName="Road">
<description>Georgia Street</description>
<property typeName="numberLanes" type="integer">4</property>
<geometricProperty typeName="linearGeometry">
<LineString srsName="EPSG:4326">
<coordinates> 0.0,100.0 100.0,0.0 </coordinates>
</LineString>
</geometricProperty>
</Feature>

 

Figure 2.0 Example GML 1.0 Profile 1 (GML.1) Feature InstanceNote that this example makes no use of namespaces (namespaces were not supported in DTDs) and that the feature type is not actually defined. GML 1.0, Profile 1, offered no means for feature schema expression independent of the data instance itself.Profile 2. provided more schema support through user defined DTDs and this approach is continued in GML 2.0 through user defined XML Schemas. A GML 1.0, Profile 2. instance looked as follows:

<Road>
<description>Georgia Street</description>
<numberLanes>4</numberLanes>
<centerLineOf>
<LineString srsName="EPSG:4326">
<coordinates>0.0,50.0 0.0,100.0 </coordinates>
</LineString>
</centerLineOf>
</Road>

Figure 3.0 Example GML 1.0, Profile 2 (GML.2) Feature InstanceWith Profile 2, GML 1.0 users were able to define their own feature types using XML DTDs. Profile 2. instances were easily recognized by the presence of feature types as XML elements or tags (e.g. <Road> above). Note however, that there was no namespace support and no notion of type hierarchies.


Free weekly newsletter

Fill out your e-mail address to receive our newsletter!
Email:  

By entering your email address you agree to receive our newsletter and agree with our privacy policy.
You may unsubscribe at any time.


Some of these restrictions were lifted in GML 1.0, Profile 3., and Profile 3.0instances very closely resemble those of GML 2.0. The same road in Profile 3. (GML .3) looked as follows:

<os:Road>
<gml:description> Georgia Street </gml:description>
<os:numberLanes>4</os:numberLanes>
<gml:centerLineOf>
<gml:LineString srsName="EPSG:4326">
<gml:coordinates>0.0,100.0 100.0,0.0</gml:coordinates> 	</gml:LineString>
<gml:centerLineOf>
</os:Road>

Figure 4.0 Example GML 1.0, Profile 3 (GML.3) Feature Instance

Note that in this profile user schemas are again supported as is obvious from the <os:Road> element name. The use of namespace prefixes (the os in front of Road) allows users to create specific vocabularies based on their organization or on the domain or information community of interest. With namespace support we can clearly distinguish <os:Road> from <usgs:Road> or <nrcan:Road> .GML 2.0 takes us even further. As in GML 1.0, Profile 3., namespaces can be exploited to create different vocabularies or feature type families. Moreover we can use type inheritance and distributed schema support to build feature type families from one another as shown in Figure 5.0 without concern for feature type name conflicts.

Figure 5.0 Building Feature Type VocabulariesFigure 5.0 shows three vocabularies. One is a set of basic definitions for features and geometry (Common Geo-spatial Vocabulary), while the other two provide specific features types for the Forestry and Environment domains. Note that by using namespace prefixes, each of the domain vocabularies shown in Figure 5.0 can define the same feature types without concern for name conflicts. Each can, for example, contain its own notion of road using the name Road, and users of these schemas can clearly distinguish one from the other by means of the namespace prefix. (From Figure 5.0 we would have <env:Road> and <for:Road>.)GML 2.0 provides the basic definitions (as shown in Figure 5.0) and the mechanisms for building a distributed hierarchy of feature types. It thus lays the foundations for the Geo-spatial Web. GML 2.0 is ready for prime time.

Photo of author
About the author
GIS Contributor
Guest articles from GIS professionals. Authorship information is listed at the bottom of the articles.