[Potlatch-dev] Stylesheets (Potlatch 2/Halcyon)

Richard Fairhurst richard at systemeD.net
Tue Jul 14 13:19:22 BST 2009


Hi all,

Halcyon is the new WYSIWYG rendering engine for Potlatch 2. It draws  
ways and nodes according to rules in a stylesheet. You can see a demo  
at http://www.geowiki.com/halcyon/ .

At present the stylesheet is a big YAML file, simply because it's very  
easy to parse. You can see one at  
http://svn.openstreetmap.org/applications/editors/potlatch2/test.yaml .

But it's rather ugly, verbose, and not widely understood, so I'd like  
to move to something more CSS-like. Good work has already been done  
here by Cascadenik and Cartagen.

My current thinking is that such a stylesheet might look roughly like this:

     // One simple rule
     highway=primary {
       color: red;
       width: 5px;
       border: 2px solid black;
     }

     // More complex rule
     highway=trunk && oneway=yes {
       color: green;
       width: 4px;
       border: 2px solid black;
     }

     // Two rules, same style for both
     highway=unclassified, highway=tertiary {
       color: yellow;
       width: 4px;
       border: 2px solid black;
     }

     // Specifying zoom level
     [z13-15] highway=residential {
       color: #777777;
       width: 3px;
       border: 1px solid black;
     }

In other words, the 'selector' is the tag rule. (There might be some  
special selectors, too: one for the background and one for a default  
style if nothing matches.)

Does this make sense as a general approach?

cheers
Richard





More information about the Potlatch-dev mailing list