[mapserver-users] Question about python mapscript and point style.

Vladimir fl_v at inbox.ru
Fri Nov 15 09:12:34 PST 2019


Hi all!
 
I unsuccessfully try to style ‘Point’ layer with following code:
(first)
    style = mapscript.styleObj(classObj)
    style.symbolname = 'circle'
    style.size = 10
    style.color = mapscript.colorObj(255, 0, 0)
 
No error, no picture as result of using this method.
But similar approach works for ‘Line’ and ‘Polygon’ layers.
 
Also I figured out working method for the ‘Point’ layer:
(second)
classObj.updateFromString("CLASS STYLE COLOR 255 0 0 SIZE 10  SYMBOL 'circle' END END")
 
O utput of ‘layer.convertToString()’ is the same  for both methods :
LAYER
    CONNECTION \"dbname='db' host='db' user='user' password='1'\"
    CONNECTIONTYPE POSTGIS  
    DATA \"value FROM (SELECT 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
 
How to get working ‘Point’ style using first method?
MapServer version: 7.2.1
 
Thanks!
--
Regards, Vladimir.
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20191115/71789587/attachment.html>


More information about the mapserver-users mailing list