applet-magic.com Thayer Watkins Silicon Valley & Tornado Alley USA |
---|
|
GML is likely to change as it has already changed, but the future changes are likely to be modification and elaborations of a fundamental model.
GML was to be a content-oriented XML application completely separate from the area of how to display maps and other types of geographic information on the Web. OGC intended to create an unambiguous system of coding geographic information that would make possible the storage and the sharing of such information. This meant the coded documents would not require an expert or special additional knowledge for their interpretation. It is commonplace for some maps or data to unusable except by their caretaker because only the caretaker knows those crucial bits of information such as what the projection is for a map or the base point for the coordinates. GML intended to avoid the problem of missing information for geographic documents. It does this as an application of XML by specifying what information is mandatory for a file and by requiring all documents to be validated by a parsing program.
The geometric elements in GML may be specified by a Coordinate List, which is just a list of (x,y) coordinate pairs with some separators such as commas and spaces. The separators can be specified by attribute values of the the <coordinates> tag.
There is another geometric element, the Box, which is specified by two coordinate points, the upper left corner and the lower right corner. The Box element is used more to encode properties component of a geographic document than the strictly geometric structure of a map.
In the above diagram some elements are not fully described in order to improve comprehensibilty. Also in GML the official names of the features denoted Exterior Boundary and Interior Boundary are outerBoundaryIs and InnerBoundaryIs. The obstruse terminology comes from Logic Programming, upon which GML is modeled. Collections of geometric features such as MultiPoint use a subfeature selection element which in the case of MultiPoint is called pointMember. A few examples will illustrate how the geometric information is encoded.
First consider some simple geometric features. Suppose there is point at x,y coordinates (10,25), a line from (0,0) to (15,30) to (40,70) and a triangle polygon with corners at (30,40), (70,80) and (50,120). These features would be encoded at follows:
<Point>
<coordinates>
10,25
</coordinates>
</Point>
<LineString>
<coordinates>
0,0 15,30
</coordinates>
</LineString>
<Polygon>
<outerBoundaryIs>
<LinearRing>
<coordinates>
30,40 70,80 50,120
</coordinates>
</LinearRing>
</outerBoundaryIs>
</Polygon>
<MultiPoint>
<pointMember>
<Point>
<coordinates>
10,25
</coordinates>
</Point>
</pointMember>
<pointMember>
<Point>
<coordinates>
15,40
</coordinates>
</Point>
</pointMember>
<pointMember>
<Point>
<coordinates>
20,45
</coordinates>
</Point>
</pointMember>
<//MultiPoint>
The coding for a MutiLineString and MultiPolygon would be similar. A GeometryCollection would require additional tags for <geometryMember> </geometryMember>.
In the above examples each tag was put on a separate line for clarity but there is no necessity of doing this. Each encloding could have been put on a single line and it would still be valid, as would any formatting between these two extremes.
While the above diagram serves its purpose of showing the general structure of the featureCollection element of GML it is deficient in that it does that show which elements are optional and which may appear multiple times. The notation that is used to show such information is as follows:
Notation | Meaning |
---|---|
ELEMENT* | ELEMENT may occur zero or any number of times |
ELEMENT? | ELEMENT may occur zero or one time |
ELEMENT+ | ELEMENT may occur one or more times, it must occur at least once |
ELEMENT | ELEMENT must occur exactly once |
The diagram for the featureCollection element with the information on the allowed occurence of the elements is shown below:
As the above diagram indicates the boundedBy element is mandatory for a featureCollection element but optional for a Feature element.
The corresponding diagram for the geometry elements is shown below.
Note the interesting item in the above diagram that the exterior boundary of a Polygon is optional but there can be only one. There may be zero or any number of interior boundaries. Making the exterior boundary optional allows the entire world of the map to defined as a Polygon element.
In order to simply the structure the geometricProperty element in the above diagram is not expanded. A geometricProperty element will include a typeName attribute which may be any of the following: pointProperty, lineStringProperty, polygonProperty and multiGeometryProperty. These in term may have subproperties such as location, centerOf, position, centerLineOf, edgeOf, extentOf, coverage. These subProperties may have subelements which are the geometry classes of point, lineString, polygon, multiPoint, multiLineString and multiPolygon. This is shown diagramatically below:
Since there is no space in the above diagram for the structure of the elements such as centerOf these are given below:
The outerBoundaryOf and innerBoundaryOf elements of course have lineString subelements which in turn have coordinates elements.
With the previous overview of the formal structure of GML it is possible to encode various features of a map.
<Feature typeName="Region">
<name>
Silicon Valley
</name>
<description>
The region of the San Francisco Bay Area noted for its high technology
industry. It is largely a part of Santa Clara County, California but
it also includes portions of San Mateo County.
</description>
<boundedBy>
<Box>
<coordinates>
-123.5,38.7 -121.7,37.1
</coordinates>
</Box>
</boundedBy>
</Feature>
The meaning of the coordinates has to be given elsewhere in the GML file. Remember that the code sequences given above are merely fragments of a GML file. Also most references to the attributes of elements has been purposely left out in order to simplify the presentation. The matter of element attributes will be dealt with below.
For another example of a feature, one that has a more complicated structure, consider Highway 101, a freeway which traverses the Silicon Valley.
<Feature typeName="Freeway">
<name>
Highway 101 in the Silicon Valley
</name>
<description>
A major highway running through Santa Clara County, California with a
northwest-southeast orientation
</description>
<geometricProperty>
<LineString>
<coordinates>
-123.5,38.7 -121.7,37.1
</coordinates>
</LineString>
</geometricProperty>
</Feature>
A user may want to use several external DTD's. A problem would arise if an element of the same name is defined in more than one place. The W3C formulated a method for avoiding the problem of conflicting definitions of terms used in XML files, include GML files. It is called namespace. Although this term sounds obscure the concept is relatively simple.
The XML file defines a name for a source of DTD's as given in a URL. The GML cites an element type in the notation of nmsp:element which means that the definition of element is to be found in the URL for the label nmsp. While namespace notation is an effective solution to the problem of conflicting definitions of terms in DTD's it does make the XML files less readable.
The geometric classes of Point, LineString, Polygon, Multipoint, MultiLineString, MultiPolygon and GeometricCollection all have the same attribute list.
<rdfs:Class rdf:ID="Point">
<rdfs:subClassOf rdf:resource="#Geometry" />
</rdfs:Class>
As can be seen above the code uses the Resource Definition Format Schema namespace rdfs: and the Resource Definition Format namespace rdf:. Generally the RDF Schema is consistent with GML but gives the opportunity of going beyond GML. The RDF Schema is explained more fully elsewhere. Resource Description Framework.
HOME PAGE OF Thayer Watkins |