Hi<br><br><div><span class="gmail_quote">On 3/10/07, <b class="gmail_sendername">Robert Hart</b> <<a href="mailto:Robert.Hart@burohappold.com" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">Robert.Hart@burohappold.com
</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">







<div>

<br>

<p><font size="2">Barry/tiles@home crowd,<br>
<br>
Inspired by your lines2curves, I have hacked together a proof-of-concept script to fix up names to fit in the ways they are on.<br>
<br>
Basically for each text path, it tries to abbreviate the text so that it will fit into the way, or if it can't it hides the text.</font></p></div></blockquote><div><br>Neat!<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><p><font size="2">
As it works in basically the same way as lines2curves, and needs much of the same info, I created a single unified script.<br>
<br>
See <a href="http://wiki.openstreetmap.org/index.php/Osmarender/TextFitting" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://wiki.openstreetmap.org/index.php/Osmarender/TextFitting</a><br>
<br>
Issues:<br>
<br>
* needs code to read osmarender styles - currently hard coded to default style<br>
* needs calibration - I assume each character is equal to the fontsize in width</font></p></div></blockquote><div><br>I thought you could ask for the lengh of a piece of text somewhare<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><p><font size="2">
* needs non-anglo centric abbreviations, and probably separate conf file for abbreviations<br>
* can't deal with XML-escaped text. May not be UTF-8 safe either.<br>
* ugly perl.</font></p></div></blockquote><div><br>Yep, guess there are a few things to do yet :-)<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

<div><p><font size="2">
Rob<br>
<br>
p.s. there's a bug in your regex when run on non-uploaded OSM (hint way ids can be negative).</font></p></div></blockquote><div><br>This is what happens when you (I) make post-process assumptions.....<br></div><br>Which leads to the bigger question about pre/post processing.
<br><br>I've been discussing offline with 80n & Jochen about making lines2curves a preprocessor option to osmarender to add 'hints' to the osm file - so far it's likely to look something like this:<br>
<br><span class="q"><br><osm xmlns:bez="<a href="http://wiki.openstreetmap.org/index.php/User:Dotbaz/bezier" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
http://wiki.openstreetmap.org/index.php/User:Dotbaz/bezier</a>"<br>  ...<br>   <way id='4059458' timestamp='2006-12-07 19:28:11' bezier="yes"><br>     <seg id='17559084' bez:cp1="node1" bez:cp2="node2" />
<br>     <seg id='17559085' bez:cp1="node3" bez:cp2="node4" /><br>     <tag k='highway' v='unclassified' /><br>     <tag k='created_by' v='JOSM' />
<br>   </way><br></osm><br></span><br>Anyway, the advantage of having this as a preprocessing step as has been pointed out by Frederick, Jochen is that it removes any dependancy on the format of the osmarender svg. As a pre-process step, it also removes the dependancy of osmarender as a renderer as well, so other renderers might make use of it.
<br><br>I guess what I'm getting at is that lines2curves is likely to appear as a preprocessing step fairly soon, so what I would like to see happen is a more general purpose pre-processing plugin setup so that osm data can be passed through a number of selectable pre-processing 'hinting' steps so that it gets to osmarender (or whatever application) with a useful set of addtional attributes/hints added. For example I can see that renderers might want bezier hints or text size hints, but they would be of no help to a routing algorithm.
<br><br>Would it make sense to update the api so that it could do this kind of thing (or is it in place already!).<br><br>Cheers. Baz<br></div><br clear="all"><br>-- <br>Live as if you were to die tomorrow. Learn as if you were to live forever.  - Gandhi.