Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I also posted this question on stackoverflow.


I successfully overlayed a WMS layer in google maps v3, however, as the information on tiles is black on transparent, it is not well seen on dark background (like satellite map), see some tile for example:

http://geoportal2.uhul.cz/wms_oprl/?SERVICE=WMS&REQUEST=GetMap&SERVICE=WMS&VERSION=1.1.1&LAYERS=HMLCR&FORMAT=image/png;%20mode=24bit&FGCOLOR=0xFF0000&TRANSPARENT=TRUE&SRS=EPSG:4326&BBOX=16.58935546875,49.37522008143603,16.600341796875,49.38237278700955&WIDTH=256&HEIGHT=256&STYLES=

(This was the WMS link to retrieve that tile)

Question: how to modify the above WMS request to change the foreground color (currently black) to some custom color (e.g. red)? In other words, how to style the layer? The server is apparently able to do it for this layer, since it is possible to do it via their web map application (which works in IE only), where you can select the color. See this map image for example:

enter image description here

(The following link was used to retrieve the image - note that it contains scale and logo, so it's not a proper tile.)

Unfortunatelly, this web application doesn't use WMS to get this styled map so I can't just copy the styling parameters to WMS request. I must do the styling via the WMS request (because this other request format is proprietary, retrieves whole map - not designed for tiles - and it doesn't seem to support WGS coordinates) - how shall I do it?

I tried to:

  1. look at the WMS documentation, especially version 1.1.1
  2. look at the SLDs, but it seems pretty complex thing to grasp...
  3. look at the GetCapabilites command output for the WMS server
  4. Also, having look at DescribeLayer and GetStyles command outputs for my desired layer (HLMCR) I don't even know if this layer will support styling over WMS...

I got lost, I'd be grateful if you point me to the right direction - or information if it's even solvable in WMS (for this layer).

"It's not possible" is also a useful answer for me!

Thanks in advance.

share|improve this question
1  
I have posted an answer over at SO. Please note this way of cross posting, while it might be not in violation of any of the site rules, should not be used. A better solution would have been to ask a site admin to move the question over here at GIS.SE. –  unicoletti Dec 3 '11 at 10:42
    
@unicoletti, I don't want to move it, since I might get useful answers at SO too. Moreover, I placed a bounty there. –  Tomas Dec 3 '11 at 10:48
    
Just repost or provide a link to the correct answer if/when you mark one as accepted on the other site. –  R Thiede Dec 6 '11 at 6:54
add comment

2 Answers 2

You really need to learn about SLD (yes I know it looks complex but it's quiet simple really) I'd start with http://docs.geoserver.org/stable/en/user/styling/sld-cookbook/index.html. Even if it doesn't work out with this server if you intent to play with styling WMS layers it is the only game in town. Once you have a rough idea of what you want get and read the standard.

You need to check if the server you are interested in can consume remote SLDs (check the getCapabilities response for the "UserDefinedSymbolization" ).

Another option might be to fetch the data as a WFS and style it in your server (or client) but it looks like a raster to me.

share|improve this answer
add comment

To help you grasp the SLD language, you could download the installer for GeoServer at geoserver.org and use the Styler tool. It'll allow you go visually manipulate your styles and save the SLD.

I'd suggest you create a simple SLD and peruse the XML so you gain an understanding of SLD.

I used this method to help me understand SLD.

Good luck!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.