AW: [UMN_MAPSERVER-USERS] WMS STYLES-Parameter and Mapserver 4.10
Arnd Wippermann
arndw at WTAL.DE
Fri Nov 10 13:21:41 PST 2006
Hello Roger,
My problem was, that Mapserver 4.10 omitted the STYLES-Parameter in the
WMS-GetMap-Request. Some WMS-Servers send an exception, because of this
missing parameter. Therefor I looked for a way to add the miising parameter.
One way is to add STYLES= to the CONNECTION-String for the Server. I don't
like it, but this way I am using. Bart has mentioned adding a tag to the
Layers METADATA (wms_styles 'default' ). I have thought, that I have it
positiv tested, but a look today shows me that this has no effect.
I have also tested other tags in the METADATA to apply SLD-Styles, but they
have also no effect. Because I add normally my SLD with javascript to the
requeststring, I have not looked deeper in the METADATA tags.
With adding &SLD=[url] to the requeststring, I get the wished results. But
it's importent, that the SLD is correct, the layer correct named and the Url
reachable via http from the requesting server. In the beginning I have often
failed and thought it is a Mapserver fault, but it was my fault. You can
look at my page. There I have some SLD you can use with the WORLD 4326
layer.
I know c, but I'm using only compiled binairies, so there I have no ideas.
Mit freundlichen Grüssen
Arnd Wippermann
http://gis.ibbeck.de/ginfo/ibbOLClient/OpenLayersClient.html
-----Ursprüngliche Nachricht-----
Von: Jans Roger [mailto:roger.jans at combitech.se]
Gesendet: Freitag, 10. November 2006 09:43
An: arndw at wtal.de
Betreff: [UMN_MAPSERVER-USERS] WMS STYLES-Parameter and Mapserver 4.10
Hello Arnd,
My name is Roger Jans. I'm also using MapServer 4.10.0 and get the same
problem.
May I ask you how exactly you solved the issue? What were the final settings
needed?
Does the reply from Bart mean that the changes to mapwmslayer.c for version
1.79 *cause* the problem? It seems so, since version 1.79 of the file is
included in MapServer 4.10.0.
I don't know if you're interested but I describe my setup anyway and
hopefully you can give me some indication what more I could do to make it
work:
1. For my 3 (test) layers in a .map file I have defined simple CLASS...END
blocks
like this:
CLASS
NAME "k92_20k_pgx"
COLOR 235 250 255
OUTLINECOLOR 100 100 100
END
2. Using MapScript in a PHP page I have extracted an SLD for these classes.
That seems to work OK. I get the corresponding settings in the SLD.
3. I have removed (commented out) the CLASS...END blocks in the .map file
and
instead specify the &SLD=[url] querystring parameter.
Like you I have so far not specified any STYLES parameter in the GetMap
request.
I thought that specifying the 3 layer names and an SLD which specifies
style
for these 3 layers would be enough. Like you I get a white image.
4. Specifying STYLES= or STYLES=default,default,default changes nothing.
5. Specifying
"wms_style" "default"
for each of the layers in the .map files changes nothing.
6. Specifying
<IsDefault>1</IsDefault>
in the <UserStyle> elements of the SLD together with &STYLES= in the URL
changes NOTHING.
(In the SLD implementation spec. it is stated that if the &STYLES=
parameter
is specified (meaning use default styles) then the SLD style for a layer
is
only to be used if it is *marked* as the default style. Otherwise
MapServer's
internal style shall be used.)
At this point I feel I'm running out of options.
Did you get a positive result with the suggested workaround, my step 5?
Sincere regards,
Roger Jans
System Developer
Combitech AB
Phone: +46 470 42427
Email: roger.jans at combitech.se
More information about the MapServer-users
mailing list