Opened 20 years ago

Closed 20 years ago

#566 closed defect (fixed)

handling wms_sld_url as a local file on disk

Reported by: tomkralidis Owned by: mapserverbugs
Priority: high Milestone:
Component: WMS Server Version: 4.1
Severity: normal Keywords:
Cc:

Description

As discussed with Assefa, in toying with 4.1, I find that one can define layer
objects with "wms_sld_url".  So this means I have serve up some data and have it
styled by a SLD URL.

There should also be functionality to point to a local file as well, something
like "wms_sld_file", or reuse "wms_sld_url" and have the code decipher whether
it's looking for a file on disk or a URL.

My main goal here would be to allow a user to set styles for local data with
local SLD documents.

Change History (6)

comment:1 by dmorissette, 20 years ago

Cc: steve.lime@… added
I think setting styles for local data using SLD documents in local files is
pushing things a bit, plus it creates unnecessary overhead and complexity for
something that can be done simply by setting the right classes in the mapfile in
the first place... I don't think we should prioritize this for this version.

Also, if we do something like that then reusing wms_sld_url to mean something
different would just lead to problems so we should definitely create a new
metadata name, or if we want local SLD files to turn into classes on the fly,
then we should probably have a new mapfile directive and not use metadata at all.

comment:2 by tomkralidis, 20 years ago

I see your point.  Just want to make sure that functionality between MapServer
classes and SLD definintions can be interchangeable, i.e. will MapServer classes
be able to convert to SLD via GetStyles?

Also this would be useful for someone who has converted to MapServer with a
bunch of data and SLD documents.  I wouldn't want to convert SLD to MapServer
classes manually.

comment:3 by assefa, 20 years ago

The GetStyles is not implemented but could very well be. I am going to add it
pretty soon. There are already functions that generate an sld from mapserver
classes. Right now they are available through mapscript (generatelayer on map
and layer object). It is a matter of wrapping these functions for a GetStyles
request. 

comment:4 by dmorissette, 20 years ago

> Also this would be useful for someone who has converted to MapServer with a
> bunch of data and SLD documents.  I wouldn't want to convert SLD to MapServer
> classes manually.

Maybe that person could use a PHP script to convert the SLDs to MapServer
LAYER/CALSS definitions?  That would be better than processing the SLDs at runtime.

comment:5 by tomkralidis, 20 years ago

Good point.  Perhaps we could have a utility in the MapServer dist which does
this instead?

comment:6 by assefa, 20 years ago

Resolution: fixed
Status: newclosed
2 points in this bug :

 - the GetStyles request has been implemented (returns an SLD based on classes
   defined in the layers)

 - there is also a couple of php functions applySLD and applySLDURL that 
converts an sld to classes. The matching between the sld document and the map 
file is done using the layer's name.  We have used this function for few 
applications to "convert" sld to classes.

 Marking this as fixed.

Note: See TracTickets for help on using tickets.