<div dir="ltr">On Tue, Aug 5, 2008 at 11:07 PM, Frederik Ramm <span dir="ltr"><<a href="mailto:frederik@remote.org">frederik@remote.org</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi,<br>
<br>
I have added a proximity filter to or/p that uses the same syntax as<br>
the original Osmarender.<br>
<br>
The logic is a bit different however: or/p simply processes all objects,<br>
draws those whose "box" is not yet occupied (and marks the box as<br>
occupied), and ignores the others. This gives good results but the<br>
choice of labels is different than with Osmarender/XSLT, and probably<br>
even different if the data changes slightly.<br>
<br>
Could someone with a better understanding of Osmarender/XSLT (bobkare?<br>
80n?) tell me whether the way it is done XSLT (somehow it seems to<br>
search for "pairs" of nearby objects and then discard one?) circumvents<br>
this problem and leads to more stable results?<br>
</blockquote><div><br>The XSLT algorithm starts by looking for captions that are very close together and discarding one of them at random. It then repeats this for a slightly larger "box". That way there is a bias towards removing captions that are very near to each other and leading to an even distribution.<br>
<br>I don't know whether this is more or less stable than your algorithm. I suspect any algorithm is going to be highly sensitive to small changes.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
My implementation supports an extra parameter called "proximityClass".<br>
If multiple selection rules share the same value for this optional<br>
parameter, they use the same "box space", i.e. objects selected by the<br>
first rule will still be known as "used" by the second rule.<br>
</blockquote><div><br>Great! This is a very desirable feature. <br><br></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
(There's a slight caveat here, in that any object selected by a<br>
proximity rule is assumed to have "used" its space, even if the object<br>
should be deselected by a nested selection rule; and also proximity<br>
filters won't work properly with <else> branches.)<br>
<br>
I was thinking that if we added to this a numerical comparison operator<br>
for tag values, then we could achieve a rendering of largest cities<br>
first, like so:<br>
</blockquote><div><br>This would be very nice to have.<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<select k="place" v="city"><br>
<select k="population" v=">1000000" horizontalProximity="0.6"<br>
verticalProximity="0.4" proximityClass="caption"><br>
... render ...<br>
</select><br>
<select k="population" v=">200000" horizontalProximity="0.6"<br>
verticalProximity="0.4" proximityClass="caption"><br>
... render ...<br>
</select><br>
<select k="population" v="*" horizontalProximity="0.6"<br>
verticalProximity="0.4" proximityClass="caption"><br>
... render ...<br>
</select><br>
</select><br>
<br>
But that numerical comparison operator doesn't exist yet, I don't know<br>
if this would be a good way to do it. Another possibility would be to<br>
introduce sorted selection results, like so:<br>
<br>
<select k="place" v="city" descending_sort="population"<br>
horizontalProximity="0.6" verticalProximity="0.4"><br>
... render ...<br>
</select><br>
<br>
Bye<br>
Frederik<br>
<font color="#888888"><br>
--<br>
Frederik Ramm ## eMail <a href="mailto:frederik@remote.org">frederik@remote.org</a> ## N49°00'09" E008°23'33"<br>
<br>
_______________________________________________<br>
Tilesathome mailing list<br>
<a href="mailto:Tilesathome@openstreetmap.org">Tilesathome@openstreetmap.org</a><br>
<a href="http://lists.openstreetmap.org/listinfo/tilesathome" target="_blank">http://lists.openstreetmap.org/listinfo/tilesathome</a><br>
</font></blockquote></div><br></div>