In QGIS, I need to calculate the share of a given field (outlined) that is covered by the blue areas, see the image for illustration. Fields and blue areas are in two separate layers. I did the area calculations for each layer in QGIS, so I have the area in square meters for both the fields and the blue areas.

I already tried spatial join with the mmqgis plugin, but i can't get it to work correctly. For example, the largest blue area, clearly lying within the field in the middle, is not assigned to that particular field in the . Maybe I am just using the plugin wrong.

Any suggestions?


EDIT: It should be mentioned that i used the multipart to singlepart tool on the blue area-dataset, as some of the individual blue areas was "connected" though they looked separate on the map.

Using the intersection tool as proposed, i got a dataset with more rows than the dataset containing the "blue" areas. The image below illustrates a field with two areas, but the dataset has many extra rows, which doesn't seem to correspond to a visible blue field on the map. If i select the rest of the rows, no visible parts of the map lights up.herlev

When i run the intersect tool, it warns me that the two layers doesn't use the same coordinate system. Could this be the problem?

  • Does the Intersect tool work? It might be more appropriate for this type of analysis. – SaultDon Oct 12 '16 at 22:53
  • The intersect tool gives unexpected results, i've described in the edit. – Jesper Oct 13 '16 at 21:24
  • When running any analysis with multiple layers, they should always be in the same projection and coordinate reference system. – SaultDon Oct 13 '16 at 21:27
  • I haven't changed the coordinate systems myself, so it must be the data sources of the two layers whoch are in different coordinate systems. Can this be solved? – Jesper Oct 13 '16 at 21:58
  • Yes, you can re-project one of the layers, so it matches the other one. Simply right click the layer in the layer list and select save as... Then you can select a target projection (the pulldown beside CRS:) in that window so that it matches the other layer. See what projection they currently have by looking in their properties (ie, double click them to open properties window). – SaultDon Oct 14 '16 at 18:03

You need to use intersect tool to intersect field (outline Polygon) with the blue polygon. Then you can calculate the area of the shared parts again. Intersection tool is located in Vector -> Geoprocessing tools -> Intersect in QGIS 2.14.7. In QGIS 2.16.3, intersection tool exists in Processing toolbox -> QGIS geoalgorithms -> Vector overlay tools -> Intersection.

  • The intersect tool gives some problematic results, i've described in the edit above. – Jesper Oct 13 '16 at 21:24
  • You need to convert the blue polygon from singlepart to multipart to have individual part of the blue polygons, and make sure that the projection of both feature class data have the same projection. – ahmadhanb Oct 14 '16 at 1:05

If your blue area polygons do not intersect more than one field polygon then I would probably use the Join attributes by location tool from the Vector menu or from Processing Toolbox. This should output a layer containing fields from both layers including those containing the area.

You can then create another field in this output layer to calculate the percentage share by using an expression like:

("Blue_area" / "Field_area") * 100

If your blue area polygons do intersect more than one field polygon then use the Intersection method as mentioned by @SaultDon and @ahmadhanb.

  • 1
    Some urban areas seem to be cross county. Intersect should therefore work better. – Victor Oct 13 '16 at 12:26
  • @Victor - Yes you are correct, will edit my post to mention this =) – Joseph Oct 13 '16 at 12:28
  • The intersect tool gives some problematic results, i've described in the edit above. I also tried to join attributes by location, but this doesn't include all the areas it should.. – Jesper Oct 13 '16 at 21:25

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.