Skip to content

SLD: Implement SLD "Painters Model" Style Layering - #5839

Merged
jmckenna merged 7 commits into
MapServer:masterfrom
jbo-ads:sld-layering
Mar 20, 2020
Merged

jmckenna merged 7 commits into
MapServer:masterfrom
jbo-ads:sld-layering

Conversation

@jbo-ads

@jbo-ads jbo-ads commented Jul 24, 2019

Copy link
Copy Markdown
Member

This pull request proposes an implementation of SLD "Painters Model" style layering, where all applicable classes are used for rendering a feature instead of only the first one in original MapServer policy. This is described in third section of MS RFC 124: Improving SLD Support in MapServer.

@sdlime

sdlime commented Aug 7, 2019

Copy link
Copy Markdown
Member

The alternative here to achieve similar visual effects would be use multiple layers, correct? I could see this being more broadly popular so we really should expose this functionality via the mapfile/mapscript as well. I think that means exposing the layer RENDERMODE property and then the associated values. I guess that would mean on supporting something like:

RENDERMODE FIRSTCLASS|ANYCLASS

@geographika might have some opinion in terms of syntax. ANYCLASS is probably more descriptive than painter mode.

@geographika

geographika commented Aug 7, 2019 •

Copy link
Copy Markdown
Member

Would a possible option be to have it as a PROCESSING directive? E.g.

PROCESSING "RENDERMODE=FIRSTCLASS|ANYCLASS"

I think this would then already be supported by MapScript looking at this test, without need for modifications.

A couple of other options for the option naming (agree MS_PAINTERS_MODEL may be too technical:

FIRSTCLASSMATCH|ALLCLASSMATCH

Or slightly more literal but longer:

FIRSTMATCHINGCLASS|ALLMATCHINGCLASSES

@geographika

Copy link
Copy Markdown
Member

With regards to using multiple classes from the same layer for a single feature, it is possible using GROUP in the class and then (at least with WMS) passing in style=group1,group2.

@sdlime

sdlime commented Aug 7, 2019

Copy link
Copy Markdown
Member

We don't have a good definition on when to add a full-on attribute vs using a processing directive. I agree that this feels more like a the latter...

@jbo-ads

jbo-ads commented Aug 8, 2019 •

Copy link
Copy Markdown
Member Author

You read my mind! Exposing layer RENDERMODE property was something I thought of when developing the feature for SLD. I will be more available on september for implementing this. I let you choose the syntax details that best fit existing usage.

@jratike80

Copy link
Copy Markdown

I wonder what will happen if CLASSes have STYLEs with OPACITY. What is the result when RGBA 200 0 0 128 is rendered over RGBA 0 200 0 128?

@jmckenna jmckenna added this to the 7.6 Release milestone Feb 25, 2020
@jbo-ads

jbo-ads commented Feb 25, 2020

Copy link
Copy Markdown
Member Author

@geographika, @sdlime: As suggested, I have added a processing directive:

PROCESSING "RENDERMODE=FIRST_MATCHING_CLASS|ALL_MATCHING_CLASSES" 

@jmckenna
jmckenna merged commit 13607c7 into MapServer:master Mar 20, 2020
@jmckenna

Copy link
Copy Markdown
Member

@jbo-ads cool feature, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants