1

Software details: CentOS 7, Python 3.6, MapServer v 7.2.1 is compiled from source.

I use Python MapScript to build WMS, it works well for styling Lines and Polygons, but not for Points.

For example, the Line code:

style = mapscript.styleObj(classObj)
style.width = 10
style.color = mapscript.colorObj(255, 0, 0)

or the Polygon code:

style = mapscript.styleObj(classObj)
style.outlinewidth = 10
style.outlinecolor = mapscript.colorObj(255, 0, 0)

draws features as expected, while the Point code:

style = mapscript.styleObj(classObj)
style.symbolname = 'circle'
style.size = 10
style.color = mapscript.colorObj(255, 0, 0)

draws nothing.

Here is output of layer.convertToString() for Point layer. It looks like valid mapfile section:

LAYER
    CONNECTION \"dbname='db' host='db' user='user' password='1'\"
    CONNECTIONTYPE POSTGIS  
    DATA \"value FROM (SELECT name, value FROM points WHERE ST_Intersects(value, !BOX!)) AS subquery USING UNIQUE id USING srid = 3857\"
    LABELITEM \"name\"
    NAME \"points\"
    STATUS ON
    TYPE POINT
    UNITS METERS
    CLASS
    NAME \"points\"
    STYLE
        COLOR 255 0 0
        SIZE 10
        SYMBOL \"circle\"
    END # STYLE
    END # CLASS
END # LAYER

The 'circle' symbol is defined in symbolset. There are no errors in log files. I can't figure out what is wrong. Does anyone have such experience?

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.