[Fwd: Re: [UMN_MAPSERVER-USERS] CLASS and php/mapscript]

Pietro Giannini pgiannini at BYTEWISE.IT
Mon Oct 30 11:35:00 EST 2006


Bug #1951 submitted.

___________________________
      Pietro Giannini
  Bytewise srl - Area GIS
41°50'38.58"N 12°29'13.39"E


On Lun, 30 Ottobre 2006 16:21, Stephen Woodbridge disse:
> Please write a bug against this for mapscript.
>
> It might end up being a doc bug but setting the color -1,-1,-1 means to
> make the object transparent. For example you would use this for the
> color of a polygon to make it transparent and then could set the border
> to black to highlight the edge of the polygon with out over writing the
> actual polygon.
>
> -Steve W
>
> Pietro Giannini wrote:
>> Sorry for previous incomplete message
>>
>> Luca,
>> I discovered that when tou set
>>      $style->color->setRGB( -1,-1,-1);
>> nothing appears,
>> instead if you set
>>      $style->color->setRGB(0,0,0);
>> works!
>>
>> Evidently MS does not consider a valid color the RGB( -1,-1,-1), only a
>> mapfile annotation, and does not save it when invoking $map->save().
>>
>> ciao
>>
>> PG
>>
>> ___________________________
>>       Pietro Giannini
>>   Bytewise srl - Area GIS
>> 41°50'38.58"N 12°29'13.39"E
>>
>>
>> On Lun, 30 Ottobre 2006 13:10, Luca Casagrande disse:
>>> Hi Pietro and thx for your answer!
>>> This is the code i use for creating the new class:
>>>
>>>         $class = ms_newClassObj($layer);
>>> 	$class->setExpression("'[pixel]' EQ '1'");
>>>         $style = ms_newStyleObj($class);
>>>         $style=$class->getStyle(0);
>>>         $style->color->setRGB( -1,-1,-1);
>>>
>>> And this is the debug mapfile:
>>>
>>> CLASS
>>>       EXPRESSION "'[pixel]' EQ '1'"
>>>       METADATA
>>>       END
>>>       STYLE
>>>         ANGLE 360
>>>         SYMBOL 0
>>>       END
>>>     END
>>>
>>> What i am doing wrong?
>>>
>>> Thanks
>>> Luca
>>>
>>> On Mon, 30 Oct 2006 12:53:42 +0100
>>> Pietro Giannini <pgiannini at BYTEWISE.IT> wrote:
>>>
>>>> Luca,
>>>> I had a similar problem.
>>>>
>>>> Try:
>>>>
>>>>    ....
>>>>    $style=$class->getStyle(0);
>>>>    $style->color->setRGB( -1,-1,-1);
>>>>
>>>> In other words you must get the reference of the existing Style from
>> the Class.
>>>> I made so, and works... - I don't know because :) -
>>>>
>>>> ciao
>>>>
>>>> ___________________________
>>>>       Pietro Giannini
>>>>   Bytewise srl - Area GIS
>>>> 41°50'38.58"N 12°29'13.39"E
>>>>
>>>>
>>>>
>>>>
>>>> On Lun, 30 Ottobre 2006 12:03, Luca Casagrande disse:
>>>>> Hi to all!
>>>>> I am trying to create a new layer using php/mapscript; the problem is
>>>> for
>>>>> the class section:
>>>>> this is the mapfile sample i'd like to crete:
>>>>>
>>>>> CLASS
>>>>>     EXPRESSION "1"
>>>>>     STYLE
>>>>>       COLOR -1 -1 -1
>>>>>     END
>>>>>    END
>>>>>
>>>>> And this is the mapscript i have written:
>>>>>
>>>>>         $class = ms_newClassObj($layer);
>>>>> 	$class->setExpression("'[pixel]' EQ '1'");
>>>>>
>>>>> 	$style = ms_newStyleObj($class);
>>>>>         $style->color->setRGB( -1,-1,-1);
>>>>>
>>>>> Debugging the mapfile, the CLASS it's been created, but not the style
>>>> of
>>>>> the class.
>>>>>
>>>>> Thanks very much
>>>>> Luca
>>>>> --
>>>>> Help QGIS development! Make a donation right now at
>>>>> http://xrl.us/supportqgis
>>>>>
>>>>> LINUX User #411601
>>>>> GENTOO-GIS Development Team
>>>>> jabber: casagrande at jabber.linux.it
>>>>>
>>>>>
>>>>>
>>>
>>> --
>>> Help QGIS development! Make a donation right now at
>>> http://xrl.us/supportqgis
>>>
>>> LINUX User #411601
>>> GENTOO-GIS Development Team
>>> jabber: casagrande at jabber.linux.it
>>>
>>>
>>>
>>
>>
>>
>>
>>
>> ___________________________
>>       Pietro Giannini
>>   Bytewise srl - Area GIS
>> 41°50'38.58"N 12°29'13.39"E
>
>



More information about the mapserver-users mailing list