Difference between revisions of "Digitizing in QGIS"
m (→What is Digitizing?: typo) |
TylerCoade (talk | contribs) |
||
Line 34: | Line 34: | ||
Digitizing in the realm of GIS is simply the act of taking a piece of geographic information, such as a map or raster image, and turning it into vector information. This process has existed since the advent of GIS in an analog format. This old manual technique involved a table (digitizing tablet) and a puck, which was a handheld mouse like device that the operator used to created points, polylines and polygons. This technique was mostly used to import existing physical paper maps and aerial images into a machine readable format. Luckily, we’ve come a long way since the juvenile stages of GIS, and there are now several pieces of software we can use to perform digitizing on digital images and maps; including open source options like QGIS. |
Digitizing in the realm of GIS is simply the act of taking a piece of geographic information, such as a map or raster image, and turning it into vector information. This process has existed since the advent of GIS in an analog format. This old manual technique involved a table (digitizing tablet) and a puck, which was a handheld mouse like device that the operator used to created points, polylines and polygons. This technique was mostly used to import existing physical paper maps and aerial images into a machine readable format. Luckily, we’ve come a long way since the juvenile stages of GIS, and there are now several pieces of software we can use to perform digitizing on digital images and maps; including open source options like QGIS. |
||
− | ==Why is Digitizing Important?== |
+ | ==Why is Digitizing Important and What is its Purpose?== |
Digitizing is important because it lets use do inquiries on the geometry of the produced vector data. For example, we can query the area of a polygon or length of a polyline. We can also do statistical operations on these queries, like determining the mean area of all the polygons belonging to one ground type class. It also makes the image more readable by classifying ground features. |
Digitizing is important because it lets use do inquiries on the geometry of the produced vector data. For example, we can query the area of a polygon or length of a polyline. We can also do statistical operations on these queries, like determining the mean area of all the polygons belonging to one ground type class. It also makes the image more readable by classifying ground features. |
||
+ | |||
+ | Often times aerial images are taken of landscapes however, boundaries between land-use classes are often quite difficult to see without any visual modifications. Not only does digitizing help visualize spatial data, but it also often allows for much more interpretation. Converting aerial image data into vector shape files opens up possibilities for a wide variety of spatial analysis. |
||
==Data== |
==Data== |
||
− | The data for this tutorial are extracted from an aerial photo that was retrieved from ([[https://library.carleton.ca/find/gis/geospatial-data/carleton-campus-aerial-images]]| https://library.carleton.ca/find/gis/geospatial-data/carleton-campus-aerial-images), Were using the “2017 orthophotos - City of Ottawa (20cm)” theme however any will do. |
+ | The data for this tutorial are extracted from an aerial photo that was retrieved from ([[https://library.carleton.ca/find/gis/geospatial-data/carleton-campus-aerial-images]]| https://library.carleton.ca/find/gis/geospatial-data/carleton-campus-aerial-images), Were using the “2017 orthophotos - City of Ottawa (20cm)” theme however any will do. For the purpose of familiarity, the image we will be using is a 20cm resolution aerial images of Carleton University from 2017. The steps in this tutorial can be accomplished with any georectified aerial image. |
[[File:Ortho Image Location.png]] |
[[File:Ortho Image Location.png]] |
||
+ | ==Choosing Another Aerial Image== |
||
+ | After opening up the interactive map of Ottawa, please consider your area of interest as this will have huge implications on the success and effectiveness of your digitizing project. Some areas in Ottawa, especially in downtown are quite dense therefore they often require many different classes and this could negatively effect your efforts. However, if you choose an aerial image with a bland variety of land-use, you might not be able to come up with enough classes. When choosing an aerial image, please think about possible classification schemes and aim for around 5-7 different classes as this will generally look the most pleasing. Please refer to the example below regarding an ideal image for digitizing: |
||
+ | |||
+ | [[File:IdealAI.jpg]] |
||
+ | |||
+ | ==Choosing the Correct Coordinate System== |
||
+ | |||
+ | After you have imported your aerial image, it is crucial that you check the meta-data of the file and ensure that it is being projected in the proper coordinate system. In our case, we are analyzing a photo of Ottawa therefore we should be using NAD 84 MTM Zone 9. If digitizing multiple images make sure they are all using the same and most appropriate coordinate system. |
||
==Methods== |
==Methods== |
||
Line 82: | Line 92: | ||
**A window titled "Coordinate reference system selector" will open and within the filter search bar you can search for the appropriate coordinate system for the image you are using. For an aerial image of Ottawa the coordinate system will be MTM zone 9. Once you have selected your coordinate system click "Ok" and "Apply". |
**A window titled "Coordinate reference system selector" will open and within the filter search bar you can search for the appropriate coordinate system for the image you are using. For an aerial image of Ottawa the coordinate system will be MTM zone 9. Once you have selected your coordinate system click "Ok" and "Apply". |
||
[[File:Setting the Projection2.JPG]] |
[[File:Setting the Projection2.JPG]] |
||
+ | ==Determining Land-Type or Land-use Classes== |
||
+ | |||
+ | Prior to digitizing your aerial image, you must determine the classes that you will be using for the project. The types of classes often rely on two factors: the quality of the image and the amount of detail you would like to visualize. When determining land-use classes for a large agricultural landscape, you might have different levels of detailed classes that would allow the map reader to easily distinguish between areas on the digitized area. A specific range of classes could be very useful for determining different crop types, forest land or wetlands. However, when you are digitizing aerial images within a city, you must generalize to a certain extent. This generalization allows for your map to be visually pleasing while encompassing the most important items. Classes become broader such as residential areas, commercial areas, and parks. In our case, we are digitizing an aerial image of a residential area in Ottawa therefore we will use basic classes. |
||
+ | |||
+ | We will use the following classes in our digitized map as it would make the map aesthetically pleasing and effective: |
||
+ | |||
+ | 1) Rails |
||
+ | 2) Roads |
||
+ | 3) Water |
||
+ | 4) Commercial |
||
+ | 5) Residential |
||
+ | 6) Grass |
||
+ | 7) Shopping |
||
+ | 8) Parks |
||
+ | 9) School |
||
+ | |||
+ | |||
+ | Please refer to the image below if you are having difficulties determining classes for your project: |
||
+ | |||
+ | [[File:LanduseOptions.PNG]] |
||
===Digitizing - Polylines=== |
===Digitizing - Polylines=== |
||
Line 159: | Line 189: | ||
*To insure the edits have been made correctly right click on the “Buildings” layer in the “Layers Panel” and click the “Open Attribute Table” option |
*To insure the edits have been made correctly right click on the “Buildings” layer in the “Layers Panel” and click the “Open Attribute Table” option |
||
**“StPatricks” should appear in the attribute table |
**“StPatricks” should appear in the attribute table |
||
+ | |||
+ | *When digitizing your aerial image with polygons, often times we find ourselves making small mistakes which often leave us deleting our work and starting again. However, if you have misplaced a few nodes on a polygon, you have the option to rotate the entire vector feature to better fit the intended area. Please refer to the screenshot below for context: |
||
+ | |||
+ | [[File:QGISRotate.png]] |
||
===Digitizing - Points=== |
===Digitizing - Points=== |
||
Line 217: | Line 251: | ||
*Within each layer, there should be a corresponding attribute table, right click and select open attribute table. |
*Within each layer, there should be a corresponding attribute table, right click and select open attribute table. |
||
[[File:attributetable.png]] |
[[File:attributetable.png]] |
||
+ | |||
+ | ==Querying your data== |
||
+ | After you have finished digitizing the image, spatial analysis can be conducted easily to any of the classes that you have just created. By creating new shape files for each class, you will be easily able to query certain land-cover and analyze them individually. In our case, each road, park, residential neighborhood, and water body will have its own shapefile therefore you can effectively work using those vector files. |
||
==Conclusion== |
==Conclusion== |
Revision as of 11:53, 3 October 2020
Contents
- 1 Purpose
- 2 Objective
- 3 Software
- 4 Installing QGIS for Digitizing
- 5 What is Digitizing?
- 6 Why is Digitizing Important and What is its Purpose?
- 7 Data
- 8 Choosing Another Aerial Image
- 9 Choosing the Correct Coordinate System
- 10 Methods
- 11 Determining Land-Type or Land-use Classes
- 12 Querying your data
- 13 Conclusion
Purpose
The purpose of this tutorial is to demonstrate the process of creating a vector model by digitizing an aerial image within QGIS.
Objective
The objective is to retrieve an aerial image of the City of Ottawa and using QGIS software digitize the different land use cover classes and geographical features within the photo.
Software
The software that will be used for this tutorial is QGIS 3.4. QGIS is a user friendly open source geographic information system, it runs on Linux, Unix, Mac OSX, Windows and Android and supports numerous vector, raster and database formats and functionalities. The software can be downloaded at [| QGIS].
Installing QGIS for Digitizing
There are several versions of QGIS available for download. For the purposes of this tutorial, we will be using the long-term release version (QGIS 3.4). Follow this link ([| QGIS Download]) to the QGIS site. Insure that you’re on the “Instillation Download” tab. (Figure 1) There are three versions of the QGIS installer available in this tab. The first is a network installer which is not needed for our application. The other two are the latest release (Version 3.8) and the long-term release (Version 3.4). We will be using the long-term release because it provides the most stability and is more widely used due to it receiving major updates less frequently.
Click on the “QGIS Standalone Installer Version 3.4 (64 bit)” to begin installing the program. (Figure 2)
Once the download is complete, simply open the installer and allow it to open. You’ll then be presented with a setup wizard. (Figure 3) Simply click next and agree to the subsequent Licensing Agreement. Then set your file to whichever destination you wish. If you don’t know where you want your QGIS to go, simply leave the default value in place.
The final prompt before install will be titled “Choose Components”. For the purposes of this tutorial, all that is required to be checked is the “QGIS” component. All others can remain blank. (Figure 4) Finally, click the “Install”, this should take 10-15 minutes. Once this is complete, simply hit the “Finish” button. Now you can launch the QGIS Desktop and get started.
What is Digitizing?
Digitizing in the realm of GIS is simply the act of taking a piece of geographic information, such as a map or raster image, and turning it into vector information. This process has existed since the advent of GIS in an analog format. This old manual technique involved a table (digitizing tablet) and a puck, which was a handheld mouse like device that the operator used to created points, polylines and polygons. This technique was mostly used to import existing physical paper maps and aerial images into a machine readable format. Luckily, we’ve come a long way since the juvenile stages of GIS, and there are now several pieces of software we can use to perform digitizing on digital images and maps; including open source options like QGIS.
Why is Digitizing Important and What is its Purpose?
Digitizing is important because it lets use do inquiries on the geometry of the produced vector data. For example, we can query the area of a polygon or length of a polyline. We can also do statistical operations on these queries, like determining the mean area of all the polygons belonging to one ground type class. It also makes the image more readable by classifying ground features.
Often times aerial images are taken of landscapes however, boundaries between land-use classes are often quite difficult to see without any visual modifications. Not only does digitizing help visualize spatial data, but it also often allows for much more interpretation. Converting aerial image data into vector shape files opens up possibilities for a wide variety of spatial analysis.
Data
The data for this tutorial are extracted from an aerial photo that was retrieved from ([[1]]| https://library.carleton.ca/find/gis/geospatial-data/carleton-campus-aerial-images), Were using the “2017 orthophotos - City of Ottawa (20cm)” theme however any will do. For the purpose of familiarity, the image we will be using is a 20cm resolution aerial images of Carleton University from 2017. The steps in this tutorial can be accomplished with any georectified aerial image.
Choosing Another Aerial Image
After opening up the interactive map of Ottawa, please consider your area of interest as this will have huge implications on the success and effectiveness of your digitizing project. Some areas in Ottawa, especially in downtown are quite dense therefore they often require many different classes and this could negatively effect your efforts. However, if you choose an aerial image with a bland variety of land-use, you might not be able to come up with enough classes. When choosing an aerial image, please think about possible classification schemes and aim for around 5-7 different classes as this will generally look the most pleasing. Please refer to the example below regarding an ideal image for digitizing:
Choosing the Correct Coordinate System
After you have imported your aerial image, it is crucial that you check the meta-data of the file and ensure that it is being projected in the proper coordinate system. In our case, we are analyzing a photo of Ottawa therefore we should be using NAD 84 MTM Zone 9. If digitizing multiple images make sure they are all using the same and most appropriate coordinate system.
Methods
This section outlines the steps that will be taken to digitize the image.
Before Beginning
Make sure to have QGIS downloaded and an aerial image saved to a location that it can be accessed.
Starting New Project
For this tutorial we will want to create a new project where all of the data will be stored.
- Along the main toolbar locate the "Project" tab-->New
Adding Aerial Image
To add the aerial image that was chosen and saved, it can be added into the QGIS canvas by using the "Add raster layer" button.
- The "Add raster layer" button is located along the left panel
- Locate the drive that you saved your aerial photo in and click "Open"
- Your aerial photo should now be open on the QGIS canvas, you can use the "Zoom in" tool and the "Zoom out" toolto help you identify geographical features or land uses within the aerial image.
Snapping Options
When digitizing there should be no gaps between vector layers, so setting up the snapping options will ensure that all lines and polygons are placed tightly together.
- Along the main toolbar locate "Setting" and select "Options"
- The "Options" window will open and you will need to locate the "Digitizing" tab and click it
- Within the "Digitizing" tab you will see subheadings-locate "Snapping"
- Within the "Snapping" subheading, you will set change the settings to the following:
- "Default snap mode" select "to vertex and segment"
- "Default snapping tolerance" set to "10.0 pixels"
- Search radius" to "10.0 pixels"
Setting the Projection
Before beginning to digitize the image, you need to make sure the correct projection is set for the image.
- To set the projection locate your aerial photo on the "Layer Panel"
- Right click on the aerial photo and select "Properties"
- Within the "General" tab in the properties window, locate the "Coordinate reference system" subheading and click on the "Coordinate tab"
- A window titled "Coordinate reference system selector" will open and within the filter search bar you can search for the appropriate coordinate system for the image you are using. For an aerial image of Ottawa the coordinate system will be MTM zone 9. Once you have selected your coordinate system click "Ok" and "Apply".
Determining Land-Type or Land-use Classes
Prior to digitizing your aerial image, you must determine the classes that you will be using for the project. The types of classes often rely on two factors: the quality of the image and the amount of detail you would like to visualize. When determining land-use classes for a large agricultural landscape, you might have different levels of detailed classes that would allow the map reader to easily distinguish between areas on the digitized area. A specific range of classes could be very useful for determining different crop types, forest land or wetlands. However, when you are digitizing aerial images within a city, you must generalize to a certain extent. This generalization allows for your map to be visually pleasing while encompassing the most important items. Classes become broader such as residential areas, commercial areas, and parks. In our case, we are digitizing an aerial image of a residential area in Ottawa therefore we will use basic classes.
We will use the following classes in our digitized map as it would make the map aesthetically pleasing and effective:
1) Rails 2) Roads 3) Water 4) Commercial 5) Residential 6) Grass 7) Shopping 8) Parks 9) School
Please refer to the image below if you are having difficulties determining classes for your project:
Digitizing - Polylines
Polylines are used to represent linear objects whose area is not as important as their length. Prominent examples of features that are represented by polylines would be roadways whose width is not substantial and waterways.
- Along the main toolbar locate "Layer" select "Create Layer" and select "New Shapefile Layer"
- A new box will open, the first choice is whether you want to draw a point, line or polygon
- Choose "line" as we will draw the roads within the image
- The next step is to set the projection so that the lines are within the same coordinate system as the aerial image
- Still within the "New shapefile layer" box, you will need to fill in the fields for the vector line. Under the subheading "New field" fill in the following;
- Name; Roads
- Type; Text data
- Length; leave the default value
- click "Add to fields list"
- Within the "Fields list" box there is a default vector layer, you may want to delete this. You can delete it by selecting it and clicking the "Remove field" button
- Save your new shapefile, to the location that your project is saved
- Along the main toolbar locate the "Toggle editing button"
- Select the "Add feature" button , using this feature draw along a road, when you are finished drawing the road right lick and a new box will open titled "Roads-feature attributes"
- Within the roads field, label the road with the appropriate name (i.e. "Bronson")
- To double check to see if the information entered into the feature attributes box, you can go back to the "Roads" layer within the "Layers Panel", right click it and go to "Open Attribute Table". Within the table there should be the road name that you entered.
- The roads that you drew should now be present on the aerial image, if you wanted to adjust the appearance of that vector layer(making them wider or a different colour, you can do this by;
- Right click the "Roads" tab within the "Layers panel" select "Properties" and select "Style"
- To continue to digitize you may want to classify the parcels of land into different land classes. The same process would be repeated:
- create new layer
- select polygon
- set coordinate system
- give appropriate title to your new vector layer
- add to field list
- draw polygon
- customize vector layer
Digitizing - Polygons
Polygons are used to represent land coverage areas such as forest, fields and manmade structures. Although polylines can be used for roads, if the area of the road is important like on a major highway, then a polygon can be used to represent it. This can be done by creating a buffer around the line. Polygons are the only vector type that can be used to determine area.
- Again, go to "Layer" select "Create Layer" and select "New Shapefile Layer"
- In the “New Shapefile Layer” box select “Polygon” under the “Type” header
- Set the projection to match your image, if you did this to create a polyline already it should retain the correct coordinate
- Name your new layer based on what it represents in the “New field” field. In this case, we’re representing Buildings
- Click “OK”
- Save your new shapefile, to the location that your project is saved and give it a suitable name
- For this example, we’ll create a polygon that represents St. Patrick’s building on the Carleton University campus
- Simply use the mouse pointer and left mouse button to place points
- QGIS will automatically create a closed polygon with a minimum of two points
- Trace the outline of St. Patrick’s building
- Once finished, simply click the right mouse button and name the polygon, in this case the name will be “St. Patrick’s”
- Once finished, simply click the right mouse button and name the polygon, in this case the name will be “StPatricks”
- Click “OK” and the polygon will be created
- To insure the edits have been made correctly right click on the “Buildings” layer in the “Layers Panel” and click the “Open Attribute Table” option
- “StPatricks” should appear in the attribute table
- When digitizing your aerial image with polygons, often times we find ourselves making small mistakes which often leave us deleting our work and starting again. However, if you have misplaced a few nodes on a polygon, you have the option to rotate the entire vector feature to better fit the intended area. Please refer to the screenshot below for context:
Digitizing - Points
Points are good for representing objects whose area is of little concern and all that is required is a single x, y and z coordinate. Unlike polyline and polygons, only one point per feature is used. Examples of objects that are usually represented as points include lamp poles, fire hydrants and bus stops.
- Again, go to "Layer" select "Create Layer" and select "New Shapefile Layer"
- In the “New Shapefile Layer” box select “Point” under the “Type” header
- Set the projection to match your image, if you did this to create a polyline or polygon already it should retain the correct coordinate
- Name your new layer based on what it represents in the “New field” field. In this case, we’re representing Traffic Lights
- Click “OK”
- Save your new shapefile, to the location that your project is saved and give it a suitable name
- Only one point can be used to represent each feature, so once you place the point you’ll be prompted to name the feature
- Call it “Traffic Light 1” and hit “OK”
- The new point will appear as a small round point
- To insure the edits have been made correctly right click on the “TrafficLights” layer in the “Layers Panel” and click the “Open Attribute Table” option
- “Traffic Light 1” should appear in the attribute table
Calculating Area of Vector Layer
If you wanted to calculate the geometric area of the different land use cover classifications, this can be done by following these steps:
- Select one of the polygon vector layers and right click on it and select "Open attribute table"
- Now will need to add a new column within the attribute table where you will do the calculation for geometry for each polygon, you will need to click the "New field" button .
- The "Add field" box will open, fill in the following;
- Name: "Area"
- Type: "Whole number (integer)"
- Length: "10"
- Once filled in, click "Ok"
- A new column should now be added in the attribute table titled "Area".
- To calculate the area, you will need to click the "Field calculator"
- The "Field calculator" box will open, you will need to select "Update existing field" and select the "Area" column.
- You now will need to select "Geometry" from "row_number"
- A drop down list will open for geometry and you will need to select "$area" and click "Ok"
- The window will close and within your attribute table you should now have a calculated area for the area column
Final Vector Model
- When you have digitized all the geographical features and classified the parcels of land into different land use classifications, your final vector model should be similar to:
- As well, the "Layers Panel" should include all the different land classifications layers that you added onto the map.
- Within each layer, there should be a corresponding attribute table, right click and select open attribute table.
Querying your data
After you have finished digitizing the image, spatial analysis can be conducted easily to any of the classes that you have just created. By creating new shape files for each class, you will be easily able to query certain land-cover and analyze them individually. In our case, each road, park, residential neighborhood, and water body will have its own shapefile therefore you can effectively work using those vector files.
Conclusion
Following this tutorial, you should have a completed vector model that was created by taking an aerial photo and digitizing the geographical features and land use classes that provides necessary information from that specific region.