Opened 17 years ago

Last modified 14 years ago

#2291 new enhancement

[SLD] SYMBOLSCALE should be reset when applyin an SLD

Reported by: assefa Owned by: assefa
Priority: normal Milestone: 6.0 release
Component: WMS Server Version: unspecified
Severity: normal Keywords:
Cc: bartvde

Description

when Mapserver applies an SLD to a LAYER, it does not remove SYMBOLSCALE from the LAYER, which results in line widths etc. which do not correspond exactly to the SLD line widths.

Is this intentional? Should it not remove SYMBOLSCALE when applying an SLD?

Change History (6)

comment:1 by assefa, 17 years ago

Owner: changed from mapserverbugs to assefa

comment:2 by assefa, 15 years ago

Milestone: 5.6 release6.0 release

comment:3 by bartvde, 14 years ago

I've also been running into this. Currently the symbols don't scale anyway since MINSIZE and MAXSIZE are not set.

Since it is currently impossible without vendor specific stuff to do symbol scaling in SLD, I really need this functionality, since my selections are done using SLD and I need them to scale just like the source layer. However, I can imagine other situations where people want to do stuff exactly according to the SLD spec so 10 pixels is 10 pixels.

comment:4 by assefa, 14 years ago

Should the layer after the sld is applied reset always the scaledenom to -1? Is that what a the wms provider would expect? What about other similar parameters such as min/maxscaledenom , labelmin/maxscaledenom, mingeowidth, maxgeowidth

comment:5 by assefa, 14 years ago

Cc: bartvde added

comment:6 by bartvde, 14 years ago

This is the change I did for my use case (against 5.2 sources):

--- mapogcsld.c 2009-12-16 13:33:34.000000000 +0100
+++ mapogcsld.c 2009-12-16 13:34:51.000000000 +0100
@@ -1107,6 +1107,10 @@
                     {
                         psStyle->size =
                           atoi(psCssParam->psChild->psNext->pszValue);
+                        if (psStyle->size > 0) {
+                          psStyle->minsize = psStyle->size;
+                          psStyle->maxsize = psStyle->size;
+                        }

                         /* use an ellipse symbol for the width */
                         if (psStyle->symbol <=0)
@@ -1421,8 +1423,13 @@
         {
             /* extract symbol size */
             psSize = CPLGetXMLNode(psGraphic, "Size");
-            if (psSize && psSize->psChild && psSize->psChild->pszValue)
+            if (psSize && psSize->psChild && psSize->psChild->pszValue) {
               psStyle->size = atoi(psSize->psChild->pszValue);
+              if (psStyle->size > 0) {
+                psStyle->minsize = psStyle->size;
+                psStyle->maxsize = psStyle->size;
+              }
+            }
             else
               psStyle->size = 6; /* defualt value */
}}}}
Note: See TracTickets for help on using tickets.