Recent Searches

Loading Search Results...
Loading Directory Results...
Close

History

Close

Recent Pages

Recent Searches

EIU QGIS Workshop

Add Districts & Points

If you haven't already, add the Chicago neighborhoods polygon districts to your map:

  • Click the Add Vector layer button vector icon
  • Click browse
  • Locate and open the Neighborhoods shapefile

District layer

 

Also make sure the crime data is added:

  • Click the Add Delimited Text Layer Text Icon
  • Locate and open the crimes csv file
  • Right click on the crimes layer to save as a shapefile

Note: Confirm the Coordinate Reference System (CRS) of the two layers are a match. If CRS are not a match, spatial join would be impossible.

Crimes layer  

Look at the attribute table for the crimes data. You should see a field called crimeType containing a categorization of the crime into one of several defined types. 

Crimes Count per District (in polygon)

To determine the number of crimes in each neighborhood, we'll spatial join the crimes count (in points) to the district layer (in polygon).

  • Click on Vector >>> Data Management Tools >>> Join attributes by location

spatial join 1

  • Select Neighborhoods as the Target Vector Layer and crime as the Join vector layer
  • Select take summary of intersecting features in the attribute summary drop-down
  • Type Count in the statistics for summary box
  • Keep all records(including non-matching target records) in the join table drop-down
  • Create a folder to save the joined layer
  • Make sure all boxes are ticked as shown in the image above

The joined layer attribute table should populate the count field as shown below,

spatial_join1_table

 

The joined layer should be as shown below,

Joined layer

 

NOTE:

  • Go ahead to rename the joined layer in the General tab of the layer properties
  • Always check the CRS of each layer especially the joined layer, for any changes

 

In the next section, you'll determine narcotics count.

 

 

 

 

 

Related Pages


Take the next step

apply now
schedule a visit