Difference between revisions of "Editing Vector Data in GRASS GIS"

From CUOSGwiki
Jump to navigationJump to search
Line 64: Line 64:
 
<br />
 
<br />
 
<br />
 
<br />
[[File:mapdisplay1.png|400px]]
+
[[File:mapdisplay1.png|500px]]
 
<br />
 
<br />
 
<br />
 
<br />
Line 70: Line 70:
 
<br />
 
<br />
 
<br />
 
<br />
[[File:layerstab.png|400px]]
+
[[File:layerstab.png|500px]]

Revision as of 20:27, 20 December 2022

Introduction

This tutorial will demonstrate how to do a vector analysis using GRASS GIS. By the end, you should be a little more comfortable using the program. Please note that for this tutorial we are using GRASS 8.2, older versions of GRASS may not reconcile with this tutorial. Our goal is to use the 2020 Red Light Camera Violations data from open.ottawa.ca to make a map that displays the safest areas in Ottawa to drive based on the number of traffic violations. If you do not already have GRASS installed on your computer, you can go to this Intro to GRASS workshop page with detailed instructions on how to download it.

Data

First we will need to download our data. You can download the Ottawa Traffic Collision data here. After you proceed to the link, click the download button, and select "shapefile." Once you have downloaded the Traffic Collision data, click here to download the Red Light violations data.

Getting Started with Grass

Start by launching the GRASS software. You should see three windows, one is a terminal, one is the Map Display, and one is the main interface that includes tabs along the bottom of the window such as "data" and "layer," which we will refer to as the Layer Manager for convenience. You need to add a new "database," which is essentially a folder that you will keep "locations" in. Within the "locations," you will store your mapsets.

By default, you have a database named something similar to "C:\Users\YourUserName\Documents\grassdata."

Once done, go back to the Layer's Interface window in GRASS, and select the "add new location" icon.

GRASS newlocation1.png

Name your location "ottawa_road_safety" and click Next.

Ottawa road safety.png

Select "Select CRS from a list by EPSG or description" and press Next.

Selectingcoordinatesystem.png

Chose NAD27(CGQ77)/UTM zone 19N. This is the ideal projection for the Ottawa area. Select Next, and then Finish.

UTMzone19.png

You should now see a new location in your Layer Manager titled ottawa_road_safety.

Allsetup.png

Before we upload our data in GRASS, open your filefolder on your computer and make sure that the data you downloaded from open.ottawa.ca is in the correct folder location (i.e. C:\Users\YourUserName\Documents\grassdata\ottawa_road_safety\PERMANENT.)

Next, navigate back to the Layers Manager window in GRASS. Ensure that you are working in the correct location by right clicking ottawa_roads_safety and selecting "switch mapsets." Next Select the icon shaped like a "V" to import vector data.

ImportV.png

Select browse, and navigate to where you stored your downloaded data. Select the "Traffic_Collision_by_Location_2019.shp" file and select "Import."

Importingshape1.png

Select "Import and reproject" when prompted.

Reproject1.png

You should now see a display similar to the one below on your Map Display window.

Mapdisplay1.png

Repeat these same steps to import the Red Light Violations data; select the icon shaped like a "V." This time, after you select browse, and navigate to where you stored your downloaded data, select the "Red_Light_Camera_Violations_2019.shp" file and select "Import." At the end you should have two layers in your Layers tab.

Layerstab.png