Difference between revisions of "Analyzing Crime Data in Ottawa using QGIS"
Selimerguden (talk | contribs) |
Selimerguden (talk | contribs) |
||
Line 61: | Line 61: | ||
[[File:additionals.png|700px]] |
[[File:additionals.png|700px]] |
||
+ | |||
+ | |||
+ | ===Using Style and Diagram Functions under Layer Properties=== |
||
+ | |||
+ | ====Style Function==== |
||
+ | Under Style there is a dropdown menu, which the Single Symbol, Categorized, Graduated, Rule Based, Point Displacement, Inverted Polygons and Heat Map can be selected. For the purpose of this tutorial I am mainly going to focus on the Graduated Style. |
||
+ | |||
+ | =====Single Symbol===== |
||
+ | Single Symbol Function is useful for showing the features without any categorization. As an example below: Map of Ottawa without any categorization. |
||
+ | |||
+ | [[File:mapottsingle.png|700px]] |
Revision as of 14:24, 16 December 2015
Contents
Introduction
The main purpose of this tutorial was to determine the criminal trends based on the spatial locations in Ottawa using open source software. The QGIS was selected for the purpose of this tutorial it can be downloaded from: (https://www.qgis.org/en/site/forusers/download.html). The data includes many different crimes occurred in Ottawa from 2005 to 2013. The spatial locations include: Orleans, Innes, Barrhaven, Kanata North, West-Carleton March, Stittsville-Kanata West, Bay, College, Knoxdale-Merivale, Gloucester-Southgate, Beacon Hill-Cyrville, Rideau Vanier, Rideau-Rockcliffe, Somerset, Kicthissippi, River, Capital, Alta Vista, Cumberland, Osgoode, Rideau-Golbourn, Gloucester-South Nepean and Kanata South. Some of the crimes include: Total Criminal Code of Canada (CCC) including Traffic, Total Criminal Code of Canada (CCC) excluding Traffic, Crimes against Person, Total number of Homicides, Total Number of Attempted Murders, Total Number of Robberies and Total Number of Assaults (including Sexual Assaults), Total Number of Other Sexual Offences, Number of Abductions, Total Number of Uttering Threats or Intimidation Offences, Total Number of Other Crimes.
Where to get the data?
Based on the statistical data that the City of Ottawa Police Services provided, the Carleton University staff at the MADGIC desk created the shafiles and it was downloaded from the MacOdrum Library website. It is an open source data no login information is required. Retrieved from: http://madgic.library.carleton.ca/deposit/GIS/Crime_Statistics.zip
Loading the Dataset into the QGIS
First step was to select Add Vector Layer symbol. Second step was to use Browse function to locate the data. Finally all shp files were selected from the Crime Wards Shp folder and loaded to the QGIS.
Layer Properties
Layers Properties can be opened by right clicking any of the layers and selecting properties. Right clicking the Layer Properties would bring up the following screen.Layer Properties include: General Settings, Style, Labels, Fields, Rendering, Display, Actions, Joints, Diagrams and Metadata.
General Settings
Under General Settings:
- Layer name can be modified and displayed as something else
- Layer source can be modified
- Data source encoding can be changed (System, Windows, and Macintosh etc.)
- Coordinate Reference System can be changed
- Scale dependency can be turned on to restrict the minimum and the maximum scale
Labels
Labels can be turned on turned and displayed for any columns. Labels Settings include:
- Text (to modify the size, font style, transparency, color and style of the text)
- Formatting (to modify the line height and alignment)
- Buffer
- Background (to modify the background settings)
- Shadow
- Placement (to modify the placement such as: offset from centroid, offset centroid, around centroid, using perimeter, horizontal and free and to set up priority for the text)
- Rendering (to perform scale based visibility and pixel based visibility etc.)
Fields
Using the field properties fields can be edited, and new fields can be created using field calculator. New output-field name, output-field type, output-field width and output-field precision should be determined when creating a new column. As an example new field called “area” is created, which is under geometry function called “$area”. It is going to be used to determine the population density because the data does not have that information, it only has total population. (Area/ 1000000 was used to get the area km^2 value)
Creating the population density field
The total population divided by the total area would give us the population density. This process needs to be done for each layer that is going to be used. I am going to repeat the same process for the 2010 and 2013 layers so that the comparison between those layers can be done. If you want to use other layers rather than 2005, 2010 and 2013, area calculation and population density needs to be done for the interested layers.
Rendering
Rendering can be done to simplify the geometry. Simplification threshold can be customized, and the scale can be set up for rendering process.
Additional Settings under Layer Properties
Additionally Display Settings, Actions, Joints and Metadata can be accessed under Layer Properties.
Using Style and Diagram Functions under Layer Properties
Style Function
Under Style there is a dropdown menu, which the Single Symbol, Categorized, Graduated, Rule Based, Point Displacement, Inverted Polygons and Heat Map can be selected. For the purpose of this tutorial I am mainly going to focus on the Graduated Style.
Single Symbol
Single Symbol Function is useful for showing the features without any categorization. As an example below: Map of Ottawa without any categorization.