[mapserver-dev] Performance issue with hatching with a pattern of a polygon

Lime, Steve D (MNIT) Steve.Lime at state.mn.us
Mon Nov 14 12:59:48 PST 2016


An isolated test case would be helpful I think. I don't recall if Thomas significantly refactored handling the HATCH symbol style from the original GD version or not - I suspect so.

-----Original Message-----
From: mapserver-dev [mailto:mapserver-dev-bounces at lists.osgeo.org] On Behalf Of Stephen Woodbridge
Sent: Saturday, November 12, 2016 2:48 PM
To: mapserver-dev <mapserver-dev at lists.osgeo.org>
Subject: [mapserver-dev] Performance issue with hatching with a pattern of a polygon

Hi Devs,

I have a serious performance problem that I'm trying to run down. The 
layer definition is below. It appears to be related to HATCHing with a 
PATTERN of a polygon.

I have narrowed down a test case down to one layer and one class at 
1:1963 scale that takes 300+ secs to render.

$ /usr/local/bin/mapserv -v
MapServer version 6.4.3 OUTPUT=PNG OUTPUT=JPEG SUPPORTS=PROJ 
SUPPORTS=AGG SUPPORTS=FREETYPE SUPPORTS=CAIRO SUPPORTS=SVG_SYMBOLS 
SUPPORTS=SVGCAIRO SUPPORTS=ICONV SUPPORTS=FRIBIDI SUPPORTS=WMS_SERVER 
SUPPORTS=WMS_CLIENT SUPPORTS=WFS_SERVER SUPPORTS=WCS_SERVER 
SUPPORTS=FASTCGI SUPPORTS=GEOS INPUT=JPEG INPUT=POSTGIS INPUT=OGR 
INPUT=GDAL INPUT=SHAPEFILE

$ /usr/local/bin/mapserv -nh 
QUERY_STRING='MAP=./test.map&FORMAT=image%2Fpng&MAP_IMAGETYPE=agg_qn&LAYERS=Australia&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=12813560.707781,-2467980.3837369,12814292.234029,-2467467.4196173&WIDTH=1225&HEIGHT=859' 
 > junk.png
CGI Request 1 on process 14401
msDrawMap(): rendering using outputformat named agg_qn (AGG/PNG).
msDrawMap(): WMS/WFS set-up and query, 0.000s
msDrawMap(): Layer 0 (flats), 314.227s
msDrawLabelCache(): labelcache_map_edge_buffer = 20
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 314.234s
msSaveImage(stdout) total time: 0.094s
mapserv request processing time (msLoadMap not incl.): 314.341s
msFreeMap(): freeing map at 0x10dade0.
freeLayer(): freeing layer at 0x10e78e0.

The LAYER definition is:

   LAYER
     NAME "flats"
     GROUP "Hydrography"
     STATUS ON
     DEBUG 5
     TYPE POLYGON
     DATA "topo-250k/Vector_data/Hydrography/flats"
     PROJECTION "init=epsg:4283" END
     MAXSCALEDENOM 250000
     CLASSITEM "SYMBOL"
     CLASS
       EXPRESSION "23"
       STYLE
         SYMBOL "hatch"
         COLOR "#00cfe6"
         ANGLE 45
         PATTERN 1 2 END
         WIDTH 1
         SIZE 3
       END
     END
   END

If I comment out the PATTERN line it runs like this:

$ /usr/local/bin/mapserv -nh 
QUERY_STRING='MAP=./test.map&FORMAT=image%2Fpng&MAP_IMAGETYPE=agg_qn&LAYERS=Australia&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&SRS=EPSG%3A900913&BBOX=12813560.707781,-2467980.3837369,12814292.234029,-2467467.4196173&WIDTH=1225&HEIGHT=859' 
 > junk.png
CGI Request 1 on process 15462
msDrawMap(): rendering using outputformat named agg_qn (AGG/PNG).
msDrawMap(): WMS/WFS set-up and query, 0.000s
msDrawMap(): Layer 0 (flats), 0.063s
msDrawLabelCache(): labelcache_map_edge_buffer = 20
msDrawMap(): Drawing Label Cache, 0.000s
msDrawMap() total time: 0.070s
msSaveImage(stdout) total time: 0.094s
mapserv request processing time (msLoadMap not incl.): 0.177s
msFreeMap(): freeing map at 0xd9ade0.
freeLayer(): freeing layer at 0xda78e0.

And changing the pattern to 'PATTERN 2 2 END' cuts the time in about half:
msDrawMap(): Layer 0 (flats), 164.830s

So it looks like it has to do with the loop that renders the pattern 
while hatching. I found this issue because I am generating dot patterns 
as fills. I could generate images for the fill pattern, but I needed a 
large combination of colors and densities and hatching with a pattern 
fills the need nicely allowing me to vary the density, size of dot and 
color by varying the PATTERN, COLOR, WIDTH, and SIZE parameters.

I can put together a tarball with the shapefile and mapfile and create a 
ticket for this issue if that helps. I have not tried to create a 
FEATURE based object that will replicate this but I suspect that would 
be possible also.

Thoughts?
-Steve W

---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

_______________________________________________
mapserver-dev mailing list
mapserver-dev at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapserver-dev


More information about the mapserver-dev mailing list