[mapguide-commits] r5625 - in trunk/Tools/Maestro: MaestroAPITests MaestroAPITests/UserTestData OSGeo.MapGuide.MaestroAPI/ObjectModels

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue Mar 15 06:00:19 EDT 2011


Author: jng
Date: 2011-03-15 03:00:19 -0700 (Tue, 15 Mar 2011)
New Revision: 5625

Added:
   trunk/Tools/Maestro/MaestroAPITests/UserTestData/odbc_example_config.xml
Modified:
   trunk/Tools/Maestro/MaestroAPITests/ConfigurationTests.cs
   trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj
   trunk/Tools/Maestro/MaestroAPITests/ResourceTests.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IFdoSpatialContext.cs
Log:
Add a new odbc configuration unit test using the config document provided in ticket #1478. According to the supplied document, XYZ tolerances need not be explicitly specified (in this case we use 0.0001 as the default) and the extent type can always be inferred from whether the bounding box element exists (exists = Static, not exists = Dynamic)

Also fix some broken resource tests due to ObjectFactory APIs that no longer exist

Modified: trunk/Tools/Maestro/MaestroAPITests/ConfigurationTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/ConfigurationTests.cs	2011-03-15 04:10:44 UTC (rev 5624)
+++ trunk/Tools/Maestro/MaestroAPITests/ConfigurationTests.cs	2011-03-15 10:00:19 UTC (rev 5625)
@@ -32,6 +32,13 @@
     public class ConfigurationTests
     {
         [Test]
+        public void TestOdbcLoad()
+        {
+            var conf = ConfigurationDocument.LoadXml(File.ReadAllText("UserTestData\\odbc_example_config.xml")) as OdbcConfigurationDocument;
+            Assert.NotNull(conf);
+        }
+
+        [Test]
         public void TestOdbcSaveLoad()
         {
             var schema = new FeatureSchema("Default", "Test schema");

Modified: trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj	2011-03-15 04:10:44 UTC (rev 5624)
+++ trunk/Tools/Maestro/MaestroAPITests/MaestroAPITests.csproj	2011-03-15 10:00:19 UTC (rev 5625)
@@ -585,6 +585,9 @@
     <Content Include="TestData\Wms\Sheboygan_CityLimits_Layer_Header.xml">
       <CopyToOutputDirectory>Always</CopyToOutputDirectory>
     </Content>
+    <Content Include="UserTestData\odbc_example_config.xml">
+      <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+    </Content>
   </ItemGroup>
   <ItemGroup>
     <BootstrapperPackage Include="Microsoft.Net.Client.3.5">

Modified: trunk/Tools/Maestro/MaestroAPITests/ResourceTests.cs
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/ResourceTests.cs	2011-03-15 04:10:44 UTC (rev 5624)
+++ trunk/Tools/Maestro/MaestroAPITests/ResourceTests.cs	2011-03-15 10:00:19 UTC (rev 5625)
@@ -80,11 +80,11 @@
             var sl2 = sl.Clone();
             Assert.AreNotSame(sl, sl2);
 
-            var ssd = new SimpleSymbolDefinition();
+            var ssd = ObjectFactory.CreateSimpleSymbol(conn, new Version(1, 0, 0), "Test", "Test Symbol");
             var ssd2 = ssd.Clone();
             Assert.AreNotSame(ssd, ssd2);
 
-            var csd = new CompoundSymbolDefinition();
+            var csd = ObjectFactory.CreateCompoundSymbol(conn, new Version(1, 0, 0), "Test", "Test Symbol");
             var csd2 = csd.Clone();
             Assert.AreNotSame(csd, csd2);
 
@@ -265,7 +265,7 @@
             }
             #endregion
 
-            res = ObjectFactory.CreateSimpleSymbol(conn);
+            res = ObjectFactory.CreateSimpleSymbol(conn, new Version(1, 0, 0), "Test", "Test Symbol");
             #region Simple Symbol Definition
             try
             {
@@ -298,7 +298,7 @@
             }
             #endregion
 
-            res = ObjectFactory.CreateCompoundSymbol(conn);
+            res = ObjectFactory.CreateCompoundSymbol(conn, new Version(1, 0, 0), "Test", "Test Symbol");
             #region Compound Symbol Definition
             try
             {
@@ -461,11 +461,11 @@
             var wl2 = conv.Upgrade(wl, targetVer);
             Assert.AreSame(wl, wl2);
 
-            var ssd = ObjectFactory.CreateSimpleSymbol(conn);
+            var ssd = ObjectFactory.CreateSimpleSymbol(conn, new Version(1, 0, 0), "Test", "Test Symbol");
             var ssd2 = conv.Upgrade(ssd, targetVer);
             Assert.AreSame(ssd, ssd2);
 
-            var csd = ObjectFactory.CreateCompoundSymbol(conn);
+            var csd = ObjectFactory.CreateCompoundSymbol(conn, new Version(1, 0, 0), "Test", "Test Symbol");
             var csd2 = conv.Upgrade(csd, targetVer);
             Assert.AreSame(csd, csd2);
 

Added: trunk/Tools/Maestro/MaestroAPITests/UserTestData/odbc_example_config.xml
===================================================================
--- trunk/Tools/Maestro/MaestroAPITests/UserTestData/odbc_example_config.xml	                        (rev 0)
+++ trunk/Tools/Maestro/MaestroAPITests/UserTestData/odbc_example_config.xml	2011-03-15 10:00:19 UTC (rev 5625)
@@ -0,0 +1,879 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Sample ODBC config document from Trac ticket #1478 -->
+<fdo:DataStore xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:fds="http://fdo.osgeo.org/schemas/fds">
+  <gml:DerivedCRS gml:id="CSRS.UTM-20N">
+    <gml:remarks>CSRS.UTM-20N</gml:remarks>
+    <gml:srsName>CSRS.UTM-20N</gml:srsName>
+    <gml:validArea>
+      <gml:boundingBox>
+        <gml:pos>339513.880000 5259234.580000</gml:pos>
+        <gml:pos>341580.170000 5260543.600000</gml:pos>
+      </gml:boundingBox>
+    </gml:validArea>
+    <gml:baseCRS>
+      <fdo:WKTCRS gml:id="CSRS.UTM-20N">
+        <gml:srsName>CSRS.UTM-20N</gml:srsName>
+        <fdo:WKT>PROJCS["CSRS.UTM-20N",GEOGCS["LL-CSRS",DATUM["CSRS",SPHEROID["GRS1980",6378137.000,298.25722210]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Transverse_Mercator"],PARAMETER["false_easting",500000.000],PARAMETER["false_northing",0.000],PARAMETER["central_meridian",-63.00000000000000],PARAMETER["scale_factor",0.9996],PARAMETER["latitude_of_origin",0.000],UNIT["Meter",1.00000000000000]]</fdo:WKT>
+      </fdo:WKTCRS>
+    </gml:baseCRS>
+    <gml:definedByConversion xlink:href="http://fdo.osgeo.org/coord_conversions#identity" />
+    <gml:derivedCRSType codeSpace="http://fdo.osgeo.org/crs_types">geographic</gml:derivedCRSType>
+    <gml:usesCS xlink:href="http://fdo.osgeo.org/cs#default_cartesian" />
+  </gml:DerivedCRS>
+  <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://fdo.osgeo.org/schemas/feature/Default" xmlns:fdo="http://fdo.osgeo.org/schemas" xmlns:gml="http://www.opengis.net/gml" xmlns:Default="http://fdo.osgeo.org/schemas/feature/Default" elementFormDefault="qualified" attributeFormDefault="unqualified">
+    <xs:element name="Dig_Sheet" type="Default:Dig_SheetType" abstract="false" substitutionGroup="gml:_Feature">
+      <xs:key name="Dig_SheetKey">
+        <xs:selector xpath=".//Dig_Sheet" />
+        <xs:field xpath="Item_ID" />
+      </xs:key>
+    </xs:element>
+    <xs:complexType name="Dig_SheetType" abstract="false" fdo:hasGeometry="false">
+      <xs:complexContent>
+        <xs:extension base="gml:AbstractFeatureType">
+          <xs:sequence>
+            <xs:element name="Item_ID">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Anom_Typ" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="MEC_Typ" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="MPPEH_Typ" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Rc_Itm_Cnt" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Descript" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Nomenclat" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Depth" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Angle" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Itm_Length" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Itm_Width" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Weight" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Weigh_Tot" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Date" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:dateTime" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Fin_Dispos" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Fin_DisDat" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:dateTime" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Post_X_Res" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Photo_Nam" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Comment" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+          </xs:sequence>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+    <xs:element name="Photos" type="Default:PhotosType" abstract="false" substitutionGroup="gml:_Feature">
+      <xs:key name="PhotosKey">
+        <xs:selector xpath=".//Photos" />
+        <xs:field xpath="ID" />
+      </xs:key>
+    </xs:element>
+    <xs:complexType name="PhotosType" abstract="false" fdo:hasGeometry="false">
+      <xs:complexContent>
+        <xs:extension base="gml:AbstractFeatureType">
+          <xs:sequence>
+            <xs:element name="ID">
+              <xs:simpleType>
+                <xs:restriction base="fdo:int32" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Filename" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Subfolder" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Comments" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Date" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:dateTime" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+          </xs:sequence>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+    <xs:element name="Targets" type="Default:TargetsType" abstract="false" substitutionGroup="gml:_Feature">
+      <xs:key name="TargetsKey">
+        <xs:selector xpath=".//Targets" />
+        <xs:field xpath="Target_ID" />
+      </xs:key>
+    </xs:element>
+    <xs:complexType name="TargetsType" abstract="false" fdo:hasGeometry="false">
+      <xs:complexContent>
+        <xs:extension base="gml:AbstractFeatureType">
+          <xs:sequence>
+            <xs:element name="Target_ID">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Northing" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:double" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Easting" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:double" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Channel1" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Channel3" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Comment" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+          </xs:sequence>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+    <xs:element name="All_Data" type="Default:All_DataType" abstract="false" substitutionGroup="gml:_Feature">
+      <xs:key name="All_DataKey">
+        <xs:selector xpath=".//All_Data" />
+        <xs:field xpath="Target_ID" />
+      </xs:key>
+    </xs:element>
+    <xs:complexType name="All_DataType" abstract="false" fdo:geometryName="Geometry">
+      <xs:complexContent>
+        <xs:extension base="gml:AbstractFeatureType">
+          <xs:sequence>
+            <xs:element name="Target_ID">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Channel1" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Channel3" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Comment" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Anom_Typ" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="MEC_Typ" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="MPPEH_Typ" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Descript" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Depth" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Angle" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Itm_Length" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Itm_Width" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Weight" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Weigh_Tot" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Geometry" type="gml:AbstractGeometryType" fdo:hasMeasure="false" fdo:hasElevation="true" fdo:srsName="CSRS.UTM-20N" fdo:geometricTypes="point " fdo:geometryTypes="point multipoint ">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+          </xs:sequence>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+    <xs:element name="DND" type="Default:DNDType" abstract="false" substitutionGroup="gml:_Feature">
+      <xs:key name="DNDKey">
+        <xs:selector xpath=".//DND" />
+        <xs:field xpath="Item_ID" />
+      </xs:key>
+    </xs:element>
+    <xs:complexType name="DNDType" abstract="false" fdo:geometryName="Geometry">
+      <xs:complexContent>
+        <xs:extension base="gml:AbstractFeatureType">
+          <xs:sequence>
+            <xs:element name="Item_ID">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Anom_Typ" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="MEC_Typ" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="MPPEH_Typ" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Rc_Itm_Cnt" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Descript" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Nomenclat" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Depth" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Angle" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Itm_Length" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Itm_Width" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Weight" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Weigh_Tot" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:float" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Date" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:dateTime" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Fin_Dispos" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Fin_DisDat" minOccurs="0">
+              <xs:simpleType>
+                <xs:restriction base="xs:dateTime" />
+              </xs:simpleType>
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+            <xs:element name="Post_X_Res" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Photo_Nam" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Comment" minOccurs="0">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+              <xs:simpleType>
+                <xs:restriction base="xs:string">
+                  <xs:maxLength value="" />
+                </xs:restriction>
+              </xs:simpleType>
+            </xs:element>
+            <xs:element name="Geometry" type="gml:AbstractGeometryType" fdo:hasMeasure="false" fdo:hasElevation="true" fdo:srsName="CSRS.UTM-20N" fdo:geometricTypes="point " fdo:geometryTypes="point multipoint ">
+              <xs:annotation>
+                <xs:documentation />
+              </xs:annotation>
+            </xs:element>
+          </xs:sequence>
+        </xs:extension>
+      </xs:complexContent>
+    </xs:complexType>
+  </xs:schema>
+  <SchemaMapping xmlns:rdb="http://fdordbms.osgeo.org/schemas" xmlns="http://fdoodbc.osgeo.org/schemas" provider="OSGeo.ODBC.3.2" name="Default">
+    <complexType name="Dig_SheetType">
+      <Table name="Dig_Sheet" />
+      <element name="Item_ID">
+        <Column name="Item_ID" />
+      </element>
+      <element name="Anom_Typ">
+        <Column name="Anom_Typ" />
+      </element>
+      <element name="MEC_Typ">
+        <Column name="MEC_Typ" />
+      </element>
+      <element name="MPPEH_Typ">
+        <Column name="MPPEH_Typ" />
+      </element>
+      <element name="Rc_Itm_Cnt">
+        <Column name="Rc_Itm_Cnt" />
+      </element>
+      <element name="Descript">
+        <Column name="Descript" />
+      </element>
+      <element name="Nomenclat">
+        <Column name="Nomenclat" />
+      </element>
+      <element name="Depth">
+        <Column name="Depth" />
+      </element>
+      <element name="Angle">
+        <Column name="Angle" />
+      </element>
+      <element name="Itm_Length">
+        <Column name="Itm_Length" />
+      </element>
+      <element name="Itm_Width">
+        <Column name="Itm_Width" />
+      </element>
+      <element name="Weight">
+        <Column name="Weight" />
+      </element>
+      <element name="Weigh_Tot">
+        <Column name="Weigh_Tot" />
+      </element>
+      <element name="Date">
+        <Column name="Date" />
+      </element>
+      <element name="Fin_Dispos">
+        <Column name="Fin_Dispos" />
+      </element>
+      <element name="Fin_DisDat">
+        <Column name="Fin_DisDat" />
+      </element>
+      <element name="Post_X_Res">
+        <Column name="Post_X_Res" />
+      </element>
+      <element name="Photo_Nam">
+        <Column name="Photo_Nam" />
+      </element>
+      <element name="Comment">
+        <Column name="Comment" />
+      </element>
+    </complexType>
+    <complexType name="PhotosType">
+      <Table name="Photos" />
+      <element name="ID">
+        <Column name="ID" />
+      </element>
+      <element name="Filename">
+        <Column name="Filename" />
+      </element>
+      <element name="Subfolder">
+        <Column name="Subfolder" />
+      </element>
+      <element name="Comments">
+        <Column name="Comments" />
+      </element>
+      <element name="Date">
+        <Column name="Date" />
+      </element>
+    </complexType>
+    <complexType name="TargetsType">
+      <Table name="Targets" />
+      <element name="Target_ID">
+        <Column name="Target_ID" />
+      </element>
+      <element name="Northing">
+        <Column name="Northing" />
+      </element>
+      <element name="Easting">
+        <Column name="Easting" />
+      </element>
+      <element name="Channel1">
+        <Column name="Channel1" />
+      </element>
+      <element name="Channel3">
+        <Column name="Channel3" />
+      </element>
+      <element name="Comment">
+        <Column name="Comment" />
+      </element>
+    </complexType>
+    <complexType name="All_DataType">
+      <Table name="All_Data" />
+      <element name="Target_ID">
+        <Column name="Target_ID" />
+      </element>
+      <element name="Channel1">
+        <Column name="Channel1" />
+      </element>
+      <element name="Channel3">
+        <Column name="Channel3" />
+      </element>
+      <element name="Comment">
+        <Column name="Comment" />
+      </element>
+      <element name="Anom_Typ">
+        <Column name="Anom_Typ" />
+      </element>
+      <element name="MEC_Typ">
+        <Column name="MEC_Typ" />
+      </element>
+      <element name="MPPEH_Typ">
+        <Column name="MPPEH_Typ" />
+      </element>
+      <element name="Descript">
+        <Column name="Descript" />
+      </element>
+      <element name="Depth">
+        <Column name="Depth" />
+      </element>
+      <element name="Angle">
+        <Column name="Angle" />
+      </element>
+      <element name="Itm_Length">
+        <Column name="Itm_Length" />
+      </element>
+      <element name="Itm_Width">
+        <Column name="Itm_Width" />
+      </element>
+      <element name="Weight">
+        <Column name="Weight" />
+      </element>
+      <element name="Weigh_Tot">
+        <Column name="Weigh_Tot" />
+      </element>
+      <element name="Geometry" xColumnName="Easting" yColumnName="Northing" />
+    </complexType>
+    <complexType name="DNDType">
+      <Table name="DND" />
+      <element name="Item_ID">
+        <Column name="Item_ID" />
+      </element>
+      <element name="Anom_Typ">
+        <Column name="Anom_Typ" />
+      </element>
+      <element name="MEC_Typ">
+        <Column name="MEC_Typ" />
+      </element>
+      <element name="MPPEH_Typ">
+        <Column name="MPPEH_Typ" />
+      </element>
+      <element name="Rc_Itm_Cnt">
+        <Column name="Rc_Itm_Cnt" />
+      </element>
+      <element name="Descript">
+        <Column name="Descript" />
+      </element>
+      <element name="Nomenclat">
+        <Column name="Nomenclat" />
+      </element>
+      <element name="Depth">
+        <Column name="Depth" />
+      </element>
+      <element name="Angle">
+        <Column name="Angle" />
+      </element>
+      <element name="Itm_Length">
+        <Column name="Itm_Length" />
+      </element>
+      <element name="Itm_Width">
+        <Column name="Itm_Width" />
+      </element>
+      <element name="Weight">
+        <Column name="Weight" />
+      </element>
+      <element name="Weigh_Tot">
+        <Column name="Weigh_Tot" />
+      </element>
+      <element name="Date">
+        <Column name="Date" />
+      </element>
+      <element name="Fin_Dispos">
+        <Column name="Fin_Dispos" />
+      </element>
+      <element name="Fin_DisDat">
+        <Column name="Fin_DisDat" />
+      </element>
+      <element name="Post_X_Res">
+        <Column name="Post_X_Res" />
+      </element>
+      <element name="Photo_Nam">
+        <Column name="Photo_Nam" />
+      </element>
+      <element name="Comment">
+        <Column name="Comment" />
+      </element>
+      <element name="Geometry" xColumnName="Easting" yColumnName="Northing" />
+    </complexType>
+  </SchemaMapping>
+</fdo:DataStore>
\ No newline at end of file

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IFdoSpatialContext.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IFdoSpatialContext.cs	2011-03-15 04:10:44 UTC (rev 5624)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/IFdoSpatialContext.cs	2011-03-15 10:00:19 UTC (rev 5625)
@@ -182,58 +182,72 @@
             if (!node.Name.Equals("gml:DerivedCRS"))
                 throw new Exception("Bad document. Expected element gml:DerivedCRS"); //LOCALIZEME
 
+            //Start off as dynamic, until we find a bounding box. Then we set it to static
+            this.ExtentType = FdoSpatialContextListSpatialContextExtentType.Dynamic;
+
             var meta = node["gml:metaDataProperty"];
-            var genMeta = meta["gml:GenericMetaData"];
+            if (meta != null)
+            {
+                var genMeta = meta["gml:GenericMetaData"];
 
-            var scType = genMeta["fdo:SCExtentType"];
-            var xyTol = genMeta["fdo:XYTolerance"];
-            var zTol = genMeta["fdo:ZTolerance"];
+                var scType = genMeta["fdo:SCExtentType"];
+                var xyTol = genMeta["fdo:XYTolerance"];
+                var zTol = genMeta["fdo:ZTolerance"];
 
-            this.ExtentType = (scType == null || scType.InnerText == "dynamic") ? FdoSpatialContextListSpatialContextExtentType.Dynamic : FdoSpatialContextListSpatialContextExtentType.Static;
+                //this.ExtentType = (scType == null || scType.InnerText == "dynamic") ? FdoSpatialContextListSpatialContextExtentType.Dynamic : FdoSpatialContextListSpatialContextExtentType.Static;
 
-            double xy_tol;
-            double z_tol;
+                double xy_tol;
+                double z_tol;
 
-            if (double.TryParse(xyTol.InnerText, out xy_tol))
-                this.XYTolerance = xy_tol;
+                if (double.TryParse(xyTol.InnerText, out xy_tol))
+                    this.XYTolerance = xy_tol;
 
-            if (double.TryParse(zTol.InnerText, out z_tol))
-                this.ZTolerance = z_tol;
+                if (double.TryParse(zTol.InnerText, out z_tol))
+                    this.ZTolerance = z_tol;
+            }
+            else
+            {
+                this.XYTolerance = 0.0001;
+                this.ZTolerance = 0.0001;
+            }
 
             var remarks = node["gml:remarks"];
             var srsName = node["gml:srsName"];
             var ext = node["gml:validArea"];
             var baseCrs = node["gml:baseCRS"];
 
-            //Anything we read in *must* be static!
-            this.ExtentType = FdoSpatialContextListSpatialContextExtentType.Static;
             this.Name = srsName.InnerText;
             this.Description = remarks.InnerText;
 
             var bbox = ext["gml:boundingBox"];
-            var ll = bbox.FirstChild;
-            var ur = bbox.LastChild;
+            if (bbox != null)
+            {
+                var ll = bbox.FirstChild;
+                var ur = bbox.LastChild;
 
-            var llt = ll.InnerText.Split(' ');
-            var urt = ur.InnerText.Split(' ');
+                var llt = ll.InnerText.Split(' ');
+                var urt = ur.InnerText.Split(' ');
 
-            if (llt.Length != 2 || urt.Length != 2)
-                throw new Exception("Bad document. Invalid bounding box"); //LOCALIZEME
+                if (llt.Length != 2 || urt.Length != 2)
+                    throw new Exception("Bad document. Invalid bounding box"); //LOCALIZEME
 
-            this.Extent = new FdoSpatialContextListSpatialContextExtent()
-            {
-                LowerLeftCoordinate = new FdoSpatialContextListSpatialContextExtentLowerLeftCoordinate()
+                this.Extent = new FdoSpatialContextListSpatialContextExtent()
                 {
-                    X = llt[0],
-                    Y = llt[1]
-                },
-                UpperRightCoordinate = new FdoSpatialContextListSpatialContextExtentUpperRightCoordinate()
-                {
-                    X = urt[0],
-                    Y = urt[1]
-                }
-            };
+                    LowerLeftCoordinate = new FdoSpatialContextListSpatialContextExtentLowerLeftCoordinate()
+                    {
+                        X = llt[0],
+                        Y = llt[1]
+                    },
+                    UpperRightCoordinate = new FdoSpatialContextListSpatialContextExtentUpperRightCoordinate()
+                    {
+                        X = urt[0],
+                        Y = urt[1]
+                    }
+                };
 
+                this.ExtentType = FdoSpatialContextListSpatialContextExtentType.Static;
+            }
+
             if (baseCrs.HasAttribute("xlink:href"))
             {
                 var href = baseCrs.GetAttribute("xlink:href");



More information about the mapguide-commits mailing list