I have a polygon grid overlaying several other polygon vectors. I wish to visit each polygon in the grid and ask yes/no if each of these layers fall within the grid cell or not. I can do this easily with a spatial query to select the appropriate cells, but I want to have this information returned as a new attribute column, where each of the grid cells has a yes/no (or 1/0) value accordingly. This seems simple but I cannot figure out how to do it.

Thank you very much for any guidance

  • Hi darkness, welcome to GIS.se :) I see you've tagged this for 'qgis'; it's also a good idea to include that in the title or body somewhere. I know it seems like duplication but people have a tendency to not read closely the first time through (or ever). You'll get less off-target answers that way. – matt wilkie May 31 '13 at 21:02

This is indeed very simple:

  • Do a spatial query (with the QGIS spatial query tool) and select the intersecting features
  • Open the attributetable of your polygon-layer, toggle edit mode and open the Field Calculator
  • Create a new field updating only the selected features. See image below. All non intersecting features will now have NULL as default value (which you of course also can modify afterwards). Intersecting features will have the value 1 enter image description here

Your Answer

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

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