[mapserver-users] cartographic lines

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Tue Jun 9 00:06:09 EDT 2009


Hi,

Thomas Bonfort seems to do it this way:
 CLASS
        EXPRESSION "primary"
        STYLE
            WIDTH 14
            OUTLINECOLOR "#B7AC9A"
            OUTLINEWIDTH 1
            MINWIDTH 1.5
            MAXWIDTH 12
        END
        STYLE
            WIDTH 14
            COLOR "#FFFF7A"
            MINWIDTH 1.5
            MAXWIDTH 12
        END
   END

See more at http://trac.osgeo.org/mapserver/wiki/RenderingOsmData, and the result is visible at Mapserver.org web site.

-Jukka Rahkonen-


David Nugent wrote.

Hello all,

i've come across a cosmetic issue I'm trying to solve and looking for  
advice. Specifically this relates to drawing street/road lines, although I  
guess it relates to any type of cartographic line.

I'm using mapserver 5.4.1 using AGG renderer with quantize enabled:

   OUTPUTFORMAT
     NAME            'AGG_Q'
     DRIVER          AGG/PNG
     IMAGEMODE       RGB
   # FORMATOPTION    "QUANTIZE_FORCE=ON"
     FORMATOPTION    "QUANTIZE_NEW=ON"
     FORMATOPTION    "QUANTIZE_DITHER=OFF"
     FORMATOPTION    "QUANTIZE_COLORS=256"
   END

Mapserver was built with --with-experimental-png (which does indeed  
resolve the colour variations between tiles that I reported earlier).

I'm drawing street layers with elipses, but I'm now wondering if that is  
the best way to achieve the result, being an inner colour with a border,  
viz:

   STYLE
     COLOR  [border_color]
     SYMBOL "road_line"
     SIZE   $x
   END
   STYLE
     COLOR  [surface_colour]
     SYMBOL "road_line"
     SIZE   $x-2
   END

where road_line is a simple SYMBOL elipse.

The problem I'm seeing is two-fold.

Firstly, the ends are rounded, which is not desirable where roads of  
different classes (defined in different layers) join. I think this can be  
solved by drawing all streets in the same layer and using different  
classes with EXPRESSION statements, but my brief experiment with this  
resulted in a large detriment effect on rendering speed. If it matters,  
the layers are in PostGIS (and appropriately indexed).

So my question is, is there a better or at least an alternative way of  
drawing roads with borders which does not result in this problem?

The second problem is that I'm trying to add OPACITY to some layers, such  
as tunnels, so that they either appear underneath other objects or at  
least allow other objects to show through. However - and it may be related  
to the use of symbols to draw the roads - this results rendering as shown  
in the attached file, with elipses of a different shade appearing where  
objects "intersect". Can this be avoided (perhaps by using a different  
method for drawing road lines)?

Note that since I am rendering a flat tile which includes a background I'm  
using RGB rather than RGBA and I suspect this may affect rendering of  
OPACITY in layers. However I can't seem to find the magic that will render  
a background colour other than black (and yes, I'm using IMAGECOLOR in the  
MAP section, but it seems to have no effect when rendering with  
transparency).

Best regards,
David




More information about the mapserver-users mailing list