Skip to content

Add first-match <Filter> mode to stylesheet #706

@artemp

Description

@artemp

Currently, all symbolizers of all matching rules are applied, however, sometimes writing stylesheets is vastly simplified when only the first matching rule is applied and all others are ignored.

I propose adding an attribute to <Style>: a filter-mode with the default value "all" which triggers the current behavior. But, when set to "first", Mapnik stops applying any further Rules from the style after the first match. Empty filters (rules with no filter), Elsefilters or non-existant filters in a rule are treated equally, the first rule that has any of those properties is applied if there's no other matching rule before.

As per Dane, implementation could be as simple as adding the property to the Style object (reading in src/load_map.cpp and serialization in src/save_map.cpp), then addition to the python bindings binding/python/mapnik_style.cpp.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions