GML was developed with a number of explicit design goals, a few of which overlap the objectives of XML itself:
provide a means of encoding spatial information for both data transport and data storage, especially in a wide-area Internet context;
be sufficiently extensible to support a wide variety of spatial tasks, from portrayal to analysis;
establish the foundation for Internet GIS in an incremental and modular fashion;
allow for the efficient encoding of geo-spatial geometry (e.g. data compression);
provide easy-to-understand encodings of spatial information and spatial relationships, including those defined by the OGC Simple Features model;
be able to separate spatial and non-spatial content from data presentation (graphic or otherwise);
permit the easy integration of spatial and non-spatial data, especially for cases in which the non-spatial data is XML-encoded;
be able to readily link spatial (geometric) elements to other spatial or non-spatial elements.
provide a set common geographic modeling objects to enable interoperability of independently-developed applications.
GML is designed to support interoperability and does so through the provision of basic geometry tags (all systems that support GML use the same geometry tags), a common data model (features/properties), and a mechanism for creating and sharing application schemas. Most information communities will seek to enhance their interoperability by publishing their application schemas; interoperability may be further improved in some cases through the use of profiles as outlined in section 7.
In general terms a schema defines the characteristics of a class of objects; in XML a schema also describes how data is marked up. GML strives to cater to a broad range of users, from neophytes to domain experts interested in modeling the semantics of geo-spatial information. Version 2.0 of GML is compliant with the XML Schema Candidate Recommendation published by the W3C in two parts on 24 October 2000 [XMLSchema1], [XMLSchema2]). GML has also been developed to be consistent with the XML Namespaces Recommendation [XMLName]. Namespaces are used to distinguish the definitions of features and properties defined in application-specific domains from one another, and from the core constructs defined in GML modules.
Geospatial feature types can be considered apart from their associated schemas. That is, a Road type (or class) exists independently of its schema definition whether it's expressed in terms of a DTD or an XML Schema. In GML 2.0 geospatial types are captured as element names, but these names assert the existence of model-level types separately from their XML Schema encodings. Consider the following example: a Road type is introduced in an application schema by declaring a global <Road> element of a type named RoadType (<element name="Road" type="RoadType"/>). We note the interplay of two perspectives: conceptual and implementation. Declaring that width is a property of a Road is a model-level assertion that says nothing about whether width is a floating point number with two decimal places or simply an integer?these are data and process characteristics at the implementation level.
GML 2.0 defines three base schemas for encoding spatial information. The Geometry schema (geometry.xsd) replaces the DTD that appeared in GML 1.0. This release provides an enhanced Feature schema that supports feature collections (as feature types) and includes common feature properties such as fid (a feature identifier), name and description. The XLink schema provides the XLink attributes to support linking functionality. Database implementations are required to provide an application schema that defines the schema expressions for the geographic features that they support, and these are derived from the definitions found in the Feature schema.
The XML schema definition language provides a superset of the facilities provided by the DTD validation mechanism defined in the XML 1.0 specification. XML Schema provides a rich set of primitive datatypes (e.g. string, boolean, float, month), and it allows the creation of built-in and user-defined datatypes. XML Schema offers several advantages when it comes to constraining GML encodings:
it enables the intermingling of different vocabularies using namespaces;
it permits finer control over the structure of the type definition hierarchy; and
it confers extensibility and flexibility via derived types and substitution groups
GML has been designed to uphold the principle of separating content from presentation. GML provides mechanisms for the encoding of geographic feature data without regard to how the data may be presented to a human reader. Since GML is an XML application, it can be readily styled into a variety of presentation formats including vector and raster graphics, text, sound and voice. Generation of graphical output such as maps is one of the most common presentations of GML and this can be accomplished in a variety of ways including direct rendering by graphical applets or styling into an XML graphics technology (e.g. SVG [SVG] or X3D [VRML200x]). It should be noted that GML is not dependent on any particular XML graphical specification.