[mapguide-commits] r4404 - in trunk/MgDev: Common/PlatformBase/Services Server/src/Services/Feature

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Wed Dec 9 16:38:54 EST 2009


Author: brucedechant
Date: 2009-12-09 16:38:53 -0500 (Wed, 09 Dec 2009)
New Revision: 4404

Modified:
   trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp
   trunk/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp
   trunk/MgDev/Server/src/Services/Feature/TransformCache.cpp
Log:
Fix for trac ticket 600 - WMS - coordinate system overriding fails
http://trac.osgeo.org/mapguide/ticket/600

Notes:
- Some of the changes required for this fix were addressed with the fix for ticket 1091
- Added missing serialization/deserialization of the spatial context Name


Modified: trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp
===================================================================
--- trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp	2009-12-09 21:13:53 UTC (rev 4403)
+++ trunk/MgDev/Common/PlatformBase/Services/RasterPropertyDefinition.cpp	2009-12-09 21:38:53 UTC (rev 4404)
@@ -154,6 +154,7 @@
     stream->WriteInt32(m_sizeX);
     stream->WriteInt32(m_sizeY);
     stream->WriteString(m_serializedXml);
+    stream->WriteString(m_associatedSCName);
 }
 
 void MgRasterPropertyDefinition::Deserialize(MgStream* stream)
@@ -164,6 +165,7 @@
     stream->GetInt32(m_sizeX);
     stream->GetInt32(m_sizeY);
     stream->GetString(m_serializedXml);
+    stream->GetString(m_associatedSCName);
 }
 
 void MgRasterPropertyDefinition::Initialize()
@@ -172,6 +174,7 @@
     m_nullable = false;
     m_sizeX = 0;
     m_sizeY = 0;
+    m_serializedXml = L"";
     m_associatedSCName = L"";
 }
 

Modified: trunk/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp	2009-12-09 21:13:53 UTC (rev 4403)
+++ trunk/MgDev/Server/src/Services/Feature/JoinFeatureReader.cpp	2009-12-09 21:38:53 UTC (rev 4404)
@@ -959,7 +959,7 @@
     fdoPropDef->SetHasMeasure(hasMeasure);
 
     fdoPropDef->SetReadOnly(isReadOnly);
-    if(spatialContextName.empty())
+    if(!spatialContextName.empty())
     {
         fdoPropDef->SetSpatialContextAssociation((FdoString*)spatialContextName.c_str());
     }
@@ -989,6 +989,7 @@
     bool isNullable = mgPropDef->GetNullable();
     STRING qname = mgPropDef->GetQualifiedName();
     bool isReadOnly = mgPropDef->GetReadOnly();
+    STRING spatialContextName = mgPropDef->GetSpatialContextAssociation();
 
     //Set it for Fdo
     if (!desc.empty())
@@ -1002,6 +1003,11 @@
 
     //Cannot set qualified name in fdo
     fdoPropDef->SetReadOnly(isReadOnly);
+    if(!spatialContextName.empty())
+    {
+        fdoPropDef->SetSpatialContextAssociation((FdoString*)spatialContextName.c_str());
+    }
+
     MG_FEATURE_SERVICE_CATCH_AND_THROW(L"MgJoinFeatureReader.GetRasterPropertyDefinition")
 
     return fdoPropDef.Detach();

Modified: trunk/MgDev/Server/src/Services/Feature/TransformCache.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Feature/TransformCache.cpp	2009-12-09 21:13:53 UTC (rev 4403)
+++ trunk/MgDev/Server/src/Services/Feature/TransformCache.cpp	2009-12-09 21:38:53 UTC (rev 4404)
@@ -95,7 +95,7 @@
     Ptr<MgClassDefinition> classDef = svcFeature->GetClassDefinition(resId, schemaName, className, false);
     Ptr<MgPropertyDefinitionCollection> propDefCol = classDef->GetProperties();
 
-    // Find the spatial context for the geometric property. Use the first one if there are many defined.
+    // Find the spatial context for the geometric or raster property. Use the first one if there are many defined.
     for(int index=0;index<propDefCol->GetCount();index++)
     {
         Ptr<MgPropertyDefinition> propDef = propDefCol->GetItem(index);
@@ -106,6 +106,14 @@
             spatialContextAssociation = geomProp->GetSpatialContextAssociation();
             break;
         }
+        else if(propDef->GetPropertyType () == MgFeaturePropertyType::RasterProperty)
+        {
+            // We found the raster property
+            MgRasterPropertyDefinition* rasterProp = static_cast<MgRasterPropertyDefinition*>(propDef.p);
+            spatialContextAssociation = rasterProp->GetSpatialContextAssociation();
+            break;
+        }
+
     }
 
     // We want all of the spatial contexts



More information about the mapguide-commits mailing list