[mapserver-users] Style pattern on mapscript

Andrea Peri aperi2007 at gmail.com
Tue Jun 17 13:45:52 PDT 2014


Hi,
after a series of test.
I see have other results.

If I try this code:

stile_foreground_pattern = [2.0,2.0,0,0,0,0,0,0,0,0]
new_style_outline = mapscript.styleObj()
si_out = clone_map.getLayer(li).getClass(ci).insertStyle(new_style_outline)
new_style_outline.pattern_setpattern = stile_foreground_pattern

I have no more errors,
in the result mapfile I see this strange values:

      STYLE
        ...
        PATTERN
         0.00 2041524053898372829105438909070180893926486567071343916138357144016524314351965530501262036567330524547902312663713063313261806543852765632899638683857957263751105564370908781021860582220975721899444780855326898548375552.00
0.00 6854801439634025855391127625890100406876631812783080735666199931350519470255902184785399986446578170451457898491980267130023230797520694255864597982809160058908956218984721043947520.00
0.00 287518202601265833730730069100431187621112779631488281448375674568404082577951570612674362235701754122300884071233209506589955361651766833820669162787389384425472.00
30944669757275424126339545903734763894116227894805443878742086082466476235858342946304559530226217509781530113779517168662084903626578639370820577853863996571907439324247683030476016083363920120570447553914102874418548202597863030452590329870165530775816264220672.00
4507122338036623852768173995278107764889351550666277409967302425748542228121180975398912.00
17511052788837734276393773805385477806378250314801500293873396685632502488442313426446667676123136.00
        END # PATTERN
        ....
      END # STYLE

I don't understand why this result.

Any thought ?

Thx for any help.


2014-06-17 17:15 GMT+02:00 Andrea Peri <aperi2007 at gmail.com>:
> Hi umberto,
> thx for response.
>
> If I try to do a
> help(mapscript.styleObject)
>
> I can see in the list of availables:
> a pattern and a patternlength attributes.
>
> So I wrongly guess they are available.
>
>> Actually it is not hard to do it, just provide a getPattern/setPattern
>> index-based function
>> in mapscript/swiginc/style.i
>> and, of course, rebuild mapscript. You could use the get/setBinding
>> functions as a starting point and I could help you, if you want.
>
> thx for your help.
>
> Andrea
>
> 2014-06-17 17:02 GMT+02:00 Umberto Nicoletti <umberto.nicoletti at gmail.com>:
>> Andrea,
>> it seems we never got around to properly wrap styleObj.pattern in mapscript.
>>
>> Actually it is not hard to do it, just provide a getPattern/setPattern
>> index-based function
>> in mapscript/swiginc/style.i
>> and, of course, rebuild mapscript. You could use the get/setBinding
>> functions as a starting point and I could help you, if you want.
>>
>> /Umberto
>>
>>
>>
>> On Tue, Jun 17, 2014 at 3:53 PM, Andrea Peri <aperi2007 at gmail.com> wrote:
>>>
>>> Hi,
>>>
>>> it seem to exist,
>>> but every sintax I try , I'm have an error.
>>> like this:
>>>
>>> new_style.pattern = [1.0, 2.0]
>>>
>>> >Traceback (most recent call last):
>>> >  File "generator.py", line 136, in <module>
>>> >    new_style.pattern = [1.0, 2.0]
>>> >  File
>>> > "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li
>>> >ne 538, in <lambda>
>>> >    __setattr__ = lambda self, name, value: _swig_setattr(self, styleObj,
>>> > name,
>>> >value)
>>> >  File
>>> > "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li
>>> >ne 48, in _swig_setattr
>>> >    return _swig_setattr_nondynamic(self,class_type,name,value,0)
>>> >  File
>>> > "C:\my-programs\osgeo4w\apps\Python27\lib\site-packages\mapscript.py", li
>>> >ne 41, in _swig_setattr_nondynamic
>>> >    if method: return method(self,value)
>>> >TypeError: in method 'styleObj_pattern_set', argument 2 of type 'double
>>> > [MS_MAXP
>>> >ATTERNLENGTH]'
>>>
>>> I don't understand if is a bug or a my wrong on python use ff pattern.
>>>
>>> Unfortunately it seem not documentated at all.
>>>
>>> any help is welcome, thx.
>>>
>>> Andrea.
>>>
>>>
>>> 2014-06-17 11:42 GMT+02:00 Andrea Peri <aperi2007 at gmail.com>:
>>> > Hi,
>>> >
>>> > Is available the style pattern in mapscript ?
>>> >
>>> > Thx,
>>> >
>>> > --
>>> > -----------------
>>> > Andrea Peri
>>> > . . . . . . . . .
>>> > qwerty àèìòù
>>> > -----------------
>>>
>>>
>>>
>>> --
>>> -----------------
>>> Andrea Peri
>>> . . . . . . . . .
>>> qwerty àèìòù
>>> -----------------
>>> _______________________________________________
>>> mapserver-users mailing list
>>> mapserver-users at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>
>>
>
>
>
> --
> -----------------
> Andrea Peri
> . . . . . . . . .
> qwerty àèìòù
> -----------------



-- 
-----------------
Andrea Peri
. . . . . . . . .
qwerty àèìòù
-----------------



More information about the MapServer-users mailing list