[mapguide-commits] r9836 - in trunk/MgDev: Common/MapGuideCommon/System Server/src/Core Server/src/Services/Mapping cmake/configs

svn_mapguide at osgeo.org svn_mapguide at osgeo.org
Mon Apr 12 06:04:00 PDT 2021


Author: jng
Date: 2021-04-12 06:04:00 -0700 (Mon, 12 Apr 2021)
New Revision: 9836

Modified:
   trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
   trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
   trunk/MgDev/Server/src/Core/serverconfig.ini
   trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
   trunk/MgDev/cmake/configs/serverconfig.ini.in
Log:
Make the global raster stylization lock toggle-able through a serverconfig.ini setting (GlobalRasterStylizationLockEnabled). The default value for this setting is still true, so the global lock is still in effect.

Fixes #2830

Modified: trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp	2021-04-12 12:20:00 UTC (rev 9835)
+++ trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.cpp	2021-04-12 13:04:00 UTC (rev 9836)
@@ -322,6 +322,8 @@
 const INT32  MgConfigProperties::DefaultRenderingServicePropertyMaxRenderImageWidth         = 16384;
 const STRING MgConfigProperties::RenderingServicePropertyMaxRenderImageHeight               = L"MaxRenderImageHeight";
 const INT32  MgConfigProperties::DefaultRenderingServicePropertyMaxRenderImageHeight        = 16384;
+const STRING MgConfigProperties::RenderingServicePropertiesGlobalRasterStylizationLockEnabled = L"GlobalRasterStylizationLockEnabled";
+const bool   MgConfigProperties::DefaultRenderingServicePropertiesGlobalRasterStylizationLockEnabled = true;
 
 // ******************************************************************
 // Font Alias Mappings section

Modified: trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h
===================================================================
--- trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h	2021-04-12 12:20:00 UTC (rev 9835)
+++ trunk/MgDev/Common/MapGuideCommon/System/ConfigProperties.h	2021-04-12 13:04:00 UTC (rev 9836)
@@ -425,6 +425,10 @@
     static const STRING RenderingServicePropertyMaxRenderImageHeight;           /// value("MaxRenderImageHeight")
     static const INT32 DefaultRenderingServicePropertyMaxRenderImageHeight;     /// value(16384)
 
+    /// Sets the global raster stylization lock option
+    static const STRING RenderingServicePropertiesGlobalRasterStylizationLockEnabled;       /// value("GlobalRasterStylizationLockEnabled")
+    static const bool DefaultRenderingServicePropertiesGlobalRasterStylizationLockEnabled;  /// value(true)
+
     /// FONT ALIASES SECTION -----------------------------------------------------------------------------
 
     /// font alias mappings

Modified: trunk/MgDev/Server/src/Core/serverconfig.ini
===================================================================
--- trunk/MgDev/Server/src/Core/serverconfig.ini	2021-04-12 12:20:00 UTC (rev 9835)
+++ trunk/MgDev/Server/src/Core/serverconfig.ini	2021-04-12 13:04:00 UTC (rev 9836)
@@ -361,6 +361,8 @@
 #                                       0 < Value <= 2147483647
 # MaxRenderImageHeight             The minimum allowed width for a map image rendering operation
 #                                       0 < Value <= 2147483647
+# GlobalRasterStylizationLockEnabled Enable/disable the use of a global lock for raster stylization
+#                                       0 = false and 1 = true
 # *****************************************************************************
 TileExtentOffset                   = 0.35
 RasterGridSize                     = 100
@@ -376,6 +378,7 @@
 MaxRasterImageHeight               = 2048
 MaxRenderImageWidth                = 16384
 MaxRenderImageHeight               = 16384
+GlobalRasterStylizationLockEnabled = 1
 
 [ResourceServiceProperties]
 # *****************************************************************************

Modified: trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp
===================================================================
--- trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp	2021-04-12 12:20:00 UTC (rev 9835)
+++ trunk/MgDev/Server/src/Services/Mapping/MappingUtil.cpp	2021-04-12 13:04:00 UTC (rev 9836)
@@ -377,6 +377,14 @@
     ACE_DEBUG((LM_INFO, L"(%t)StylizeLayers() **MAPSTART** Layers:%d  Scale:%f\n", layers->GetCount(), scale));
     #endif
 
+    // Check if we want to use global raster stylization lock from config
+    MgConfiguration* pConf = MgConfiguration::GetInstance();
+    bool bUseGlobalLock = true;
+    pConf->GetBoolValue(MgConfigProperties::RenderingServicePropertiesSection,
+        MgConfigProperties::RenderingServicePropertiesGlobalRasterStylizationLockEnabled,
+        bUseGlobalLock,
+        MgConfigProperties::DefaultRenderingServicePropertiesGlobalRasterStylizationLockEnabled);
+
     // Cache coordinate system transforms for the life of the
     // stylization operation.
     TransformCacheMap transformCache;
@@ -641,10 +649,15 @@
 
                     //get a transform from layer coord sys to map coord sys
                     TransformCache* item = NULL;
+                    if (bUseGlobalLock)
                     {
                         ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, sg_fdoRfpMutex));
                         item = TransformCache::GetLayerToMapTransform(transformCache, gl->GetFeatureName(), featResId, dstCs, csFactory, svcFeature, true);
                     }
+                    else 
+                    {
+                        item = TransformCache::GetLayerToMapTransform(transformCache, gl->GetFeatureName(), featResId, dstCs, csFactory, svcFeature, true);
+                    }
                     TCForProfile = item;
 
                     Ptr<MgCoordinateSystem> layerCs = item? item->GetCoordSys() : NULL;
@@ -739,11 +752,17 @@
 
                     //perform the raster query
                     FdoPtr<FdoIFeatureReader> fdoReader;
+                    if (bUseGlobalLock)
                     {
                         ACE_MT(ACE_GUARD(ACE_Recursive_Thread_Mutex, ace_mon, sg_fdoRfpMutex));
                         rsReader = ExecuteRasterQuery(svcFeature, extent, gl, overrideFilter.c_str(), dstCs, layerCs, width, height);
                         fdoReader = (NULL == rsReader) ? NULL : rsReader->GetInternalReader();
                     }
+                    else
+                    {
+                        rsReader = ExecuteRasterQuery(svcFeature, extent, gl, overrideFilter.c_str(), dstCs, layerCs, width, height);
+                        fdoReader = (NULL == rsReader) ? NULL : rsReader->GetInternalReader();
+                    }
 
                     if (NULL != fdoReader.p)
                     {
@@ -1226,7 +1245,7 @@
     // draw the preview
     StylizationUtil::DrawStylePreview(imgWidth, imgHeight, themeCategory, fts, &er, &se_sman);
 
-    auto_ptr<RS_ByteData> data;
+    unique_ptr<RS_ByteData> data;
     data.reset(er.Save(format, imgWidth, imgHeight));
 
     if (NULL != data.get())

Modified: trunk/MgDev/cmake/configs/serverconfig.ini.in
===================================================================
--- trunk/MgDev/cmake/configs/serverconfig.ini.in	2021-04-12 12:20:00 UTC (rev 9835)
+++ trunk/MgDev/cmake/configs/serverconfig.ini.in	2021-04-12 13:04:00 UTC (rev 9836)
@@ -363,6 +363,8 @@
 #                                       0 < Value <= 2147483647
 # MaxRenderImageHeight             The minimum allowed width for a map image rendering operation
 #                                       0 < Value <= 2147483647
+# GlobalRasterStylizationLockEnabled Enable/disable the use of a global lock for raster stylization
+#                                       0 = false and 1 = true
 # *****************************************************************************
 TileExtentOffset                   = 0.35
 RasterGridSize                     = 100
@@ -378,6 +380,7 @@
 MaxRasterImageHeight               = 2048
 MaxRenderImageWidth                = 16384
 MaxRenderImageHeight               = 16384
+GlobalRasterStylizationLockEnabled = 1
 
 [ResourceServiceProperties]
 # *****************************************************************************



More information about the mapguide-commits mailing list