[mapguide-commits] r5136 - in sandbox/adsk/2.2gp:
Common/MapGuideCommon/System Common/Stylization
Server/src/Core Server/src/Services/Rendering
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Fri Sep 17 02:26:58 EDT 2010
Author: liuar
Date: 2010-09-17 06:26:58 +0000 (Fri, 17 Sep 2010)
New Revision: 5136
Modified:
sandbox/adsk/2.2gp/Common/MapGuideCommon/System/ConfigProperties.cpp
sandbox/adsk/2.2gp/Common/MapGuideCommon/System/ConfigProperties.h
sandbox/adsk/2.2gp/Common/Stylization/RasterAdapter.cpp
sandbox/adsk/2.2gp/Common/Stylization/Renderer.h
sandbox/adsk/2.2gp/Common/Stylization/SE_Renderer.cpp
sandbox/adsk/2.2gp/Common/Stylization/SE_Renderer.h
sandbox/adsk/2.2gp/Server/src/Core/serverconfig.ini
sandbox/adsk/2.2gp/Server/src/Services/Rendering/ServerRenderingService.cpp
sandbox/adsk/2.2gp/Server/src/Services/Rendering/ServerRenderingService.h
Log:
Port to 2.2gp branch.
Ticket #1438
WMS or Raster - Request image with size > 2047 pixel results map with poor image quality.
Make the max width and height be configurable via serverconfig.ini.
Modified: sandbox/adsk/2.2gp/Common/MapGuideCommon/System/ConfigProperties.cpp
===================================================================
--- sandbox/adsk/2.2gp/Common/MapGuideCommon/System/ConfigProperties.cpp 2010-09-17 03:00:48 UTC (rev 5135)
+++ sandbox/adsk/2.2gp/Common/MapGuideCommon/System/ConfigProperties.cpp 2010-09-17 06:26:58 UTC (rev 5136)
@@ -301,6 +301,10 @@
const bool MgConfigProperties::DefaultRenderingServicePropertyClampPoints = false;
const STRING MgConfigProperties::RenderingServicePropertyGeneralizeData = L"GeneralizeData";
const bool MgConfigProperties::DefaultRenderingServicePropertyGeneralizeData = false;
+const STRING MgConfigProperties::RenderingServicePropertyMaxRasterImageWidth = L"MaxRasterImageWidth";
+const INT32 MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageWidth = 2048;
+const STRING MgConfigProperties::RenderingServicePropertyMaxRasterImageHeight = L"MaxRasterImageHeight";
+const INT32 MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageHeight = 2048;
// ******************************************************************
// Font Alias Mappings section
@@ -620,7 +624,9 @@
{ MgConfigProperties::RenderingServicePropertyRasterGridSizeForPlot , MgPropertyType::Int32 , 1 , MG_CONFIG_MAX_INT32 , L"" },
{ MgConfigProperties::RenderingServicePropertyMinRasterGridSizeForPlot , MgPropertyType::Int32 , 1 , MG_CONFIG_MAX_INT32 , L"" },
{ MgConfigProperties::RenderingServicePropertyRasterGridSizeOverrideRatioForPlot, MgPropertyType::Double , 0.0 , 1.0 , L"" },
- { MgConfigProperties::RenderingServicePropertyRenderSelectionBatchSize , MgPropertyType::Int32 , MG_CONFIG_MIN_RENDER_SELECTION_SIZE , MG_CONFIG_MAX_RENDER_SELECTION_SIZE , L"" },
+ { MgConfigProperties::RenderingServicePropertyRenderSelectionBatchSize , MgPropertyType::Int32 , MG_CONFIG_MIN_RENDER_SELECTION_SIZE , MG_CONFIG_MAX_RENDER_SELECTION_SIZE , L"" },
+ { MgConfigProperties::RenderingServicePropertyMaxRasterImageWidth , MgPropertyType::Int32 , 1 , MG_CONFIG_MAX_INT32 , L"" },
+ { MgConfigProperties::RenderingServicePropertyMaxRasterImageHeight , MgPropertyType::Int32 , 1 , MG_CONFIG_MAX_INT32 , L"" },
{ L"" , 0 , 0.0 , 0.0 , L"" }
};
Modified: sandbox/adsk/2.2gp/Common/MapGuideCommon/System/ConfigProperties.h
===================================================================
--- sandbox/adsk/2.2gp/Common/MapGuideCommon/System/ConfigProperties.h 2010-09-17 03:00:48 UTC (rev 5135)
+++ sandbox/adsk/2.2gp/Common/MapGuideCommon/System/ConfigProperties.h 2010-09-17 06:26:58 UTC (rev 5136)
@@ -381,6 +381,15 @@
static const STRING RenderingServicePropertyGeneralizeData; /// value("GeneralizeData")
static const bool DefaultRenderingServicePropertyGeneralizeData; /// value(false)
+ /// Sets the max width for raster image
+ static const STRING MgConfigProperties::RenderingServicePropertyMaxRasterImageWidth; /// value("MaxRasterImageWidth")
+ static const INT32 MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageWidth; /// value(2048)
+
+ /// Sets the max height for raster image
+ static const STRING MgConfigProperties::RenderingServicePropertyMaxRasterImageHeight; /// value("MaxRasterImageHeight")
+ static const INT32 MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageHeight; /// value(2048)
+
+
/// FONT ALIASES SECTION -----------------------------------------------------------------------------
/// font alias mappings
Modified: sandbox/adsk/2.2gp/Common/Stylization/RasterAdapter.cpp
===================================================================
--- sandbox/adsk/2.2gp/Common/Stylization/RasterAdapter.cpp 2010-09-17 03:00:48 UTC (rev 5135)
+++ sandbox/adsk/2.2gp/Common/Stylization/RasterAdapter.cpp 2010-09-17 06:26:58 UTC (rev 5136)
@@ -99,7 +99,7 @@
int devW = (int)(mapExt.width() * pixelsPerMapUnit);
int devH = (int)(mapExt.height() * pixelsPerMapUnit);
- while (imgW >= 2048 || imgH >= 2048)
+ while (imgW >= renderer->GetMaxRasterImageWidth() || imgH >= renderer->GetMaxRasterImageHeight())
{
imgW >>= 1;
imgH >>= 1;
Modified: sandbox/adsk/2.2gp/Common/Stylization/Renderer.h
===================================================================
--- sandbox/adsk/2.2gp/Common/Stylization/Renderer.h 2010-09-17 03:00:48 UTC (rev 5135)
+++ sandbox/adsk/2.2gp/Common/Stylization/Renderer.h 2010-09-17 06:26:58 UTC (rev 5136)
@@ -219,6 +219,14 @@
virtual double GetRasterGridSizeOverrideRatio() = 0;
virtual void SetRasterGridSizeOverrideRatio(double ratio) = 0;
+ // gets/sets the max width for raster image
+ virtual double GetMaxRasterImageWidth() = 0;
+ virtual void SetMaxRasterImageWidth(int width) = 0;
+
+ // gets/sets the max height for raster image
+ virtual double GetMaxRasterImageHeight() = 0;
+ virtual void SetMaxRasterImageHeight(int height) = 0;
+
// flags whether the renderer processes tooltip expressions
virtual bool SupportsTooltips() = 0;
Modified: sandbox/adsk/2.2gp/Common/Stylization/SE_Renderer.cpp
===================================================================
--- sandbox/adsk/2.2gp/Common/Stylization/SE_Renderer.cpp 2010-09-17 03:00:48 UTC (rev 5135)
+++ sandbox/adsk/2.2gp/Common/Stylization/SE_Renderer.cpp 2010-09-17 06:26:58 UTC (rev 5136)
@@ -85,8 +85,31 @@
m_rasterGridSizeOverrideRatio = ratio;
}
+///////////////////////////////////////////////////////////////////////////////
+double SE_Renderer::GetMaxRasterImageWidth()
+{
+ return m_maxRasterImageWidth;
+}
///////////////////////////////////////////////////////////////////////////////
+void SE_Renderer::SetMaxRasterImageWidth(int width)
+{
+ m_maxRasterImageWidth = width;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+double SE_Renderer::GetMaxRasterImageHeight()
+{
+ return m_maxRasterImageHeight;
+}
+
+///////////////////////////////////////////////////////////////////////////////
+void SE_Renderer::SetMaxRasterImageHeight(int height)
+{
+ m_maxRasterImageHeight = height;
+}
+
+///////////////////////////////////////////////////////////////////////////////
bool SE_Renderer::SupportsTooltips()
{
// by default, set the renderer to process tooltip expressions
Modified: sandbox/adsk/2.2gp/Common/Stylization/SE_Renderer.h
===================================================================
--- sandbox/adsk/2.2gp/Common/Stylization/SE_Renderer.h 2010-09-17 03:00:48 UTC (rev 5135)
+++ sandbox/adsk/2.2gp/Common/Stylization/SE_Renderer.h 2010-09-17 06:26:58 UTC (rev 5136)
@@ -46,6 +46,12 @@
STYLIZATION_API virtual double GetRasterGridSizeOverrideRatio();
STYLIZATION_API virtual void SetRasterGridSizeOverrideRatio(double ratio);
+ STYLIZATION_API virtual double GetMaxRasterImageWidth();
+ STYLIZATION_API virtual void SetMaxRasterImageWidth(int width);
+
+ STYLIZATION_API virtual double GetMaxRasterImageHeight();
+ STYLIZATION_API virtual void SetMaxRasterImageHeight(int height);
+
STYLIZATION_API virtual bool SupportsTooltips();
STYLIZATION_API virtual bool SupportsHyperlinks();
@@ -142,6 +148,8 @@
int m_rasterGridSize;
int m_minRasterGridSize;
double m_rasterGridSizeOverrideRatio;
+ int m_maxRasterImageWidth;
+ int m_maxRasterImageHeight;
private:
RS_F_Point m_lastSymbolExtent[4];
Modified: sandbox/adsk/2.2gp/Server/src/Core/serverconfig.ini
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Core/serverconfig.ini 2010-09-17 03:00:48 UTC (rev 5135)
+++ sandbox/adsk/2.2gp/Server/src/Core/serverconfig.ini 2010-09-17 06:26:58 UTC (rev 5136)
@@ -325,6 +325,10 @@
# GeneralizeData Specifies whether feature geometry is generalized
# before being rendered (experimental)
# 0 = false and 1 = true
+# MaxRasterImageWidth The max width of raster image in pixels
+# 0 < Value <= 2147483647
+# MaxRasterImageHeight The max height of raster image in pixels
+# 0 < Value <= 2147483647
# *****************************************************************************
TileExtentOffset = 0.35
RasterGridSize = 100
@@ -336,6 +340,8 @@
RenderSelectionBatchSize = 50000
ClampPoints = 0
GeneralizeData = 0
+MaxRasterImageWidth = 2048
+MaxRasterImageHeight = 2048
[ResourceServiceProperties]
# *****************************************************************************
Modified: sandbox/adsk/2.2gp/Server/src/Services/Rendering/ServerRenderingService.cpp
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Services/Rendering/ServerRenderingService.cpp 2010-09-17 03:00:48 UTC (rev 5135)
+++ sandbox/adsk/2.2gp/Server/src/Services/Rendering/ServerRenderingService.cpp 2010-09-17 06:26:58 UTC (rev 5136)
@@ -100,6 +100,16 @@
m_renderSelectionBatchSize,
MgConfigProperties::DefaultRenderingServicePropertyRenderSelectionBatchSize);
+ pConf->GetIntValue(MgConfigProperties::RenderingServicePropertiesSection,
+ MgConfigProperties::RenderingServicePropertyMaxRasterImageWidth,
+ m_maxRasterImageWidth,
+ MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageWidth);
+
+ pConf->GetIntValue(MgConfigProperties::RenderingServicePropertiesSection,
+ MgConfigProperties::RenderingServicePropertyMaxRasterImageHeight,
+ m_maxRasterImageHeight,
+ MgConfigProperties::DefaultRenderingServicePropertyMaxRasterImageHeight);
+
// there should only be one instance of this class, so it's safe to
// directly set these static variables
bool bClampPoints;
@@ -1482,6 +1492,8 @@
renderer->SetRasterGridSize(m_rasterGridSize);
renderer->SetMinRasterGridSize(m_minRasterGridSize);
renderer->SetRasterGridSizeOverrideRatio(m_rasterGridSizeOverrideRatio);
+ renderer->SetMaxRasterImageWidth(m_maxRasterImageWidth);
+ renderer->SetMaxRasterImageHeight(m_maxRasterImageHeight);
}
return renderer;
Modified: sandbox/adsk/2.2gp/Server/src/Services/Rendering/ServerRenderingService.h
===================================================================
--- sandbox/adsk/2.2gp/Server/src/Services/Rendering/ServerRenderingService.h 2010-09-17 03:00:48 UTC (rev 5135)
+++ sandbox/adsk/2.2gp/Server/src/Services/Rendering/ServerRenderingService.h 2010-09-17 06:26:58 UTC (rev 5136)
@@ -217,6 +217,8 @@
INT32 m_minRasterGridSize;
double m_rasterGridSizeOverrideRatio;
INT32 m_renderSelectionBatchSize;
+ INT32 m_maxRasterImageWidth;
+ INT32 m_maxRasterImageHeight;
};
#endif
More information about the mapguide-commits
mailing list