On 11/7/06, <b class="gmail_sendername">Joerg Ostertag (OSM Munich/Germany)</b> <<a href="mailto:openstreetmap@ostertag.name">openstreetmap@ostertag.name</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Monday 06 November 2006 23:18, 80n wrote:<br>> An earlier version version of Osmarender did have a mechanism to allow an<br>> external style sheet file to be referenced.  I think it caused problems<br>> with some tools because I didn't implement it properly, so it got dropped.
<br>><br>> It should be easy to re-introduce this.  The styles are separate from the<br>> rules for this exact reason.<br><br>Do you think osmarender could be changed to handle a style definition similar<br>to the one i suggested? If yes, this would be great.
</blockquote><div><br>Most of the Osmarender rules file is straight SVG (<a href="http://www.w3.org/TR/SVG/">http://www.w3.org/TR/SVG/</a>).  The rest is just <rule> tags and some simple drawing instructions <line>, <area>, <text>, <symbol>, <circle>.
<br><br>The SVG style definition is very extensive and incorporates most of CSS.<br><br>Driving Osmarender from a rules file such as freemap.xml which only describes line color and width would cripple Osmarender and throw away 90% of its potential.   
<br><br>Apart from styles Osmarender uses scalable icons.  Using .pngs which are not scalable would be a step backwards.<br><br>To make a common rule file we need to first establish a common rule file schema.  To be sufficient for Osmarender this needs to support a lot more than 
elemstyles.xml and freemap.xml currently do.<br><br>The first step should be to separate the style information from the rules section.  This would enable a separate style file to be created for each renderer.  This would allow Dubravko to make a style sheet using colours and symbols that are appropriate for Croatia.  It would also enable multiple rules to refer to the same style:
<br><br>Something like:<br><br><span class="q"><mapfeatures style='myStyleFile.xml'><br>  <rule><br>    <condition e="way" k="class" v="suburb" /><br></span><div style="direction: ltr;">
<span class="q">      <render class="residential" /><br>  </rule><br></span><span class="q">  <rule><br>    <condition e="way" k="landuse" v="residential" />
<br></span>
<div style="direction: ltr;"><span class="q">      <render class="residential" /><br>
  </rule><br></span></div>  <span class="q"><rule><br>  ...<br>  </rule><br></mapfeatures></span></div><br><br>myStyleFile.xml<br><style><br><span class="q">  <rendering class="residential">
<br>    <scale min='1' max='10000'><br>      <icon annotate="name,regioncode" src="place.png" /><br></span><span class="q">    </scale><br></span><span class="q">    <scale min='10000' max='100000'>
<br>
      <icon annotate="name" </span><span class="q">src="city/small.png"</span><span class="q"> /><br></span><span class="q">    </scale><br>
</span><span class="q">  </rendering><br></style><br></span><br><br>A lot of work would also be needed on the structure and semantics of the <rule> elements to provide ways of expressing compound conditions etc.
<br><br>80n<br><br><br><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;">> > > <mapfeatures><br>> > >  <rule>
<br>> > >   <condition k="class" v="suburb" /><br>> > >   <rendering><br>> > >     <scale_min>1  </scale_min><br>> > >     <scale_max>10000  </scale_max>
<br>> > >     <icon annotate="name,regioncode" src="place.png" /><br>> > >   </rendering><br>> > >   <rendering><br>> > >     <scale_min>10000  </scale_min>
<br>> > >     <scale_max>100000  </scale_max><br>> > >     <icon src="city/small.png" /><br>> > >   </rendering><br>> > >  </rule><br>> > >  <rule>
<br>> > >         ...<br>> > >  </rule><br>> > > </mapfeatures><br><br><br>_______________________________________________<br>dev mailing list<br><a href="mailto:dev@openstreetmap.org">
dev@openstreetmap.org</a><br><a href="http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev">http://lists.openstreetmap.org/cgi-bin/mailman/listinfo/dev</a><br></blockquote></div><br>