Chart positioning

Steve Lime Steve.Lime at DNR.STATE.MN.US
Thu Aug 2 18:45:01 EDT 2007


The label cache stores a labelObj for each label (cause each label could have a unique size, color, etc...). With annotation we also store the
CLASS (probably not all of it, just the styles most likely) so that the marker could be rendered later. 

I haven't looked at the chart code enough to know how it works. If a chart boiled down to a series of custom styles (created at runtime)
for each feature then the current cache would work. I don't get the feeling that's how it works though, so the label cache would have to
be extended to cache enough information to recreate the chart. Would also need a function to compute the chart size (in pixels).

Note that with point layers with labels we also store the location and size of the already rendered point so that we don't write over the top 
of them either. E.g. labels don't collide with each other and they don't overlap other points with labels. This was implemented to avoid
associating a label with the wrong point. Point layer markers themselves can overlap. Perhaps treating charts in this way is an option? 


Steve

>>> On 8/2/2007 at 8:23 AM, in message
<d2b988930708020623n4d6e158aq33359ec22e3763a1 at mail.gmail.com>, thomas bonfort
<thomas.bonfort at GMAIL.COM> wrote:
> On 8/2/07, Daniel Morissette <dmorissette at mapgears.com> wrote:
>>
>> Nicol Hermann wrote:
>> > Hi Daniel,
>> >
>> > as promised, i did some further tests with the new charting options.
>> > I checked the layer types point and line and could not find any problems
>> > so far. One question for my understanding. How do you determine the
>> > position of the charts by line and polygon types?
> 
> 
> for polygon layers its determined by the mapserver function
> msPolygonLabelPoint, which does have a min_dimension parameter but I haven't
> been successful when changing this.
> for the line layers, the program starts with the middle segment of the line
> and draws the chart there if it fits. if not it recursively tests the two
> adjacent segments until a place has been found.
> 
> On thing i plan to do
>> > are some collision tests. Is it possible to control this behaviour like
>> > the force keyword in the labelObj?
> 
> 
> I have no idea how this is done for labels. if you want to have a go at it
> please do ;)
> 
>>
>> > Many thanks
>> > Nicol
>> >
>>
>> Hi Nicol,
>>
>> I have moved this discussion to the mapserver-dev list since others
>> might be interested in it.
>>
>> I have also CC'd Thomas Bonfort who is the author of the chart rendering
>> code, he will be able to comment on the possible options. I think
>> treating the charts as labels/symbols and caching them to allow
>> collision detection is something he had in mind but that was not part of
>> the initial implementation.
>>
>> Daniel
>> --
>> Daniel Morissette
>> http://www.mapgears.com/ 
>>



More information about the mapserver-dev mailing list