Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
aperi2007 opened this issue Jun 18, 2014 · 1 comment
Closed
Assignees

Comments

@aperi2007
Copy link

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
Copy link
Author

It work perfectly.
Thx for resolve it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants