[Tilesathome] RFC: New Osmarender features

Knut Arne Bjørndal bob+osm at cakebox.net
Wed Oct 1 21:37:18 BST 2008


On Wed, Oct 01, 2008 at 09:17:41PM +0200, Jiri Klement wrote:
> Thanks for the reply. I don't think rules files will be so much harder
> to understand. The basic concept is quite simple, I'm just having
> trouble to explain it.
> 
> At first I thought I will only add support for relative layers.
> Relative layers will remove the need to write rendering rules in order
> in which they should be rendered. The render by order in rules file
> principle is main reason why rules files are so scattered.

I really agree with this, it makes it hard for beginners to do changes
because there are so many things to consider and know about that are
spread around the file.

If it was also possible to put layer overrides, like for captions,
inside rules far down the hierarchy I think we could make the
stylesheets _much_ easier to understand.

> So basically rules for tertiary road would look like this:
> <rule e="way" k="highway" v="tertiary">
> 	<line class="highway-core highway-tertiary-core" relativeLayer="1"/>
> 	<line class="highway-casing highway-tertiary-casing" relativeLayer="0"/>
> 	<text k="name" startOffset="50%" class="highway-name
> highway-tertiary-name" dy="0.5px" layer="5"/>
> </rule>
> 
> The trouble here is you may find out you need some instruction to
> render bellow highway casing. This can solved either by renumbering
> all highway's relativeLayers or by using relativeLayer like 100, 200
> so you have enough space to insert another layer. Both principles are
> too error prone.

Why not simply go for this? It should allow most things, yet still be
easy enough to understand that you don't have to write too much
documentation ;)

KISS is imho a very, very good principle.

If one needs to change some constant 50 times, hey that's why editors
have search/replace functionality...

> So I've introduced SetLayer instruction. It will set
> layer/relativeLayer to group of instructions. All SetLayer
> instructions can be at one place in rules file so rendering order is
> clear and easy to change.

I can clearly see how this is a good and powerfull tool, but I still
think it's a bit hard to understand.

> The rest of the proposal is just generalization of the basic idea.
> 
> Is at least relative layer concept clearer now?
> 
> > My first impression is that this will make the rules much harder to
> > understand, I certainly have problems understanding just what your
> > examples would do.
> 
> I've tried to improve the example a bit. I've fixed some typos and
> added comments.

It made it a lot clearer, thanks. I still think it should be kept a
bit easier to understand, though.

-- 
Knut Arne Bjørndal
aka Bob Kåre
bob+osm at cakebox.net
bobkare at irc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 4167 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/tilesathome/attachments/20081001/513fe496/attachment.bin>


More information about the Tilesathome mailing list