[mapguide-commits] r8178 - in sandbox/jng/tiling/Common: MdfModel MdfParser Schema

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Jun 2 13:34:20 PDT 2014


Author: jng
Date: 2014-06-02 13:34:20 -0700 (Mon, 02 Jun 2014)
New Revision: 8178

Modified:
   sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.cpp
   sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.h
   sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.cpp
   sandbox/jng/tiling/Common/MdfParser/IONameStringPair.cpp
   sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.cpp
   sandbox/jng/tiling/Common/MdfParser/SAX2Parser.cpp
   sandbox/jng/tiling/Common/Schema/MapDefinition-3.0.0.xsd
   sandbox/jng/tiling/Common/Schema/TileSetDefinition-3.0.0.xsd
Log:
MdfModel/MdfParser/Schema updates
 - Fix TileSetDefinition not being read by SAX2Parser
 - Fix BaseMapLayerGroup instances not being attached to TileSetDefinition
 - Fix NameStringPair instances not being attached to TileStoreParameters
 - Rename ImageFormat to Format in TileSetDefinition-3.0.0.xsd
 - Fix incorrect version in MapDefinition-3.0.0.xsd

Modified: sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.cpp	2014-05-30 15:31:40 UTC (rev 8177)
+++ sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.cpp	2014-06-02 20:34:20 UTC (rev 8178)
@@ -18,7 +18,7 @@
 #include "TileStoreParameters.h"
 
 TileStoreParameters::TileStoreParameters()
-    : m_imageFormat(L"PNG"),
+    : m_format(L"PNG"),
       m_width(300),
       m_height(300)
 {
@@ -70,13 +70,13 @@
     this->m_height = height;
 }
 
-// Property : ImageFormat
-const MdfString& TileStoreParameters::GetImageFormat() const
+// Property : Format
+const MdfString& TileStoreParameters::GetFormat() const
 {
-    return this->m_imageFormat;
+    return this->m_format;
 }
 
-void TileStoreParameters::SetImageFormat(const MdfString &imageFormat)
+void TileStoreParameters::SetFormat(const MdfString &format)
 {
-    this->m_imageFormat = imageFormat;
+    this->m_format = format;
 }
\ No newline at end of file

Modified: sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.h
===================================================================
--- sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.h	2014-05-30 15:31:40 UTC (rev 8177)
+++ sandbox/jng/tiling/Common/MdfModel/TileStoreParameters.h	2014-06-02 20:34:20 UTC (rev 8178)
@@ -45,9 +45,9 @@
         int GetTileHeight() const;
         void SetTileHeight(const int &height);
 
-        // Property : ImageFormat
-        const MdfString& GetImageFormat() const;
-        void SetImageFormat(const MdfString &imageFormat);
+        // Property : Format
+        const MdfString& GetFormat() const;
+        void SetFormat(const MdfString &format);
 
     private:
 
@@ -58,7 +58,7 @@
         int m_width;
         int m_height;
         MdfString m_provider;
-        MdfString m_imageFormat;
+        MdfString m_format;
         NameStringPairCollection m_parameters;
     };
 

Modified: sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.cpp	2014-05-30 15:31:40 UTC (rev 8177)
+++ sandbox/jng/tiling/Common/MdfParser/IOBaseMapLayerGroup.cpp	2014-06-02 20:34:20 UTC (rev 8178)
@@ -91,7 +91,14 @@
     if (this->m_startElemName == name)
     {
         this->m_layerGroup->SetUnknownXml(this->m_unknownXml);
-        this->m_map->GetBaseMapLayerGroups()->Adopt(static_cast<BaseMapLayerGroup*>(this->m_layerGroup));
+        if (NULL != this->m_map)
+        {
+            this->m_map->GetBaseMapLayerGroups()->Adopt(static_cast<BaseMapLayerGroup*>(this->m_layerGroup));
+        }
+        else if (NULL != this->m_tileset)
+        {
+            this->m_tileset->GetBaseMapLayerGroups()->Adopt(static_cast<BaseMapLayerGroup*>(this->m_layerGroup));
+        }
         this->m_map = NULL;
         this->m_layerGroup = NULL;
         this->m_startElemName = L"";

Modified: sandbox/jng/tiling/Common/MdfParser/IONameStringPair.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IONameStringPair.cpp	2014-05-30 15:31:40 UTC (rev 8177)
+++ sandbox/jng/tiling/Common/MdfParser/IONameStringPair.cpp	2014-06-02 20:34:20 UTC (rev 8178)
@@ -94,7 +94,7 @@
             ParseUnknownXml(name, handlerStack);
         }
     }
-    else if (this->m_featureSource)
+    else if (this->m_featureSource || this->m_tileStoreParams)
     {
         if (this->m_currElemName == L"Parameter") // NOXLATE
         {
@@ -138,6 +138,8 @@
             this->m_layer->GetPropertyMappings()->Adopt(this->m_nameStringPair);
         else if (this->m_featureSource)
             this->m_featureSource->GetParameters()->Adopt(this->m_nameStringPair);
+        else if (this->m_tileStoreParams)
+            this->m_tileStoreParams->GetParameters()->Adopt(this->m_nameStringPair);
 
         this->m_layer = NULL;
         this->m_featureSource = NULL;

Modified: sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.cpp	2014-05-30 15:31:40 UTC (rev 8177)
+++ sandbox/jng/tiling/Common/MdfParser/IOTileStoreParameters.cpp	2014-06-02 20:34:20 UTC (rev 8178)
@@ -72,9 +72,9 @@
         int val = wstrToInt(ch);
         this->m_params->SetTileHeight(val);
     }
-    else if (this->m_currElemName == L"ImageFormat") // NOXLATE
+    else if (this->m_currElemName == L"Format") // NOXLATE
     {
-        this->m_params->SetImageFormat(ch);
+        this->m_params->SetFormat(ch);
     }
 }
 
@@ -109,10 +109,10 @@
     fd << IntToStr(params->GetTileHeight());
     fd << endStr("TileHeight") << std::endl; //NOXLATE
 
-    // Property: ImageFormat
-    fd << tab.tab() << startStr("ImageFormat"); //NOXLATE
-    fd << EncodeString(params->GetTileProvider());
-    fd << endStr("ImageFormat") << std::endl; //NOXLATE
+    // Property: Format
+    fd << tab.tab() << startStr("Format"); //NOXLATE
+    fd << EncodeString(params->GetFormat());
+    fd << endStr("Format") << std::endl; //NOXLATE
 
     // Property: Parameters
     for (int i=0; i<params->GetParameters()->GetCount(); ++i)

Modified: sandbox/jng/tiling/Common/MdfParser/SAX2Parser.cpp
===================================================================
--- sandbox/jng/tiling/Common/MdfParser/SAX2Parser.cpp	2014-05-30 15:31:40 UTC (rev 8177)
+++ sandbox/jng/tiling/Common/MdfParser/SAX2Parser.cpp	2014-06-02 20:34:20 UTC (rev 8178)
@@ -680,6 +680,17 @@
             m_handlerStack->push(IO);
             IO->StartElement(str.c_str(), m_handlerStack);
         }
+        else if (str == L"TileSetDefinition") // NOXLATE
+        {
+            // set the version
+            SetTileSetDefinitionVersion(attributes);
+
+            _ASSERT(m_map == NULL); // otherwise we leak
+            m_tileset = new TileSetDefinition(L"");
+            IOTileSetDefinition* IO = new IOTileSetDefinition(m_tileset, m_version);
+            m_handlerStack->push(IO);
+            IO->StartElement(str.c_str(), m_handlerStack);
+        }
     }
     // Otherwise, if the stack has items on it, just pass the event through.
     else

Modified: sandbox/jng/tiling/Common/Schema/MapDefinition-3.0.0.xsd
===================================================================
--- sandbox/jng/tiling/Common/Schema/MapDefinition-3.0.0.xsd	2014-05-30 15:31:40 UTC (rev 8177)
+++ sandbox/jng/tiling/Common/Schema/MapDefinition-3.0.0.xsd	2014-06-02 20:34:20 UTC (rev 8178)
@@ -253,7 +253,7 @@
     <xs:complexType>
       <xs:complexContent>
         <xs:extension base="MapDefinitionType">
-          <xs:attribute name="version" type="xs:string" use="required" fixed="2.4.0"/>
+          <xs:attribute name="version" type="xs:string" use="required" fixed="3.0.0"/>
         </xs:extension>
       </xs:complexContent>
     </xs:complexType>

Modified: sandbox/jng/tiling/Common/Schema/TileSetDefinition-3.0.0.xsd
===================================================================
--- sandbox/jng/tiling/Common/Schema/TileSetDefinition-3.0.0.xsd	2014-05-30 15:31:40 UTC (rev 8177)
+++ sandbox/jng/tiling/Common/Schema/TileSetDefinition-3.0.0.xsd	2014-06-02 20:34:20 UTC (rev 8178)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
-  <xs:element name="TileSetDefinition" minOccurs="0">
+  <xs:include schemaLocation="PlatformCommon-1.0.0.xsd"/>
+  <xs:element name="TileSetDefinition">
     <xs:annotation>
       <xs:documentation>Defines a tile cache</xs:documentation>
     </xs:annotation>
@@ -54,9 +55,9 @@
           <xs:documentation>The height of tile images in this tile cache</xs:documentation>
         </xs:annotation>
       </xs:element>
-      <xs:element name="ImageFormat" type="xs:string">
+      <xs:element name="Format" type="xs:string">
         <xs:annotation>
-          <xs:documentation>The image format of tile images in this tile cache</xs:documentation>
+          <xs:documentation>The format of tiles in this tile cache</xs:documentation>
         </xs:annotation>
       </xs:element>
       <xs:element name="Parameter" type="NameValuePairType" minOccurs="0" maxOccurs="unbounded">



More information about the mapguide-commits mailing list