![]() Maximise the options for “Fields and Values” under the “Function list”.Select the “POPDENS” field from the field dropdown options.Check the “Update existing field” option.Toggle editing mode by click the button with a pencilĪ new column should now appear in the attribute table.Right click the “SubPlace” layer in the TOC’.The formula being number of people living in the land parcel divided by the area of said land parcel. Population density is a measure of the number of people living per area unit. Area and perimeter calculations will now be in meters. For that reason I have set the Project CRS to the projected CRS “Transverse Mercator using the 19 th meridian with the WGS84 ellipsoid and datum. ![]() In this example I can’t use my layer CRS as it is a Geographic coordinate system and the area would be calculated in decimal degrees. Set the “Project CRS” as the CRS to use in the calculation.Set the “Input vector layer” as “SubPlace”.In order to calculate population density we will need to calculate the area for each polygon feature and then divide the number of people of that feature by this area. The field named “Gender_Total” is the total population. If you open the attributes table of your layer you should see a few extra fields which are the virtual link to the “Gender” table. Select the Option to “Cache join layer in vitual memory”.Set the Join field as “CODE” (or your unique ID).In QGIS table joins are performed from the layer properties window. The “CODE” is a unique ID that will be used to link the table records to the relevant polygon features with the same ID. In this example I have added a table called “Gender” which is a results table saved as a csv from the “STATSSA Census 2011” query tool.įigure 5 shows the “Gender” table which has the four columns or fields CODE, Male, Female and Total. Select the file type csv or “comma separated value”Ī new csv table will be added to the TOC.Our first step is to add the csv file to the project using the “Add vector layer” button. We will now perform a table join between the “SubPlace” layer and a csv file. In the same way we can use the “Query Builder” to display “Local Municipalities” of the Western Cape. In this example the layer “Provinces” will now only display the features with the values “Western Cape” for the PROVINCES field. Click the “All” button under “Values” to show all the “PROVINCIAL” field attributes.Double click “PROVINCE”to add it to the expression window.Here we will enter our expression that will either include or exclude the features based on their attributes. This will open the “Query Builder” window. Scroll down to reveal the “Query Builder”.Right click your layer in the Table of Contents, TOC.In this example we will use it to display the “Western Cape”. The first task will be to use “Query Builder” to define features with a specific attribute. This tutorial was created using QGIS 2.6 Brighton. Should you like a copy of the project files used in this example please contact me. Please substitute your layer and field names for the ones used here. Note: You will need your own data to perform the tasks in this tutorial. Lastly we will use the population data to determine the layers population density. We will also link a csv file with population figures to an existing layer. In this brief tutorial we will use the query builder to display features with a specific attribute.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |