[mapserver-users] (no subject)

Sushrut Shivaswamy sushrut.shivaswamy at gmail.com
Mon Jan 16 06:18:55 PST 2017


Hey Sergio,

The definition of mapObject - > applySLD() in the map server documentation
is as follows.

*int applySLD(string sldxml)*
*Apply the SLD document to the map file. *
*The matching between the sld document and the map file will be done using
the layer’s name.*
*See SLD HowTo for more information on the SLD support.*

Assuming that your SLD document is applied to every layer in the mapfile I
see two potential areas for bottle necks to appear.

Since the mapping between SLD and layer is based on the layer name, what
could be happening is that for every NamedLayer occurence
in your SLD,  mapserver must be iterating over all the layers in the map
file to see which layer name matches the name in the SLD.
For 76 occurences( as stated by you) *this would become an order n-squared
complexity search.*
*Unless mapserver has an internal hash-table like structure to associate a
layerName with layerObj which I doubt, this would take a lot of time*
*and request processing times would scale on n-squared basis where n is the
the number of NamedLayerOccurences.*

The actual styling of a layer based on SLD shouldn't increase the time all
that much.

Could you try applying the SLD on a lyer basis instead of for the whole map.

If you have reference to the actual layerObj you could just call layerObj -
> applySLD().

This should cut down the time involved in searching through the entire map
file for a LAYER reference with matching layer name.

Regards,
Sushrut Shivaswamy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170116/dc055c7d/attachment.html>


More information about the mapserver-users mailing list