Skip to content
  • Home
  • About
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
  • Contact Us
Geoscience.blogYour Compass for Earth's Wonders & Outdoor Adventures
  • Home
  • About
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
  • Contact Us
Posted on December 28, 2022 (Updated on July 21, 2025)

Selecting only polygons that contain another polygon with Select by Location in QGIS

Hiking & Activities

Unlocking Spatial Secrets: How to Find Polygons Hiding Other Polygons in QGIS

Ever feel like your GIS data is holding back on you? Like there’s a secret layer of information just waiting to be uncovered? Well, you’re probably right! QGIS, that amazing open-source GIS powerhouse, has a trick up its sleeve called “Select by Location” that can help you find exactly that. And today, we’re going to crack the code on how to use it to find polygons that are playing host to other polygons. Think of it like finding Russian nesting dolls, but with maps!

So, what’s this “spatial relationship” business all about? Basically, it’s how GIS figures out if things are near each other, on top of each other, or, in our case, inside each other. “Select by Location” is the tool that lets you ask QGIS questions like, “Hey, which of these areas contain a school?” or, “Which counties have a river running through them?” It’s powerful stuff.

Now, the key to our polygon-finding mission is understanding the word “contains.” It’s not just about two shapes bumping into each other. When polygon A “contains” polygon B, it means polygon B is completely chilling inside polygon A, like a little shape within a bigger shape. Forget “intersects” – that’s just a polite hello. And “within” is the opposite game – we want the big guy.

Alright, let’s get our hands dirty. Here’s how you can become a “Select by Location” master:

  • Load Up Your Layers: First things first, fire up QGIS and load the two polygon layers you want to play with. Think of one as the container (the big one) and the other as the containee (the little one).
  • Find the Magic Tool: Head over to Vector > Research Tools > Select by Location. This is where the fun begins!
  • Tell QGIS What You Want: This is where you set the rules.
    • “Select features from”: Pick the layer you want to select from – that’s your “container” layer.
    • “Where the features”: Choose “contains” from the dropdown. This is the secret sauce!
    • “Compared to the features from”: Now, select the layer that might be inside the other one – your “containee” layer.
  • Hit “Run” and Watch the Magic Happen: QGIS will highlight all the polygons in your “container” layer that have a “containee” polygon nestled inside. Ta-da!
  • Admire Your Handiwork: Check out the map! The selected polygons will be highlighted. You can also peek at the attribute table of your “container” layer to see which features were selected.
  • Okay, so why should you care? Here are a few real-world scenarios where this trick can save the day:

    • City Planning: Imagine you need to know which city council districts (the big polygons) have parks (the smaller polygons) within their boundaries. Boom! “Select by Location” to the rescue.
    • Saving the Planet: Let’s say you’re tracking wetlands and want to know which watersheds contain them. This tool makes it a breeze.
    • Real Estate Gold: Trying to find properties that have protected natural areas smack-dab in the middle? This is your shortcut.
    • Managing Resources: Need to know which management zones include critical animal habitats? You guessed it – “Select by Location.”

    A few things to keep in mind:

    • Overlapping Mayhem: If your “containee” polygons are a bit messy and overlap, any “container” polygon that has any part of those overlapping polygons inside will get selected.
    • Big Data Blues: Got a massive dataset? “Select by Location” can take a while. Spatial indexes are your friend here – they help QGIS speed things up.
    • Other Options: “Select by Location” is great, but sometimes a spatial join might be a better fit, especially if you need to copy information from the “containee” layer to the “container” layer.

    In conclusion, mastering “Select by Location” and the “contains” predicate is like unlocking a secret level in QGIS. It lets you ask powerful questions about your data and get answers that would otherwise take hours to find. So go forth, explore your geospatial data, and uncover those hidden polygon relationships! You might be surprised at what you discover.

    You may also like

    Field Gear Repair: Your Ultimate Guide to Fixing Tears On The Go

    Outdoor Knife Sharpening: Your Ultimate Guide to a Razor-Sharp Edge

    Don’t Get Lost: How to Care for Your Compass & Test its Accuracy

    Disclaimer

    Our goal is to help you find the best products. When you click on a link to Amazon and make a purchase, we may earn a small commission at no extra cost to you. This helps support our work and allows us to continue creating honest, in-depth reviews. Thank you for your support!

    Categories

    • Climate & Climate Zones
    • Data & Analysis
    • Earth Science
    • Energy & Resources
    • Facts
    • General Knowledge & Education
    • Geology & Landform
    • Hiking & Activities
    • Historical Aspects
    • Human Impact
    • Modeling & Prediction
    • Natural Environments
    • Outdoor Gear
    • Polar & Ice Regions
    • Regional Specifics
    • Review
    • Safety & Hazards
    • Software & Programming
    • Space & Navigation
    • Storage
    • Water Bodies
    • Weather & Forecasts
    • Wildlife & Biology

    New Posts

    • Michigan’s Towering Giants: The Story of the State’s Tallest Tree
    • Reebok Work All-Terrain: Can This Trail Shoe Conquer the Concrete Jungle?
    • Cartoon Sharks Lightweight Water Shoes – Buying Guide
    • The Relentless Force of Nature: How Frost Weathering Shapes Our World
    • ARIAT Sport Stonewall: A Western Boot That Bridges Work and Weekend
    • Backpack Review: Tornado Thunderstorms – Style Meets Practicality?
    • The Relentless Power of Ice: How Frost Weathering Cracks Rock
    • Arkansas Crossbody Backpack Casual Travel – Is It Worth Buying?
    • Macaw Parrot Water Shoes: Dive In or Doggy Paddle? (A Hands-On Review)
    • WZYCWB Submarine Double Layer Fishermans Suitable – Honest Review
    • Under Armour 1386560 25 3XL Woven Cargo – Tested and Reviewed
    • Niagara Falls: How Quickly is This Natural Wonder Really Changing?
    • Hydrangea Hat: Blooming Style and Practicality Under the Sun!
    • YUYUFA Outdoor Sports Climbing Backpack: A Budget-Friendly Option for Casual Adventures

    Categories

    • Home
    • About
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • Contact Us
    • English
    • Deutsch
    • Français

    Copyright (с) geoscience.blog 2025

    We use cookies on our website to give you the most relevant experience by remembering your preferences and repeat visits. By clicking “Accept”, you consent to the use of ALL the cookies.
    Do not sell my personal information.
    Cookie SettingsAccept
    Manage consent

    Privacy Overview

    This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
    Necessary
    Always Enabled
    Necessary cookies are absolutely essential for the website to function properly. These cookies ensure basic functionalities and security features of the website, anonymously.
    CookieDurationDescription
    cookielawinfo-checkbox-analytics11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics".
    cookielawinfo-checkbox-functional11 monthsThe cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional".
    cookielawinfo-checkbox-necessary11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary".
    cookielawinfo-checkbox-others11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other.
    cookielawinfo-checkbox-performance11 monthsThis cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance".
    viewed_cookie_policy11 monthsThe cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data.
    Functional
    Functional cookies help to perform certain functionalities like sharing the content of the website on social media platforms, collect feedbacks, and other third-party features.
    Performance
    Performance cookies are used to understand and analyze the key performance indexes of the website which helps in delivering a better user experience for the visitors.
    Analytics
    Analytical cookies are used to understand how visitors interact with the website. These cookies help provide information on metrics the number of visitors, bounce rate, traffic source, etc.
    Advertisement
    Advertisement cookies are used to provide visitors with relevant ads and marketing campaigns. These cookies track visitors across websites and collect information to provide customized ads.
    Others
    Other uncategorized cookies are those that are being analyzed and have not been classified into a category as yet.
    SAVE & ACCEPT