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've created a GP tool using ArcGIS that creates an "area of interest" mask from selected features. Effectively it creates a new donut polygon layer where the hole was the previously selected features. Can I replicate this task in QGIS?

Example: For a specific map, I want to highlight a county within the state and mask the rest of the state and features outside the county with a gray, semi-transparent polygon layer above. Conceptually I would do it similar to this.

  1. User loads state, county, and river layer
  2. User selects county of interest
  3. Run a utility (if it exists) that exports all of the unselected features to a donut shapefile without the originally selected polygon. If this layer mask was an "in memory" layer only available to QGIS, that would be just fine, too, maybe even better.

Does this type of tool or capability already exists within QGIS or will I have to write this as a custom function?

Here is how I did it in ArcGIS with ModelBuilder and the result I would be looking for, where the yellow layer and river layer exists statewide (all the way across the image), and the gray layer is transparent with a "donut hole", allowing the bright yellow portion to display through and draw the viewers attention the the area of interest:

enter image description here enter image description here

share|improve this question
add comment

3 Answers 3

To create a mask, I'd suggest using Polygon from layer extents (vector - research tools) and Difference (vector - geoprocessing tools) with "use only selected features" option activated.

If you really want to "exports all of the unselected features to a donut shapefile", you could try Dissolve, but it's quite slow and you might end up with suboptimal results like tiny holes etc.

Creating on big polygon with polygon from layer extents tool and then cutting out the selected county should be much faster.

share|improve this answer
add comment
up vote 5 down vote accepted

Thank you @underdark for your direction to this solution. The fTools function "Difference" was exactly the tool that accomplished the task. However, different from your suggestion, I did not have to 1st create the "Polygon from Layer Extents".

Instead, the solution was:

  1. Load the data layer (counties)
  2. Select the feature of interest (County A)
  3. Use the Vector->Geoprocessing->Difference tool
  4. Select the county layer as both inputs, "use selected features" checked OFF for Input Vector Layer, ON for Difference Layer.

enter image description here

This will give the layer with all features from the input included EXCEPT the selected feature(s). Thanks!

share|improve this answer
    
An upvote would be "thank you" enough ;) –  underdark Mar 11 '11 at 20:35
    
Of course, I would be happy to. –  RyanDalton Mar 11 '11 at 21:20
add comment

The Symmetrical Difference in QGIS 1.6 located in Vector>Geoprocessing Tools>Symmetrical Difference (standard core tools) should generate your mask from two input polygons...

enter image description here

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.