[mapserver-users] Issues with Python Mapscript
forums
forums at craniumjuice.com
Tue Jul 15 11:31:10 PDT 2014
Hi Guys:
I'm having issues with the Python implementation of mapscript. It appears
some support is missing.
I'm using mapserver 6.4.1-2 on Arch Linux.
python2 -V 2.7.8
mapscript.MS_VERSION = 6.4.1
1) Transparency not preserved with m.draw() on a mapObj()
Individual Layer tansparency using m.draw() when inside a style object:
mStyle = ms.styleObject()
mStyle.opacity = 50
If I do:
m.save('tmp.map')
And load the resulting map with the mapserver CGI it works fine, the layer
is at whatever transparency I set.
Map file:
...
CLASS
STYLE
COLOR 255 255 255
OPACITY 50
OUTLINECOLOR 0 0 0
END # STYLE
END # CLASS
...
2) Setting labelObj().type seems to have no effect.
labelObj.type = ms.MS_TRUETYPE
labelObj.type = ms.MS_BITMAP
labelObj.type = 0
labelObj.type = 1
The resulting map definition file has:
..
TYPE BITMAP
..
3) Setting labelObj().size seems to have no effect.
the mapfile has no 'SIZE' attribute when printed out. I do end up with a
SHADOWSIZE, which I'm guessing is default, or has to do with the BITMAP
type that's being forced.
4) I can't seem to set a pattern. It looks like mapscript.py includes the
functionality, but it's giving an error. Traceback from when my code hands
it off:
...
mStyle.pattern = "5 5 5 5"
File "/usr/lib/python2.7/site-packages/mapscript.py", line 535, in
<lambda>
__setattr__ = lambda self, name, value: _swig_setattr(self, styleObj,
name, value)
File "/usr/lib/python2.7/site-packages/mapscript.py", line 51, in
_swig_setattr
return _swig_setattr_nondynamic(self,class_type,name,value,0)
File "/usr/lib/python2.7/site-packages/mapscript.py", line 44, in
_swig_setattr_nondynamic
if method: return method(self,value)
TypeError: in method 'styleObj_pattern_set', argument 2 of type 'double
[MS_MAXPATTERNLENGTH]'
...
Am I doing something wrong, or are these issues with the library/Python
implementation?
Thank you.
--
A computer without Windows is like chocolate cake without mustard.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20140715/64d36a0a/attachment.htm>
More information about the MapServer-users
mailing list