In the mapscript.styleObj the pattern property don't work correctly #4943

Closed
aperi2007 opened this Issue Jun 18, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@aperi2007

I try
new_style = mapscript.styleObj()
si = testmap.getLayer(li).getClass(ci).insertStyle(new_style)
new_style.patternlength = 2
new_style.pattern = [2.0,2.0,0,0,0,0,0,0,0,0]

But it return an error:
new_style.pattern = [2.0,2.0,0,0,0,0,0,0,0,0]
File "/usr/lib/python2.7/dist-packages/mapscript.py", line 539, in
setattr = lambda self, name, value: _swig_setattr(self, styleObj, name, value)
File "/usr/lib/python2.7/dist-packages/mapscript.py", line 49, in _swig_setattr
return _swig_setattr_nondynamic(self,class_type,name,value,0)
File "/usr/lib/python2.7/dist-packages/mapscript.py", line 42, in _swig_setattr_nondynamic
if method: return method(self,value)
TypeError: in method 'styleObj_pattern_set', argument 2 of type 'double [MS_MAXPATTERNLENGTH]'

Instead if I try this other:

new_style.pattern_setpattern = [2.0,2.0,0,0,0,0,0,0,0,0]

I have no error but the results are wrong.

    PATTERN
     0.00 103009734106140943985641494373501206230179702584902942964236102170001354319245005187375454749201540084120924883519115137443744715539126962043151378461007560169620342613506541918802818544130417943354682889457077318721786538368063230294953392928194560.00
    END # PATTERN

If I try the
new_style.pattern_setpattern = [2.0,2.0,0,0,0,0,0,0,0,0]
In a loop to generate several styles, I have the first as reported and the next as this

    PATTERN
     0.00 0.00
    END # PATTERN


    PATTERN
     0.00 0.00
    END # PATTERN

styleObj

@aperi2007

This comment has been minimized.

Show comment
Hide comment
@aperi2007

aperi2007 Jul 30, 2014

It work perfectly.
Thx for resolve it

It work perfectly.
Thx for resolve it

@aperi2007 aperi2007 closed this Jul 30, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment