FeatureClass | <xs:element ...请参考 ClassDefinition (带有主键属性)... </xs:element> <xs:complexType name=“<className>Type” abstract=“<true | false>“/> { 请参考FeatureClass.GeometryProperty } <xs:complexContent> <xs:extension base=“{baseClass}?{baseClass.schema.name}:{baseClass.name} : ‘gml:AbstractFeatureType’ “ > <xs:sequence> {属性列表请参考DataProperty和Geometric属性} </xs:sequence> </xs:extension> </xs:complexContent> </xs:complexType> |
FeatureClass. GeometryProperty | <!--这些是xs:complexType元素的属性--> fdo:geometryName=“<geometryPropertyName>“ fdo:geometricTypes=“<list of FdoGeometricTypes>“ fdo:geometryReadOnly=“<true | false>“ fdo:hasMeasure=“<true | false>“ fdo:hasElevation=“<true | false>“ fdo:srsName=“<spatialContextName>“/> |
DataProperty (decimal或string类型) | <!--minOccurs属性仅当值是1的时候才生成;Default属性仅当存在默认值时才生成;fdo:readOnly属性仅当值是1的时候才生成。--> <xs:element name=“<propertyName>“ minOccurs=“{isNullable ? 0 : 1}” default=“<defaultValue>“ fdo:readOnly=“<true | false>“> <xs:simpleType> {请参考 DataType String或DataType Decimal } </xs:simpleType> </xs:element> |
DataProperty (其他类型) | <xs:element name=“<propertyName>“ type=“<datatype>“ minOccurs=“{isNullable ? 0 : 1}” default=“<defaultValue>“ fdo:readOnly=“<true | false>“> </xs:element> |
DataType String | <xs:restriction base=“xs:string”> <xs:maxLength value=“<length>“/> </xs:restriction> |
DataType Decimal | <xs:restriction base=“xs:decimal”> <xs:totalDigits value=“<precision>“/> <xs:fractionDigits value=“<scale>“/> </xs:restriction> |
GeometricProperty
| <xs:element name=“<propertyName>“ type=“gml:AbstractGeometryType” fdo:geometryName=“<propertyName>“ fdo:geometricTypes=“<list of FdoGeometricTypes>“ fdo:geometryReadOnly=“<true | false>“ fdo:hasMeasure=“<true | false>“ fdo:hasElevation=“<true | false>“ fdo:srsName=“<spatialContextName>“/> > </xs:element> |
MetaData | <!--在xs:schema元素中为FeatureSchema引用的模式--> <xs:annotation> <xs:documentation> {对FdoFeatureSchema::Create()的描述} </xs:documentation> </xs:annotation> <!--在xs:schema元素中为DataProperty引用的样式--> <xs:annotation> <xs:documentation> {对FdoDataPropertyDefinition::Create()的描述} </xs:documentation> </xs:annotation> <!--在xs:element元素为非要素GeometricProperty引用的模式--> <xs:annotation> <xs:documentation> {对FdoGeometricPropertyDefinition::Create()的描述} </xs:documentation> </xs:annotation> <!--在xs:complexType元素为FeatureClass引用的样式--> <xs:annotation> <xs:documentation> {对FdoFeatureClass::Create()的描述} </xs:documentation> <xs:appinfo source=“<uri>“/> <xs:documentation> {对FdoGeometricPropertyDefinition::Create()的描述} </xs:documentation> </xs:annotation> |
表 9‑3 FDO模式元素和GML模式片段的对应关系
表 9‑4显示了Map FDO数据类型和GML数据类型对照关系。
FDO数据类型 | GML数据类型 |
Boolean | xs:boolean |
Byte | fdo:Byte |
DateTime | xs:dateTime |
Double | xs:double |
Int16 | fdo:Int16 |
Int32 | fdo:Int32 |
Int64 | fdo:Int64 |
Single | xs:float |
BLOB | xs:base64Binary |
CLOB | xs:string |
表 9‑4 FDO数据类型和GML数据类型对照表
1.1.1 GML 模式文件的创建
以下示例为“Buildings”要素定义了一个表格,这是Open GIS联盟的文档98-046r1中的一个示例。本节中,我们将通过为要素类“Buildings”创建GML模式文件来展示如何创建GML模式文件。
<ogc-sfsql-table> <table-definition> <name>buildings</name> <column-definition> <name>fid</name> <type>INTEGER</type> <constraint>NOT NULL</constraint> <constraint>PRIMARY KEY</constraint> </column-definition> <column-definition> <name>address</name> <type>VARCHAR(64)</type> </column-definition> <column-definition> <name>position</name> <type>POINT</type> </column-definition> <column-definition> <name>footprint</name> <type>POLYGON</type> <column-definition> </table-definition> |
1.1.1.1 添加模式
让我们从一个基本的GML框架开始添加一个模式。
<xs:schema xmlns:xs=http://www.w3.org/2001/XMLSchema targetNamespace=“http://<customer_url>/<FeatureSchemaName>“ xmlns:fdo=http://fdo.osgeo.org/schema xmlns:gml=http://www.opengis.net/gml xmlns:<FeatureSchemaName>=“http://<customer_url>/<FeatureSchemaName>“ elementFormDefault=“qualified” attributeFormDefault=“unqualified”> <xs:annotation> <xs:documentation>{对FdoFeatureSchema::Create()的描述}</xs:documentation> </xs:annotation> {<每个类中只能有一个 xs:element 和/或 xs:complexType >} </xs:schema> |
通过如下的替换,可以设置要素模式的名称和描述。
l 用“fdo_customer”代替“<customer_url>”。
l 用“OGC980461FS”代替“<FeatureSchemaName>”,从而设置要素模式名称。
l 设置要素模式描述:用“OGC Simple Features Specification for SQL” 代替“{对FdoFeatureSchema::Create()的描述}”,从而设置要素模式描述。
1.1.1.2 添加要素类
在以上GML模式的基础上,让我们接着添加一个要素类。
<xs:schema xmlns:xs=“http://www.w3.org/2001/XMLSchema” targetNamespace=“http://fdo_customer/OGC980461FS” |