Thursday 30 March 2017

qgis - Can I use a polygon to show a WMS-layer inside while maintaining transparency outside?


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?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...