-1

I am working on a project in which it's necessary for me to overlay 2 layers (a map of precincts and a map of census tracts).

I need to be able to determine the %area of each census tract covered by each precinct. For example, if Census Tract 1 is 25% Precinct 1, 40% Precinct 2, and 35% Precinct 3.

How do I go about doing this?

I am using QGIS 3.8 and have the necessary shapefiles.

marked as duplicate by underdark qgis Jul 20 at 8:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Welcome to GIS SE! As a new user please take the tour. What have you tried, and what was the result? Please edit your question to include as much information as possible about your data, what you've tried, and what issues you encounter when you try it. – Midavalo Jul 18 at 17:03
3

This question has been asked and answered here many times, but I can never find those other Q&As when I want to share them. So here's a brief summary. There are more detailed answers, and possibly other methods, elsewhere on this site; maybe you'll have more success at searching for them than I do.

  1. In the census tract layer, use the Field Calculator to calculate original area with the $area function.
  2. Intersect the layers (Vector menu > geoprocessing > intersection).
  3. Use the Field Calculator as in step 1 to calculate the area of each "intersect" polygon.
  4. Use the Field Calculator to divide the new area by the original area and multiply by 100 to convert to a percent value: "new area"/"original area"*100 (substitute the actual field names)
  • Hi, thanks for your response. Sorry if this has been asked before, could you please tell me the terminology I should look up? What is this type of problem called? Additionally, I had some trouble with the method you described above. Where am I supposed to run the expression in step 4) ? When I ran it after opening field calculator on the intersection layer, it returned an error that my variable for original area was not found. How exactly does dividing the new area by the old get me what I need? Especially in a case where a precinct goes across two census tracts? – user146414 Jul 18 at 20:41
  • Unfortunately there's not a consistent terminology for this type of analysis, which is why can have a hard time finding the similar questions. Try searching for "calculate proportional area" or something like that. I found a couple examples: gis.stackexchange.com/q/255256/81764 gis.stackexchange.com/q/297955/81764 – csk Jul 18 at 20:48
  • The intersection tool should preserve the attributes from both layers, but it might change their names, depending on which layer is the "input" and which is the "overlay". Make sure you're using the right field name in the Intersection layer. You can find the field names of the current layer in the Fields and Values section of the Field Calculator help. – csk Jul 18 at 20:51
0

You can (also) achieve this using the DB Manager of QGIS.

You go to : Database / Database Manager / Database Manager then Virtual Layers / Qgis Layers you can then try a query like the following :

SELECT precinct.id, st_area(st_intersection(census_tract.geometry, precinct.geometry))/st_area(precinct.geometry)*100  
from census_tract, precinct
where st_intersects(census_tract.geometry, precinct.geometry)
group by precinct_id

Adapt the tables naming according to your data structure ...

You can then load the result in the layer manager.

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