1

another QGIS newbie here. I have a number of smaller polygons which perfectly aggregate to a larger polygon. I want to "tag" the smaller polygons with the ID of the larger polygon they make up. Unfortunately when I used spatial join many of the smaller polygons were incorrectly joined to the large polygon they were adjacent to - rather than the large polygon they were contained by (all polygons are contiguous). The larger polygons were created using "dissolve" from the smaller polygons, so there shouldn't be a problem in compatibility of the geometries.

In MapInfo you would use a spatial join term like "contained by" or "within" for this. What is the equivalent in QGIS to restrict the spatial join to large polygons the smaller polygon is entirely, or at least primarily, within?

PS I have managed to partially work around this by creating centroids and then tagging them. However, that is somewhat unsatisfactory, and doesn't work where the polygons are strange shapes, meaning the centroid is actually outside the polygon.

  • PS I have managed to partially work around this by creating centroids and then tagging them. However, that is somewhat unsatisfactory, and doesn't work where the polygons are strange shapes, meaning the centroid is actually outside the polygon. – user35123 Jul 28 '14 at 14:54
  • Oh, and the larger polygons were created using "dissolve" from the smaller polygons, so there shouldn't be a problem in compatibility of the geometries – user35123 Jul 28 '14 at 15:03
  • Feel free to "edit" your post as opposed to using the comments, this will make it easier for other users to find the relevant information :) Comments are usually reserved for further clarification from the answerees – GISKid Jul 28 '14 at 15:10
  • I think you might like to look into PostGIS. ST_Contains() will definitely help out here. You may have installed PostGIS as part of your QGIS package. – ike Jul 29 '14 at 23:25

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.