[mapguide-commits] r10232 - in branches/4.0/MgDev: Common/Stylization Portable/MgPortable/Services/Feature Server/src/Services/Feature Server/src/UnitTesting UnitTest/TestData/RasterStylization
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Sun Oct 25 02:29:00 PDT 2026
Author: jng
Date: 2026-10-25 02:28:58 -0700 (Sun, 25 Oct 2026)
New Revision: 10232
Modified:
branches/4.0/MgDev/Common/Stylization/DefaultStylizer.cpp
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionArgb.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionDecap.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureClass.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureId.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureSource.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionHtmlColor.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionIf.cpp
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionIf.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLayerDefinition.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLayerId.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLookup.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapCenterX.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapCenterY.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapName.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapScale.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionRange.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionSession.h
branches/4.0/MgDev/Common/Stylization/ExpressionFunctionUrlEncode.h
branches/4.0/MgDev/Common/Stylization/ExpressionHelper.cpp
branches/4.0/MgDev/Common/Stylization/GeometryAdapter.cpp
branches/4.0/MgDev/Common/Stylization/RasterAdapter.cpp
branches/4.0/MgDev/Common/Stylization/RasterAdapter.h
branches/4.0/MgDev/Common/Stylization/RichTextEngine.cpp
branches/4.0/MgDev/Common/Stylization/SE_ExpressionBase.h
branches/4.0/MgDev/Common/Stylization/Stylization.h
branches/4.0/MgDev/Common/Stylization/StylizationEngine.cpp
branches/4.0/MgDev/Common/Stylization/StylizationUtil.cpp
branches/4.0/MgDev/Portable/MgPortable/Services/Feature/GwsFeatureReader.cpp
branches/4.0/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
branches/4.0/MgDev/Server/src/UnitTesting/TestRasterStylization.cpp
branches/4.0/MgDev/Server/src/UnitTesting/TestStylization.cpp
branches/4.0/MgDev/UnitTest/TestData/RasterStylization/PROVENANCE.md
Log:
Treat MaxRasterImageWidth/Height as an upper bound in RasterAdapter
RasterAdapter::Stylize() halved the requested raster image until both dimensions
fell below MaxRasterImageWidth/MaxRasterImageHeight, comparing with ">=". Those
two settings are upper bounds, so an image that was exactly at the configured
size was halved as well, which made the effective limit half of what the
configuration says: with the default 2048x2048, a 2048-wide request came out at
1024.
Changes:
* Common/Stylization/RasterAdapter.cpp: move the halving loop into the new
ClampToMaxRasterImageSize() and compare with ">", so a dimension exactly at
the maximum is kept.
* Common/Stylization/RasterAdapter.h: declare it, with STYLIZATION_API - the
loop is now callable from outside MgStylization.dll, which is where the unit
test lives.
* Common/Stylization/Stylization.h: replace the three FdoExpressionEngine*
includes with forward declarations, so translation units that only use the
geometry adapters no longer need the FDO Expression Engine headers in their
include chain. The units that need the definitions include them directly:
DefaultStylizer.cpp, ExpressionFunctionIf.cpp, ExpressionHelper.cpp,
GeometryAdapter.cpp, RichTextEngine.cpp, StylizationEngine.cpp and
StylizationUtil.cpp (Fdo.h + FdoExpressionEngine.h, plus
FdoExpressionEngineFunctionCollection.h in ExpressionHelper.cpp),
SE_ExpressionBase.h (FdoExpressionEngine.h) and the 17 ExpressionFunction*.h
headers (FdoExpressionEngineINonAggregateFunction.h).
* Portable/MgPortable/Services/Feature/GwsFeatureReader.cpp and
Server/src/Services/Feature/ServerGwsFeatureReader.cpp: both call
FdoExpressionEngine::Create() and had the definition only through
Stylization.h; include FdoExpressionEngine.h directly, which is what keeps
MgPortable and the Feature Service compiling once the umbrella header no
longer supplies it.
* Server/src/UnitTesting/TestStylization.cpp: add the "Raster max image size"
case, covering dimensions at the maximum, over it, where one dimension is
already within the limit, and where one halving is enough.
* Server/src/UnitTesting/TestRasterStylization.cpp and
UnitTest/TestData/RasterStylization/PROVENANCE.md: the TrueMarble case no
longer reproduces the striped upsampling defect, now that it is fixed in the
provider (FDO r8422), so rename it "TrueMarble upsampled rendering" and
describe it as the regression test it has become. It still renders the
1350x675 tile at 4000x2000, across the provider's 4 MP scanline-tiling
threshold, and asserts that no output row is uniformly white.
Fixes #2174
Modified: branches/4.0/MgDev/Common/Stylization/DefaultStylizer.cpp
===================================================================
--- branches/4.0/MgDev/Common/Stylization/DefaultStylizer.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/DefaultStylizer.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -16,6 +16,8 @@
//
#include "stdafx.h"
+#include "Fdo.h"
+#include "FdoExpressionEngine.h"
#include "DefaultStylizer.h"
#include "GeometryAdapter.h"
#include "PolylineAdapter.h"
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionArgb.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionArgb.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionArgb.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_ARGB_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionArgb : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionDecap.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionDecap.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionDecap.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_DECAP_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionDecap : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureClass.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureClass.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureClass.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_FEATURECLASS_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionFeatureClass : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureId.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureId.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureId.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_FEATUREID_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
#include "KeyEncode.h"
class ExpressionFunctionFeatureId : public FdoExpressionEngineINonAggregateFunction
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureSource.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureSource.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionFeatureSource.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_FEATURESOURCE_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionFeatureSource : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionHtmlColor.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionHtmlColor.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionHtmlColor.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_HTMLCOLOR_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionHtmlColor : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionIf.cpp
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionIf.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionIf.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -16,6 +16,8 @@
//
#include "stdafx.h"
+#include "Fdo.h"
+#include "FdoExpressionEngine.h"
#include "ExpressionFunctionIf.h"
#include "ExpressionHelper.h"
#include "Foundation.h"
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionIf.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionIf.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionIf.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_IF_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionIf : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLayerDefinition.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLayerDefinition.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLayerDefinition.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_LAYERDEFINITION_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionLayerDefinition : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLayerId.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLayerId.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLayerId.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_LAYERID_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionLayerId : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLookup.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLookup.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionLookup.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_LOOKUP_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionLookup : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapCenterX.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapCenterX.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapCenterX.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_MAPCENTERX_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionMapCenterX : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapCenterY.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapCenterY.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapCenterY.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_MAPCENTERY_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionMapCenterY : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapName.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapName.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapName.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_MAPNAME_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionMapName : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapScale.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapScale.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionMapScale.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_MAPCENTERSCALE_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionMapScale : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionRange.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionRange.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionRange.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_RANGE_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionRange : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionSession.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionSession.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionSession.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -20,6 +20,7 @@
#define EXPRESSION_FUNCTION_SESSION_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionSession : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionFunctionUrlEncode.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionFunctionUrlEncode.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionFunctionUrlEncode.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#define EXPRESSION_FUNCTION_URLENCODE_H_
#include "Stylization.h"
+#include "FdoExpressionEngineINonAggregateFunction.h"
class ExpressionFunctionUrlEncode : public FdoExpressionEngineINonAggregateFunction
{
Modified: branches/4.0/MgDev/Common/Stylization/ExpressionHelper.cpp
===================================================================
--- branches/4.0/MgDev/Common/Stylization/ExpressionHelper.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/ExpressionHelper.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -16,6 +16,9 @@
//
#include "stdafx.h"
+#include "Fdo.h"
+#include "FdoExpressionEngine.h"
+#include "FdoExpressionEngineFunctionCollection.h"
#include "ExpressionHelper.h"
#include "ExpressionFunctionArgb.h"
#include "ExpressionFunctionDecap.h"
Modified: branches/4.0/MgDev/Common/Stylization/GeometryAdapter.cpp
===================================================================
--- branches/4.0/MgDev/Common/Stylization/GeometryAdapter.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/GeometryAdapter.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -16,6 +16,8 @@
//
#include "stdafx.h"
+#include "Fdo.h"
+#include "FdoExpressionEngine.h"
#include "Renderer.h"
#include "GeometryAdapter.h"
#include "SymbolVisitor.h"
Modified: branches/4.0/MgDev/Common/Stylization/RasterAdapter.cpp
===================================================================
--- branches/4.0/MgDev/Common/Stylization/RasterAdapter.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/RasterAdapter.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -34,6 +34,21 @@
{
}
+
+//////////////////////////////////////////////////////////////////////////////
+// Halves both dimensions until neither exceeds the configured maximum. A
+// dimension exactly at the maximum is kept: MaxRasterImageWidth/Height are an
+// upper bound.
+void RasterAdapter::ClampToMaxRasterImageSize(int& imgW, int& imgH, double maxW, double maxH)
+{
+ while (imgW > maxW || imgH > maxH)
+ {
+ imgW >>= 1;
+ imgH >>= 1;
+ }
+}
+
+
#define PRINT_RS_BOUNDS( ext ) \
//printf(" minx = %6.4f miny = %6.4f maxx = %6.4f maxy = %6.4f\n", ext.minx, ext.miny, ext.maxx, ext.maxy); \
//printf(" width = %6.4f height = %6.4f\n", ext.width(), ext.height());
@@ -99,11 +114,13 @@
int devW = (int)(mapExt.width() * pixelsPerMapUnit);
int devH = (int)(mapExt.height() * pixelsPerMapUnit);
- while (imgW >= renderer->GetMaxRasterImageWidth() || imgH >= renderer->GetMaxRasterImageHeight())
- {
- imgW >>= 1;
- imgH >>= 1;
- }
+ // MaxRasterImageWidth/Height are an upper bound, not a value to stay
+ // strictly below, so an image that is exactly the configured maximum is
+ // not halved. The old ">=" halved it too, which made the effective
+ // limit half of what the configuration says.
+ ClampToMaxRasterImageSize(imgW, imgH,
+ renderer->GetMaxRasterImageWidth(),
+ renderer->GetMaxRasterImageHeight());
#ifdef _DEBUG
//printf(" -------------------------\n");
Modified: branches/4.0/MgDev/Common/Stylization/RasterAdapter.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/RasterAdapter.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/RasterAdapter.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -41,6 +41,11 @@
RS_ElevationSettings* elevSettings = NULL,
CSysTransformer* layer2mapxformer = NULL);
+ /// Halves the requested image dimensions until neither exceeds the
+ /// configured maximum. The maximum is an upper bound, so a dimension that
+ /// is exactly at it is left alone.
+ STYLIZATION_API static void ClampToMaxRasterImageSize(int& imgW, int& imgH, double maxW, double maxH);
+
void DecodeRGBA(RS_InputStream* is, unsigned char* dst, int w, int h);
void DecodeRGB(RS_InputStream* is, unsigned char* dst, int w, int h);
void DecodeMapped(RS_InputStream* is, RS_InputStream* pal, unsigned char* dst, int w, int h);
Modified: branches/4.0/MgDev/Common/Stylization/RichTextEngine.cpp
===================================================================
--- branches/4.0/MgDev/Common/Stylization/RichTextEngine.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/RichTextEngine.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -16,6 +16,8 @@
//
#include "stdafx.h"
+#include "Fdo.h"
+#include "FdoExpressionEngine.h"
#include "RichTextEngine.h"
#include "SE_Renderer.h"
#include "RS_FontEngine.h"
Modified: branches/4.0/MgDev/Common/Stylization/SE_ExpressionBase.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/SE_ExpressionBase.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/SE_ExpressionBase.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -20,6 +20,7 @@
#include "Stylization.h"
#include "ExpressionHelper.h"
+#include "FdoExpressionEngine.h"
#include <map>
#include <string>
Modified: branches/4.0/MgDev/Common/Stylization/Stylization.h
===================================================================
--- branches/4.0/MgDev/Common/Stylization/Stylization.h 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/Stylization.h 2026-10-25 09:28:58 UTC (rev 10232)
@@ -85,12 +85,17 @@
#pragma warning(push)
#pragma warning(disable: 4201)
#include "Fdo.h"
-#include "FdoExpressionEngine.h"
-#include "FdoExpressionEngineFunctionCollection.h"
-#include "FdoExpressionEngineINonAggregateFunction.h"
#pragma warning(pop)
+// Forward declarations for the FDO expression engine types used by the
+// Stylization headers. Translation units that need the full definitions include
+// the ExpressionEngine headers directly; keeping them out of this umbrella
+// header means targets that only use the adapters do not need the
+// ExpressionEngine include directory.
+class FdoExpressionEngine;
+class FdoExpressionEngineFunctionCollection;
+
#ifndef __WFILE__
// Wide character version of __FILE__ macro
#define WIDEN2(x) L ## x
Modified: branches/4.0/MgDev/Common/Stylization/StylizationEngine.cpp
===================================================================
--- branches/4.0/MgDev/Common/Stylization/StylizationEngine.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/StylizationEngine.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -16,6 +16,8 @@
//
#include "stdafx.h"
+#include "Fdo.h"
+#include "FdoExpressionEngine.h"
#include "StylizationEngine.h"
#include "SE_BufferPool.h"
#include "SE_StyleVisitor.h"
Modified: branches/4.0/MgDev/Common/Stylization/StylizationUtil.cpp
===================================================================
--- branches/4.0/MgDev/Common/Stylization/StylizationUtil.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Common/Stylization/StylizationUtil.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -16,6 +16,8 @@
//
#include "stdafx.h"
+#include "Fdo.h"
+#include "FdoExpressionEngine.h"
#include "StylizationUtil.h"
#include "SE_Renderer.h"
#include "FeatureTypeStyleVisitor.h"
Modified: branches/4.0/MgDev/Portable/MgPortable/Services/Feature/GwsFeatureReader.cpp
===================================================================
--- branches/4.0/MgDev/Portable/MgPortable/Services/Feature/GwsFeatureReader.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Portable/MgPortable/Services/Feature/GwsFeatureReader.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -17,6 +17,7 @@
#include "FeatureDefs.h"
#include "Fdo.h"
+#include "FdoExpressionEngine.h"
#include "GwsFeatureReader.h"
#include "GwsQueryEngineImp.h"
#include "FeatureUtil.h"
Modified: branches/4.0/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp
===================================================================
--- branches/4.0/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Server/src/Services/Feature/ServerGwsFeatureReader.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,7 @@
#include "ServerGwsFeatureReader.h"
#include "ServerFeatureUtil.h"
#include "JoinFeatureReader.h"
+#include "FdoExpressionEngine.h"
//////////////////////////////////////////////////////////////////
///<summary>
Modified: branches/4.0/MgDev/Server/src/UnitTesting/TestRasterStylization.cpp
===================================================================
--- branches/4.0/MgDev/Server/src/UnitTesting/TestRasterStylization.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Server/src/UnitTesting/TestRasterStylization.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -714,10 +714,10 @@
}
}
-TEST_CASE("TrueMarble striped rendering", "[RasterStylization]")
+TEST_CASE("TrueMarble upsampled rendering", "[RasterStylization]")
{
- // Reproducer for the GDAL provider "striped" rendering defect, using a
- // single checked-in tile of the free "Global True Marble" dataset (see
+ // Regression test for the GDAL provider's "striped" rendering defect, using
+ // a single checked-in tile of the free "Global True Marble" dataset (see
// UnitTest/TestData/RasterStylization/PROVENANCE.md). The tile itself is a
// 4.5 MB GeoTIFF; the full dataset is ~70 GB, which is why only this one
// tile is checked in.
@@ -726,24 +726,26 @@
// 4000x2000, an upscale that crosses the provider's hard-coded 4 MP
// scanline-tiling threshold (FdoRfpBandRaster::GetDataModel). Above that
// threshold the provider reads one scanline per tile, and the per-row
- // source window in FdoRfpStreamReaderByTile::_getTile rounds to zero
- // height for some rows when upsampling. Those rows are never overwritten,
- // so they keep the tile's 0xFF prefill and survive the pipeline as whole
+ // source window in FdoRfpStreamReaderByTile::_getTile used to round to zero
+ // height for some rows when upsampling. Those rows were never overwritten,
+ // so they kept the tile's 0xFF prefill and survived the pipeline as whole
// rows of pure white: the stripes.
//
- // The defect is in the provider's output stream, so it can be detected
+ // The defect was in the provider's output stream, so it is detected
// objectively without a human looking at the render: real imagery never
// contains a full-width, exactly-white row. For this 4000x2000 upscale the
- // per-row source window rounds to zero height for a large fraction of the
- // output rows (653 of 2000 in the actual Release run), and GDAL treats a
+ // per-row source window rounded to zero height for a large fraction of the
+ // output rows (653 of 2000 in the run that found it), and GDAL treats a
// zero-height window as a no-op, leaving the 0xFF prefill. The PNG is
// still written to Results/ for visual confirmation.
// Raise the max raster image size so the 4000x2000 request is not halved by
- // RasterAdapter before it reaches the provider (the halving loop halves any
- // image >= MaxRasterImageWidth/Height). Each rendering service reads this
- // from configuration when it is constructed, so the guard is created before
- // the service and restores the values when it goes out of scope.
+ // RasterAdapter before it reaches the provider: the default is 2048x2048,
+ // and the 2000x1000 image that would result is below the 4 MP threshold, so
+ // the provider would never take the scanline-tiled path this case exists to
+ // cover. Each rendering service reads this from configuration when it is
+ // constructed, so the guard is created before the service and restores the
+ // values when it goes out of scope.
MaxRasterImageGuard rasterGuard;
Ptr<MgServerSiteService> svcSite = TestServiceFactory::CreateSiteService();
@@ -758,7 +760,7 @@
const int renderWidth = 4000;
const int renderHeight = 2000;
- const STRING name = L"TrueMarble_striped";
+ const STRING name = L"TrueMarble_upsampled";
STRING fsId = L"Library://RasterStylizationReal/Data/" + name + L".FeatureSource";
STRING layerId = L"Library://RasterStylizationReal/Layers/" + name + L".LayerDefinition";
STRING mapId = L"Library://RasterStylizationReal/Maps/" + name + L".MapDefinition";
@@ -841,8 +843,8 @@
INFO("rendered " << width << "x" << height << " with " << whiteRows
<< " uniformly white rows out of " << height);
// Real imagery never contains a full-width, exactly-white row. Allow a tiny
- // tolerance for safety; the defect produces on the order of a third of the
- // image height in white rows, so this fails hard while the bug is present.
+ // tolerance for safety; the defect produced on the order of a third of the
+ // image height in white rows, so this fails hard if it comes back.
CHECK(whiteRows <= height / 100);
// Release the pooled raster connection now, for the same reason as the
Modified: branches/4.0/MgDev/Server/src/UnitTesting/TestStylization.cpp
===================================================================
--- branches/4.0/MgDev/Server/src/UnitTesting/TestStylization.cpp 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/Server/src/UnitTesting/TestStylization.cpp 2026-10-25 09:28:58 UTC (rev 10232)
@@ -19,6 +19,8 @@
#include "Band.h"
#include "Bounds.h"
#include "Point2D.h"
+#include "Renderer.h"
+#include "RasterAdapter.h"
#include "RS_Raster.h"
#include "RS_InputStream.h"
#include "catch.hpp"
@@ -403,3 +405,47 @@
REQUIRE(44.9 < angle);
REQUIRE(45.1 > angle);
}
+
+TEST_CASE("Raster max image size", "[Stylization]")
+{
+ // MaxRasterImageWidth/Height is an upper bound: an image that is exactly
+ // the configured maximum is kept as is, and only larger images are halved.
+ // The old ">=" comparison halved an exactly-at-maximum image as well,
+ // which made the effective limit half of what the configuration says.
+ SECTION("dimensions exactly at the maximum are not halved")
+ {
+ int w = 4000;
+ int h = 2000;
+ RasterAdapter::ClampToMaxRasterImageSize(w, h, 4000, 2000);
+ CHECK(4000 == w);
+ CHECK(2000 == h);
+ }
+
+ SECTION("dimensions over the maximum are halved until they fit")
+ {
+ int w = 4001;
+ int h = 2001;
+ RasterAdapter::ClampToMaxRasterImageSize(w, h, 4000, 2000);
+ CHECK(2000 == w);
+ CHECK(1000 == h);
+ }
+
+ SECTION("both dimensions are halved together")
+ {
+ // h is already within the limit, but w is not, so both are halved.
+ int w = 8000;
+ int h = 100;
+ RasterAdapter::ClampToMaxRasterImageSize(w, h, 4000, 4000);
+ CHECK(4000 == w);
+ CHECK(50 == h);
+ }
+
+ SECTION("halving stops as soon as both dimensions are within the limit")
+ {
+ int w = 8000;
+ int h = 4000;
+ RasterAdapter::ClampToMaxRasterImageSize(w, h, 4000, 4000);
+ CHECK(4000 == w);
+ CHECK(2000 == h);
+ }
+}
Modified: branches/4.0/MgDev/UnitTest/TestData/RasterStylization/PROVENANCE.md
===================================================================
--- branches/4.0/MgDev/UnitTest/TestData/RasterStylization/PROVENANCE.md 2026-10-24 01:07:41 UTC (rev 10231)
+++ branches/4.0/MgDev/UnitTest/TestData/RasterStylization/PROVENANCE.md 2026-10-25 09:28:58 UTC (rev 10232)
@@ -330,10 +330,11 @@
This one is not derived from the FDO provider test data. It is a single tile of
"Global True Marble", the free reduced-resolution release of Unearthed
Outdoors' True Marble global colour imagery. It drives the `[RasterStylization]`
-"TrueMarble striped rendering" case, which reproduces the GDAL provider's
-striped upsampling defect: that case renders the 1350x675 tile at 4000x2000, an
-upscale that crosses the provider's 4 MP scanline-tiling threshold and leaves
-whole rows as the provider's 0xFF prefill.
+"TrueMarble upsampled rendering" case, which guards the GDAL provider's striped
+upsampling defect: that case renders the 1350x675 tile at 4000x2000, an upscale
+that crosses the provider's 4 MP scanline-tiling threshold, where output rows
+used to be left as the provider's 0xFF prefill. Fixed in FDO r8422, so the case
+is a regression test rather than a reproducer.
| Property | Value |
|----------|-------|
More information about the mapguide-commits
mailing list