Performance issue on labeling

Julien-Samuel Lacroix jlacroix at DMSOLUTIONS.CA
Tue Jun 7 15:49:17 EDT 2005


Hi,

The reason mapserver outlining is slower is that the outline is made by 
drawing the label 8 more times. To do a good outline, mapserver have to 
draw the label in all 8 directions in the color of the outline and then 
draw the label in the good color at the right place. This gives a 
perfect 1 pixel outline.

Even if it seems inefficient, this is what is suggest on the freetype 
mailing-list.

In bug 1243, there's 3 patch to use the freetype outlining options. It 
use a development version of freetype, though. The official release does 
not include this functionality.

See the bug for more details.
http://mapserver.gis.umn.edu/bugs/show_bug.cgi?id=1243

Thanks
Julien


On 06/07/2005 04:26 AM, Erki Veersalu wrote:
> 
> Hi again,
> 
> I have made some more testing. I corrected my dataset, removed road 
> segments without label and joinded ones with the same label.
> If I map only road layer (2600 rows in DB) in defined place it's genereted:
>    without labels ->0,18 sec
>    with labels -> 0,54 sec
>    with outlined labels ->1,45 sec
> 
> Why takes outlined labeling 3 times more time than without outlines?
> Could there be anything wrong in my MapServer installation?
> 
> Thank you in advance,
> Erki Veersalu
>  
> 
> 
> On 6/6/05, Erki Veersalu <oraakel at gmail.com <mailto:oraakel at gmail.com>> 
> wrote:
>  > Dear MapServer users,
>  >
>  > I need help for improving speed of my web-application. I would really
>  > appreciate if someone could comment following issue.
>  > I'm using MapServer for displaying road network with labels over
>  > PostGis,Postgresql. Database is not that big, but making a GIF file of
>  > only roads (~200000 road segments) with angular true type labeling
>  > takes ~3 sec. If I don't use labeling it's 0,5 sec and with bitmap
>  > labels it's 0,6 sec
>  > Mapserver is running on Solaris 9.
>  >
>  > Why is labeling so slow? What can I do to speed up generation of an 
> image?
>  >
>  > mapserv -v
>  > MapServer version 4.4.1 OUTPUT=GIF OUTPUT=PNG OUTPUT=JPEG OUTPUT=WBMP
>  > SUPPORTS=PROJ SUPPORTS=FREETYPE SUPPORTS=WMS_SERVER INPUT=EPPL7
>  > INPUT=POSTGIS INPUT=OGR INPUT=GDAL INPUT=SHAPEFILE
>  >
>  > map file:
>  > MAP
>  >   NAME tuwa
>  >   STATUS ON
>  >   IMAGETYPE GIF
>  >   SIZE 400 300
>  >   EXTENT -876000 1330000 2230000 3650000
>  >   SHAPEPATH "/usr/local/apache2/htdocs/mapserver/tuwa/data/"
>  >   FONTSET 
> "/usr/local/apache2/htdocs/mapserver/tuwa/data/fonts/fonts.list"
>  >   UNITS METERS
>  >
>  >   WEB
>  >     IMAGEPATH "/usr/local/apache2/htdocs/mapserver/tmp/"
>  >     IMAGEURL "/mapserver/tmp/"
>  >   END
>  >
>  >   SCALEBAR
>  >     STATUS on
>  >     INTERVALS 4
>  >     SIZE 200 2
>  >     COLOR 0 0 0
>  >     OUTLINECOLOR 0 0 0
>  >     UNITS kilometers
>  >     LABEL
>  >       COLOR 0 0 0
>  >       SIZE small
>  >     END
>  >   END
>  >
>  >   LAYER
>  >     NAME A40
>  >     STATUS default
>  >     CONNECTIONTYPE postgis
>  >     CONNECTION "user=postgres dbname=tuwa"
>  >     DATA "the_geom from streets"
>  >     TYPE line
>  >     LABELITEM "name"
>  >     LABELMAXSCALE 45000
>  >     CLASS
>  >       SYMBOL 0
>  >       COLOR 150 150 150
>  >       MAXSCALE 50000
>  >       LABEL
>  >          TYPE TRUETYPE
>  >          FONT "arial"
>  >          SIZE 9
>  >          MINSIZE 8
>  >          MAXSIZE 10
>  >          FORCE FALSE
>  >          COLOR 0 0 0
>  >          OUTLINECOLOR 255 255 255
>  >          POSITION cc
>  >          ANGLE auto
>  >          ANTIALIAS TRUE
>  >          MINFEATURESIZE 3
>  >          MINDISTANCE 100
>  >          PARTIALS TRUE
>  >         END
>  >     END
>  >   END
>  > END
>  >
>  > Erki Veersalu
>  > Estonia
>  >

-- 
------------------------------------------------------------
Julien-Samuel Lacroix            jlacroix at dmsolutions.ca
DM Solutions Group               http://www.dmsolutions.ca/
------------------------------------------------------------



More information about the mapserver-users mailing list