Ticket #1395 (closed defect: fixed)

Opened 7 years ago

Last modified 3 years ago

[WMS Server] enable metadata to turn off SLD functionality

Reported by: tomkralidis Owned by: tomkralidis
Priority: high Milestone: 6.0 release
Component: WMS Server Version: svn-trunk (development)
Severity: normal Keywords:
Cc: mapserverbugs, assefa, dmorissette, bartvde, jmckenna

Description (last modified by dmorissette) (diff)

For WMS Server, I have had numerous requests/desires from stakeholders to have
SLD functionality turned OFF.  This is because some activities do not want their
maps restyled by an arbitrary user SLD for whatever reason (lying with maps).  I
think this is a valid issue.

I think an "sld_enabled" directive in the WEB/METADATA object would do the trick:

"sld_enabled" "0"

OR

"sld_enabled" "1"

If 1, then SLD is enabled.  If 0, then SLD is turned off.  If not specified in
mapfile, then SLD is enabled.

Change History

Changed 3 years ago by tomkralidis

  • cc mapserverbugs, assefa, dmorissette, bartvde added
  • owner changed from mapserverbugs to tomkralidis
  • version changed from unspecified to svn-trunk (development)
  • milestone set to 5.4 release

I'll take this one. Basic approach:

  • if sld_enabled == 0
    • GetCapabilities: do not advertise
    • GetMap: return exception "SLD is not enabled on this WMS"
    • GetFeatureInfo: return exception "SLD is not enabled on this WMS"

Comments?

Changed 3 years ago by tomkralidis

Any comments on the approach suggested? i.e. should the value be 0|1 or true|false

Default would be SLD-enabled.

The code would check for sld_enabled being "0" to turn off SLD in GetCapabilities.

For GetMap and GetFeatureInfo, should we return exception, or return as usual, with the change that the response would be as if SLD was not applied in the request?

Please advise.

Changed 3 years ago by assefa

maps don't lie :)

It is I think a valid request. I had the same request from some one few months back where he wanted to have some layers flagged as not supporting the SLD. I think I left code inside mapogcsl.c (inside #ifdef (SLD_NOT_SUPPORTED) to show him how it would be done).

Couple of comments:

  • I like the approach of setting with the map level metadata (preference is true/false)
  • Would this affect at all the GetStyle? call (returning an SLD)?
  • Would it make sense to have this metadata also available at the layer levels?

Changed 3 years ago by dmorissette

  • description modified (diff)

I agree with adding this, at least at the map level. Not sure if it's worth the overhead to add it at the layer level as well... your call.

I think that should disable GetStyle? as well... not sure about disabling GetLegendGraphic? since this one is also useful to build a legend even in non-SLD contexts.

Changed 3 years ago by assefa

One comment I forgot to make:

  • I think ignoring the SLD parameter would be the appropriate behavior if it is not enabled. I don't think the spec says to return an exception in this case, does it?

for GetLegendGraphic?, I meant ignoring the SLD or SLD_BODY parameter is passed (or return an expetion of that is waht is decided for the other wms operations)

Changed 3 years ago by dmorissette

worksforme

Changed 3 years ago by tomkralidis

More observations / thoughts:

WMS 1.1.1 (01-068r3) specifies the following requests as SLD WMS only:

  • section 7.4 DescribeLayer
  • section 7.5 GetLegendGraphic
  • section 7.6 GetStyles
  • section 7.7 PutStyles (not supported by MapServer)

I interpret this as follows: if SLD is disabled, then these requests are not supported, and the SLD or SLD_BODY are ignored per comment:5

So then the question is what do we really want here:

  • to disable SLD, obeying the WMS spec
  • to disable applying SLD and SLD_BODY in WMS requests (thus also not advertising SLD in Capabilities XML). This is more lax, but meets the requirements of those who made the original request to me (i.e. they don't really care about following the spec to the max, just turn off remote styling)
  • to allow for both types of disabling (getting way to complicated)

Wonder what folks think here. I think option 2 would be sufficient. In any case, this won't be enabled unless explicitly set in the mapfile, so current functionality would not be affected.

Changed 3 years ago by assefa

Tom, option2 should be enough I think.

Changed 3 years ago by tomkralidis

  • milestone changed from 5.4 release to 6.0 release

Pushing to 6.0

Changed 3 years ago by tomkralidis

  • cc jmckenna added

Implemented:

Changed 3 years ago by tomkralidis

  • status changed from new to closed
  • resolution set to fixed
Note: See TracTickets for help on using tickets.