Hi Paul,

The main way it cuts down on repetitiveness is that it provides a way to break out rules by class and specificity. Using xml entity definitions, as I have, is frustrating because you have to work backward from the Layer to the Style, coming up with an "unrolled" representation of your rules and mapping that onto a set of declarations. Emulating a class (e.g. "roads", "buildings") with entities requires that you set up applicable styles in one spot, and then maintain pointers to them in each Layer - the class is implicitly defined by the styles it uses, though it may not be labeled as such unless you're conscientious about commenting things. The process of designing a Mapnik stylesheet effectively forces you to unroll classes yourself.

I like the CSS way because it feels more DWIM ("Do What I Mean") - setting up a class of things consists of adding class attributes to layers, and decisions about how that class should be rendered are all grouped together in a list of rules. It's a concrete representation of what I'm trying to imitate with XML entities, yet still compatible with Mapnik proper. There's a lot of process thinking that goes into stylesheets which could definitely be replaced by code.

-mike.

On Aug 25, 2008, at 12:22 PM, Paul Smith wrote:

Hey Mike,

Looks really interesting. I took a glance at your code -- haven't had a chance to play with it yet, but you've got a solid framework here. I'm looking forward to testing it out.

I'm trying to wrap my head around it, and maybe I just need to spend some more time with the docs and the code itself. Thinking about cutting down on repetitiveness, how does mapnik-css improve over, say, XML entity definitions?

Cheers,
-Paul

On Mon, Aug 25, 2008 at 11:44 AM, Michal Migurski <[EMAIL PROTECTED]> wrote:
Hi,

Having worked on one Mapnik project that required big, almost-OSM-
scale stylesheets, I've been a bit frustrated with the state of the
art for defining map appearance. So, I've built a stylesheet
preprocessor that parses a format explicitly based on HTML + CSS and
outputs the usual XML styles.

There's a basic introduction here:
       http://teczno.com/cascadenik/doc/

...and complete code here (note some of the reqs in the Makefile):
       
http://code.google.com/p/mapnik-utils/source/browse/trunk/serverside/styles/

I'm looking for comments / feedback.

It's a fairly complete thought, incorporating a lot of the things I
believe would make styling maps accessible to designers:

- It's possible to refer to external files in predictable locations
including images and linked stylesheets.
- Style definitions can work in a class-oriented fashion, allowing you
to express ideas such as "all roads are red, but primary roads have a
yellow edge and they're different widths at each zoom level" -
currently this is difficult or at least enormously repetitive with
existing Mapnik styles.
- Rules for how these definitions combine and cascade are also
explicit, copied directly from the CSS spec.
- I've also started to introduce useful shorthands, e.g. it's possible
to express scale denominator boundaries in a reduced "zoom" notation
specifically for maps in the Google / VEarth / OSM projection.

Most properties are done:
       
http://code.google.com/p/mapnik-utils/source/browse/trunk/serverside/styles/style.py#48

Outstanding items still on my list to do include the shield
symbolizer, dashed lines, and Filters.

Also a full set of edge & corner cases hasn't yet been dealt with, but
there are tests:
       
http://code.google.com/p/mapnik-utils/source/browse/trunk/serverside/styles/test.py

Anyway, thoughts welcome.

-mike.

----------------------------------------------------------------
michal migurski- [EMAIL PROTECTED]
                 415.558.1610



_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users



--
Paul Smith
http://www.pauladamsmith.com/

----------------------------------------------------------------
michal migurski- [EMAIL PROTECTED]
                 415.558.1610



_______________________________________________
Mapnik-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/mapnik-users

Reply via email to