I am new on QGIS, I will try to be as specific as possible, but it seems quite hard to explain...

I am working with a first polygon vector: species' territories [In the attributes table: 50 lines, for every 50 territories] My second vector-polygon is the land-use type in my region of interest [81 types of habitats in total, corresponding to 81 lines].

I want to know the composition of each territory, and the surface of each land-use type that lie in those territories. [e.g. : 1st territory composed of 10m² of forest, 40m² of grassland etc... 2nd territory composed of 22m² of forest, 0m² of grassland etc...]

First, I clipped both vectors, to have all my land-use types that lie within my territories of interest.
Second, I've calculated the surface of each "patch" of land-use.
Third, I used "Union", input=Territory, Output=Clipped.

My problem is that in the attribute table of this new vector, the result is shown as follows: [3 columns and too many rows !]

1st territory - Forest - 10m²
1st territory - Grassland - 40m² etc...
2nd territory - Forest - 22m²
2nd territory - Grassland - 0m² etc...

enter image description here

While I wanted to have the land-use type as a header, [with 50 lines for the 50 territories, and 82 columns (81 land-use types and 1 for the name of the territories)]:

Name of territory - Forest (m²) - Grassland (m²) - ...    
1st territory     -   10        -    40          -  ...    
2nd territory     -   22        -    0           -  ...

enter image description here

I can recreate by hand a table and reorganize my headers and fill the surface of each but it will take ages and I have a strong feeling that another solution is possible...

I don't know what I am doing wrong here, whether it comes from the geoprocessing tools, or if there is any other tool that I can use to transform the table faster, even with Excel or R.

  • A screenshot or two would really help me visualize your situation! – Stu Smith Jun 16 at 6:13

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.