11

I have two collections of shapefiles:

1 - postal codes, administrative and political areas

2 - various land use categories like parks & allotments, and points like trees

I want to produce statistics on the area of those land use categories broken down by postal code, admin & political area, and the number of points by the same means. For example, there are 4.1ha of park in SE15, 879 trees in SE22, and so on.

I am using QGIS. I've processed my raw data to get all the shapefiles ready, but after much fruitless searching around on this and other web sites I can't see a way to do this.

2
  • 1
    is it a matter of finding points within polygons, or polygons within polygons? if so you can use the research tools. – Ger Oct 30 '12 at 12:37
  • From Livermore about 1962 ... : cap-lore.com/MathPhys/IP – Norman Hardy Aug 3 '17 at 23:01
8

The "Join Attributes by Location" is quite suitable for this purpose.

Suppose we have a Parks and PostCodes shapefiles in the map as shown in display. Parks have an "Area" field and PostCodes have "ZipCode" field. The values are as per the labels displayed in map. We will try to find the sum of area of parks in every zip polygons.

enter image description here

From Vector > Data Management Tools > Select "Join Attributes by Location" tool

Set parameters as shown in figure so that we can find the sum of area of Parks in every PostCode Polygons and also find the sum of Parks in every Polygons.

see field structure below..

enter image description here

From Vector > Data Management Tools > Select "Join Attributes by Location" tool

give attributes as shown in figure so that we can find the sum of area of Parks in every PostCode Polygons and also find the sum of Parks in every Polygons.

enter image description here

The output will be a shapefile identical to the PostCodes shapefile in geometry, but the attributes will be reflect the output of the previous operation.

enter image description here

2
  • 1
    What if parks are not wholly contained within each postcode polygon? – Simbamangu Oct 30 '12 at 13:16
  • 2
    Union geoprocessing tool is the answer, then... See following answer by @Simbamangu! – wiltomap Oct 8 '15 at 6:39
6

To calculate the area of intersecting polygons:

  1. Vector|Geoprocessing Tools|Union and select the two layers and and output filename, then OK to calculate. Confirm 'yes' to add the new layer to the TOC.
  2. The new layer will show all the areas of each layer, cut by all overlapping edges, and all the attributes of each layer will be included where they overlap (and NA where not).
  3. Calculate the areas of the polygons - you may need to use UTM or another appropriate projection - using the field calculator ($area / 1000000).
  4. I'd then open the DBF file in a spreadsheet and use a pivottable to look at the sum of areas for each of the characteristics you are interested in - for example, using postcodes as columns and land use as rows, with 'sum of area' as the value.

enter image description here

To get points contained in polygons:

  1. Do a spatial join - Vector|Data management tools|Join by location, selecting the points layer as the target and the polygons as the join vector layer;
  2. The resulting layer will attach the attributes of the polygons to the points which they overlap;
  3. Again, open in a spreadsheet and use a pivottable, using 'count' instead of 'sum' for any of the point attributes to show how many points lie within each type of area.
0

Here is a very simple way of doing this with QGIS 3.14

  1. Vector|Geoprocessing Tools|Union | and select the two layers and and output filename, then OK to calculate. Confirm 'yes' to add the new layer to the TOC.
  2. Vector | Geometry Tools | Add Geometry Attributes | and select the unioin layer created in 1st step.
  3. Open Attribute layer and see the area column. Thats the intersecting area.

You can use the Intersection tool and follow same procedure to avoid null values. 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.