mapserver-bot · GitHub

Reporter: havatv
Date: 2011/05/18 - 12:38
Trac URL: http://trac.osgeo.org/mapserver/ticket/3879
Mapserver should have mechanisms that allow nice styling of dashed lines with point symbols. This is currently not possible with only the GAP parameter in combination with PATTERN. Current behaviour is to use half of the sum of the GAP length and the symbol size as the initial gap length.

From maprendering.c, in the function msImagePolylineMarkers(image,offsetLine,symbol,&s,-s.gap,1);

      double current_length = (spacing+symbol_width)/2.0; // initial padding for each line

A new parameter that specifies the initial gap has to be introduced in the STYLE element. A possible name for this parameter is "INITIALGAP". INITIALGAP should specify the distance from the start of the line to the point at which the symbol is to be drawn.

The OGC "Symbology Encoding Implementation Specification" (used for SLD) includes this mechanism and calls it

InitialGap
.

When INTITALGAP is available in the style, the change to the code to implement the mechanism in maprendering.c should be minimal. One could for instance add something like the following after the initialisation of current_length (shown in the code above):

if (style->initialgap != 0 {
double current_length = style->intialgap; // initial padding for each line
}

Read the original on github.com ↗