[fdo-commits] r102 - branches/3.2.x/Providers/GDAL/Src/Provider

svn_fdo at osgeo.org svn_fdo at osgeo.org
Mon Mar 5 23:39:30 EST 2007


Author: warmerdam
Date: 2007-03-05 23:39:28 -0500 (Mon, 05 Mar 2007)
New Revision: 102

Modified:
   branches/3.2.x/Providers/GDAL/Src/Provider/FdoRfpClassData.cpp
Log:
capture dataset extents in spatial context (ticket #15)

Modified: branches/3.2.x/Providers/GDAL/Src/Provider/FdoRfpClassData.cpp
===================================================================
--- branches/3.2.x/Providers/GDAL/Src/Provider/FdoRfpClassData.cpp	2007-03-03 19:02:58 UTC (rev 101)
+++ branches/3.2.x/Providers/GDAL/Src/Provider/FdoRfpClassData.cpp	2007-03-06 04:39:28 UTC (rev 102)
@@ -169,14 +169,22 @@
         {
             // Retrieve the SC name
             scName = context->GetName();
-            FdoPtr<FdoByteArray> extentArr = context->GetExtent();
+            if( context->GetExtentType() == FdoSpatialContextExtentType_Dynamic )
+            {
+                FdoPtr<FdoByteArray> extentArr = context->GetExtent();
     		
-            // Calculate the new extent of the existing spatial context
-            FdoRfpRect extent = FdoRfpUtil::CreateRectFromGeometryAgf(extentArr);
-            extent = extent.Union(m_extent);
-
-            // Set the new extent
-            context->SetExtent(FdoRfpUtil::CreateGeometryAgfFromRect(extent));
+                // Calculate the new extent of the existing spatial context
+                FdoRfpRect extent = FdoRfpUtil::CreateRectFromGeometryAgf(extentArr);
+                extent = extent.Union(m_extent);
+                
+                // Set the new extent
+                context->SetExtent(FdoRfpUtil::CreateGeometryAgfFromRect(extent));
+            } 
+            else // if we just have the default static coordinate system, reset it.
+            {
+                context->SetExtentType(FdoSpatialContextExtentType_Dynamic);
+                context->SetExtent(FdoRfpUtil::CreateGeometryAgfFromRect(m_extent));
+            }
         }
         else // it's a new coordinate system
         {



More information about the fdo-commits mailing list