[mapserver-users] Fwd: Dynamically changing SLD via URL

James Perrins james.perrins at gmail.com
Fri Nov 13 02:20:38 PST 2009


Hi,

I have Mapserver running and a map file producing a WMS service.
I can successfully provide an SLD either directly on the URL
(URL_BODY) or remotely (URL)

What I'm trying to do is have the user drag a bounding box and have
mapserver return a list of record ids found in the bounding box and
for the WMS image to hi light these returned records.  I know I can
just about do it all - but its a bit fiddly and I wondered if there
was a neater way.

1) I've resigned myself to having to use NQUERY to get the list of ids
within a user defined bounding box (I have found if all I wanted was
to display the selected features in the WMS image I could use the
spatial filter - unfortunately I need the record Ids as well and
GetFeatureInfo only allows a point to be queried I believe) - I don't
really want to use WFS as there may be quite a lot of data and I'd
have to duplicate map files for WFS as well as WMS.

2) Given that the size of an SLD is rather restricted if passed
directly on the URL is it possible to dynamically change a remotely
hosted SLD via the URL (i.e. something like the %SOMETHING% that can
be used for variable substitution in a map file).  What I really want
to do is dynamically change the filter in the SLD to highlight various
objects selected by a bounding box and dynamically alter the fill
styles

3) Also - when using an SLD with a filter, is it possible to change
only the styles of the features matching the selection BUT leave all
others styled as defined in the map file layer - or do I always have
to repeat all that in the SLD file

Thanks in advance
James



More information about the MapServer-users mailing list