The International At chives of the Photogrammetry, Remote Sensing and Spatial Information Sciences. Vol. XXXVII. Part B4. Beijing 2008
47
<schema targetNamespace="http://www.ukusa.org"
xmlns:app="http://www.ukusa.org"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:gml="http://www.opengis.net/gmr
xmlns:ex="http://www.ukusa.org">
<element name="City"
type="gml:AbstractFeatureCollectionType"
substitutionGroup="gml:_FeatureCollection"/>
<element name="Road" type="ex:RoadType"
substitutionGroup="gml:_Feature"/>
<element name="Bridge" type="ex:BridgeType"
substitutionGroup="gml:_Feature"/>
<element name="Building" type="ex:BuildingType"
substitutionGroup="gml:_Feature"/>
<complexType name="RoadType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element name="roadName"
type="string"/>
<element name="roadCode"
type="string"/>
<element ref="gml:curveProperty"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="BuiIdingType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element name="BuiIdingCode"
type="string'7>
<element name="BuildingHeight"
type="string"/>
<element ref="gml:Polygon"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="BridgeType">
<complexContent>
<extension base="gml:AbstractFeatureType">
<sequence>
<element name="span'7>
<element name="height" type="integer'7>
<element ref="gml:centerLineOf7>
<element ref="app:spans"
minOccurs="0'7>
</sequence>
</extension>
</complexContent>
</complexType>
<element name="spans"
type="app:CurvePropertyType'7>
<complexType name="CurvePropertyType">
<sequence>
<element ref="app:Gorge'7>
</sequence>
</complexType>
<element name="Gorge" type="app:GorgeType"
substitutionGroup="gml:_Feature'7>
<complexType name="GorgeType">
<complexContent>
<extension base="gml:AbstractFeatureType >
<sequence>
<element name="width" type="integer"
minOccurs="0'7>
<element name="depth" type="integer"
minOccurs="0'7>
<element ref="gmI:centerLineOf"
minOccurs="0'7>
</sequence>
</extension>
</complexContent>
</complexType>
</schema>
Table 1. City.xsd (GML application schema instance)
When import GML schema, one of the key points is to confirm
storage granularity of document instance according to schema.
Granularity is the degree of data induction and aggregation,
storage granularity determines size of fragments partitioned
from each GML document instance in database. Fragment could
be the whole GML document or single element. Table 1 shows
GML application schema City.xsd that describes city, in this
instance, city is the root element of GML document, city
contains Road, Building, Bridge, Gorge sub-elements. For
example, Road is a independent road, it’s a integrated
description of road, the sub-element of Road, such as
roadName roadCode gmkcurvePropert is specific
description on a certain aspect of road. If take City as root
element of partitioned fragment, the whole GML document
would be encapsulated as an object which would be operated as
a whole. And this object contains many integrated objects. To
query or reuse GML document, such granularity is too large,
which would increase cost on calling and operation. If take
roadName > roadCode x gmkcurveProperty as root element of
partitioned fragment, they are only describe one aspect of
object, it lacks of integrated meaning and reusing character.
Moreover, query result returned by user could not be generally
single element. Thus, appropriate granularity should be
partitioned by feature type. The feature with the same type
should be stored in the same disk file, for example, take Road,
Bridge, Building, Gorge as root element of partitioned GML
document instance fragment, the element content and its sub
element, as an integrated object , is stored in corresponding
database.
When read a GML document instance, system read would
firstly check the validity of GML document instance, after
affirm that GML document is good format GML document,
system would establish corresponding relationship between
GML document and storage structure according to mapping
rules, and decompose, save document instance. The instance
document City.xml generated according to City.xsd would not
be given in details due to the limitation of page. As mentioned
above, features (Bridge, Gorge, Building, and Road) have been
confirmed as root elements; so when it comes to Bridge, Gorge,
Building or Road element, system would store element content
and sub-element it contained into corresponding data collection
as a whole fragment without parsing sub-element. Thus this
approach does not change inner structure of element. It’s still a
legal GML document fragment. In other words, it’s still XML
format document that stored in database, in the database, a
XML file is used for managing these document fragments. This
instance includes two Bridge objects, one Gorge object, one
Road object, one Building object. The feature object with the
same type would be merged into one file, so this document
would be partitioned into one Bridge fragment, one Gorge