[mapserver-users] CLUSTER - Average Value

Tamas Szekeres szekerest at gmail.com
Fri Mar 22 13:25:12 PDT 2013


For each feature only one class is selected at rendering time. For this
reason you should define the multiple classes for the circles of different
colours (and expressions) and then copy (duplicate) the label setting in
each class.

Best regards,

Tamas



2013/3/22 Mark Davidson <mark at 4each.co.uk>

> What in essence I would like to be able to do is set one CLASS with a
> style to make the clusters circles with labels. Then have additional
> classes that have expressions to set the colouring of the circles dependant
> on the average value. Does that make it clearer?
>
> On 22 March 2013 15:21, Tamas Szekeres <szekerest at gmail.com> wrote:
>
>> May be I misunderstood something, but the requirement of "style the
>> clusters a different colour depending on the calculation of that
>> expression" requires only one class per expression condition.
>>
>> Tamas
>>
>>
>>
>> 2013/3/22 thomas bonfort <thomas.bonfort at gmail.com>
>>
>>> Unless the cluster introduced some new codepaths in the rendering
>>> chain, I do not think this is the case. Only a *single* class gets
>>> used per rendered feature (the first one matching all expression and
>>> min/maxscale constraints)
>>>
>>> --
>>> thomas
>>>
>>> On 22 March 2013 14:59, Tamas Szekeres <szekerest at gmail.com> wrote:
>>> > I think adding multiple classes to the clustered layer (with multiple
>>> > expressions regarding to the intervals) should do the job.
>>> >
>>> > Best regards,
>>> >
>>> > Tamas
>>> >
>>> >
>>> >
>>> > 2013/3/22 Mark Davidson <mark at 4each.co.uk>
>>> >>
>>> >> That works great thanks Tamas. I'm now trying to use that expression
>>> as a
>>> >> condition on a class.
>>> >>
>>> >> I'm trying to style the clusters a different colour depending on the
>>> >> calculation of that expression. Can multiple styles be applied to a
>>> single
>>> >> cluster point?
>>> >>
>>> >> CLASS
>>> >>       NAME "Clustered Point"
>>> >>       EXPRESSION ("[Cluster:FeatureCount]" != "1")
>>> >>       STYLE
>>> >>         SIZE 22
>>> >>         SYMBOL "circle"
>>> >>         COLOR 255 0 0
>>> >>       END
>>> >>       LABEL
>>> >>       TEXT ([Sum:lowesttemperature]/[Count:lowesttemperature])
>>> >>       FONT "arial"
>>> >>   TYPE truetype
>>> >>         SIZE 8
>>> >>         COLOR 255 255 255
>>> >>       END
>>> >>     END
>>> >>
>>> >>   CLASS
>>> >>       EXPRESSION (([Sum:lowesttemperature]/[Count:lowesttemperature])
>>> > 1)
>>> >>       STYLE
>>> >>         SYMBOL "circle"
>>> >>         COLOR 0 255 0
>>> >>       END
>>> >>   END
>>> >>
>>> >>
>>> >>
>>> >> On 22 March 2013 13:15, Tamas Szekeres <szekerest at gmail.com> wrote:
>>> >>>
>>> >>> Mark,
>>> >>>
>>> >>> I think LABEL level expressions would work in this case. Something
>>> like:
>>> >>>
>>> >>>      LABEL
>>> >>>         TEXT ([Sum:itemname]/[Count:itemname])
>>> >>>         TYPE TRUETYPE
>>> >>>         ...
>>> >>>       END
>>> >>>
>>> >>> Best regards,
>>> >>>
>>> >>> Tamas
>>> >>>
>>> >>>
>>> >>>
>>> >>> 2013/3/22 Mark Davidson <mark at 4each.co.uk>
>>> >>>>
>>> >>>> Hi All,
>>> >>>>
>>> >>>> I'm new to using mapserver and have been implementing a WMS overlay
>>> >>>> using the CLUSTER funcionality got pretty much everything I need
>>> working,
>>> >>>> but I can't seem to get an average value of a cluster to use as
>>> part of the
>>> >>>> styling and labelling.
>>> >>>> I've tried everything I can think of to try and get it working but
>>> am
>>> >>>> having no luck. I thought that since you can do [Max:itemname] and
>>> >>>> [Count:itemname] I would be able to do an equation to work out the
>>> average,
>>> >>>> but I just get syntax errors with everything I try and haven't been
>>> able to
>>> >>>> find any examples of doing this.
>>> >>>>
>>> >>>> Could anyone tell me if its possible to do this? And if so provide
>>> an
>>> >>>> example?
>>> >>>>
>>> >>>> Any input would be very much appreciated,
>>> >>>>
>>> >>>> Thanks,
>>> >>>>
>>> >>>> Mark Davidson
>>> >>>>
>>> >>>> _______________________________________________
>>> >>>> mapserver-users mailing list
>>> >>>> mapserver-users at lists.osgeo.org
>>> >>>> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>> >>>>
>>> >>>
>>> >>
>>> >
>>> >
>>> > _______________________________________________
>>> > mapserver-users mailing list
>>> > mapserver-users at lists.osgeo.org
>>> > http://lists.osgeo.org/mailman/listinfo/mapserver-users
>>> >
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20130322/da05b722/attachment.html>


More information about the mapserver-users mailing list