[mapguide-commits] r5770 - in trunk/Tools/Maestro: Maestro Maestro.Editors/FeatureSource/Providers/Gdal OSGeo.MapGuide.MaestroAPI/ObjectModels OSGeo.MapGuide.MaestroAPI/SchemaOverrides

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Tue May 10 09:04:16 EDT 2011


Author: jng
Date: 2011-05-10 06:04:16 -0700 (Tue, 10 May 2011)
New Revision: 5770

Modified:
   trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.cs
   trunk/Tools/Maestro/Maestro/changelog.txt
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/Envelope.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalConfigurationDocument.cs
   trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalRasterItem.cs
Log:
#1679: Add APIs to GdalConfigurationDocument to return a calculated combined extent. Note that if any of the raster images within contains the default FDO extent the calculated result will become this extent because it is very unlikely that any extent will exceed the default FDO extent. When rebuilding the configuration document, this API is invoked.


Modified: trunk/Tools/Maestro/Maestro/changelog.txt
===================================================================
--- trunk/Tools/Maestro/Maestro/changelog.txt	2011-05-10 12:18:08 UTC (rev 5769)
+++ trunk/Tools/Maestro/Maestro/changelog.txt	2011-05-10 13:04:16 UTC (rev 5770)
@@ -3,6 +3,12 @@
 
  - This is the first release with a public SDK and samples demonstrating using the Maestro API.
  - Fix: Map Definition resource id field in a WebLayout 1.1.0 editor does not update when changed.
+ - Fix: DWF Load Procedure not settings sheet extents.
+ - Fix: Exception when opening drawing sources.
+ - Fix: Exception when deserializing configuration documents with non-english characters.
+ - Fix: Overall extent of GDAL configuraton document not being the computed aggregate of all raster images when rebuilding.
+ - Add an API to control RuntimeMapLayer draw order.
+ - Extend the IMappingService API to support rendering map legend images.
  - Added a tip of the day dialog that is shown on startup (this can be turned off)
 
 3.0 Final

Modified: trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.cs
===================================================================
--- trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.cs	2011-05-10 12:18:08 UTC (rev 5769)
+++ trunk/Tools/Maestro/Maestro.Editors/FeatureSource/Providers/Gdal/CompositeFileCtrl.cs	2011-05-10 13:04:16 UTC (rev 5770)
@@ -320,6 +320,11 @@
                 worker.ReportProgress(progress, string.Format(Properties.Resources.ProcessedItem, add));
             }
 
+            //Re-calculate combined extent for spatial context
+            var env = conf.CalculateExtent();
+            if (env != null)
+                conf.SpatialContexts[0].Extent = env;
+
             return result;
         }
 

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/Envelope.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/Envelope.cs	2011-05-10 12:18:08 UTC (rev 5769)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/ObjectModels/Envelope.cs	2011-05-10 13:04:16 UTC (rev 5770)
@@ -95,6 +95,8 @@
         public static void ExpandToInclude(this IEnvelope env, IEnvelope e1)
         {
             Check.NotNull(env, "env");
+            if (e1 == null)
+                return;
 
             if (e1.MinX < env.MinX)
                 env.MinX = e1.MinX;

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalConfigurationDocument.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalConfigurationDocument.cs	2011-05-10 12:18:08 UTC (rev 5769)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalConfigurationDocument.cs	2011-05-10 13:04:16 UTC (rev 5770)
@@ -21,6 +21,7 @@
 using System.Collections.Generic;
 using System.Text;
 using System.Xml;
+using OSGeo.MapGuide.ObjectModels.Common;
 
 namespace OSGeo.MapGuide.MaestroAPI.SchemaOverrides
 {
@@ -42,6 +43,23 @@
             return _items.Remove(item.Location);
         }
 
+        /// <summary>
+        /// Calculates the combined extent that encompasses all the raster images in this document.
+        /// </summary>
+        /// <returns></returns>
+        public IEnvelope CalculateExtent()
+        {
+            IEnvelope env = null;
+            foreach (var loc in _items.Values)
+            {
+                if (env == null)
+                    env = loc.CalculateExtents();
+                else
+                    env.ExpandToInclude(loc.CalculateExtents());
+            }
+            return env;
+        }
+
         public GdalRasterLocationItem AddLocation(string directory)
         {
             if (_items.ContainsKey(directory))

Modified: trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalRasterItem.cs
===================================================================
--- trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalRasterItem.cs	2011-05-10 12:18:08 UTC (rev 5769)
+++ trunk/Tools/Maestro/OSGeo.MapGuide.MaestroAPI/SchemaOverrides/GdalRasterItem.cs	2011-05-10 13:04:16 UTC (rev 5770)
@@ -22,6 +22,8 @@
 using System.Text;
 using OSGeo.MapGuide.MaestroAPI.Schema;
 using System.IO;
+using OSGeo.MapGuide.ObjectModels.Common;
+using OSGeo.MapGuide.ObjectModels;
 
 namespace OSGeo.MapGuide.MaestroAPI.SchemaOverrides
 {
@@ -29,6 +31,8 @@
     {
         private Dictionary<string, GdalRasterItem> _items = new Dictionary<string, GdalRasterItem>();
 
+        private IEnvelope _extents;
+
         public string Location { get; set; }
 
         public void AddItem(GdalRasterItem item) 
@@ -39,6 +43,23 @@
                 _items[item.FileName] = item;
         }
 
+        /// <summary>
+        /// Calculates the combined extents of all the raster images in this specified location
+        /// </summary>
+        /// <returns>null if there are no raster images. Otherwise returns the combined extent</returns>
+        public IEnvelope CalculateExtents()
+        {
+            IEnvelope env = null;
+            foreach (var item in _items.Values)
+            {
+                if (env == null)
+                    env = ObjectFactory.CreateEnvelope(item.MinX, item.MinY, item.MaxX, item.MaxY);
+                else
+                    env.ExpandToInclude(ObjectFactory.CreateEnvelope(item.MinX, item.MinY, item.MaxX, item.MaxY));
+            }
+            return env;
+        }
+
         public void RemoveItem(GdalRasterItem item) 
         { 
             _items.Remove(item.FileName); 



More information about the mapguide-commits mailing list