I am making a map where I want a polygon filled with data from a WMS-service. What is outside the polygon from the WMS should be transparent. I am using QGIS 2.18.4.

It is a bit similar to a question on How do I clip OSM basemap with a polygon? here on GIS Stackexchange, but the solution there (inverting a polygon manually) is not sufficient. Neither would the more up to date visualization tool "Inverted polygons" be of any immediate help.

Example 1) In this example I have two WMS-layers. One in colors and one in gray. I want to use the polygon to separate the gray and color WMS-layers so that the focus area is in colors while the area around is gray. It can be accomplished in part with setting the color to gray and then playing around with transparency and/or Layer blending mode. You get the idea, but the other (gray wms-layer) does not get into play.

enter image description here

Example 2) This is the clearest illustration. Here I have a marine management areas layer where I want to highlight fisheries activities. The fisheries activities are from a WMS-layer with the Norwegian Coastal Administration. I do not want to show the fisheries activities in the area outside the marine management areas.

Using the first example the below image shows how I am stuck at where I get to mask out the area around the focus area. I want the blue area to mask out the color wms, and only show the gray one.

enter image description here

I can not find any way of connecting the masking layer to just one of the layers underneath. Is there a way to do this?

  • 1
    Please clarify why the inverted polygon renderer is no help – underdark Mar 10 '17 at 16:55
  • Noted @underdark - have tried to clarify. – ragnvald Mar 10 '17 at 17:47
  • Is it not possible with SLD – nmtoken Mar 10 '17 at 18:30
  • 1
    So you want the base map to display in color inside your polygon, but display in grayscale outside the polygon? I wonder if there's a way to make a mask layer that converts underlying layers to grayscale. – csk Apr 5 '17 at 18:11
  • If it was only about getting a grayish mask this can easily be done with inverted polyhons. Either 1) by setting it gray and then manipulating the transparency. Or 2) by playing around with different maskings. I fo however want to select a completely different wms-layer. – ragnvald Apr 5 '17 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.