Difference between revisions of "Digitizing and Georeferencing in QGIS"

From CUOSGwiki
Jump to navigationJump to search
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
== Introduction ==
 
== Introduction ==
   
This tutorial will demonstrate georeferencing and digitizing features in QGIS, using imagery downloaded from Google Earth Pro. Georeferencing is the process of taking a digital image, air-photo, or scanned topographic map, and using spatial data or coordinates to locate the image in the real world using GIS software (USGS, 2023). Essentially, georeferencing ties an image to the coordinate system used on earth, allowing for digital map analysis (point-and-click for coordinates, calculate area and distance, etc) (USGS, 2023). It links known reference points to the earth in order to georeference the entire image. Digitization is a process where geographic data in a hardcopy or a scanned image form is converted into vector data by tracing the features as either points, lines, or polygons, to convert georeferenced data to a digital format, such as a shapefile (ArcGIS Developers, 2023). Both digitizing and georeferencing are useful skills to learn, as they allow users to easily determine real-world spatial information from an image, such as knowing coordinates and distances. They are also always the first processes when analyzing a scanned or hardcopy map, so they are good basic skills to master.
+
This tutorial will demonstrate georeferencing and digitizing features in QGIS, using imagery downloaded from Google Earth Pro. Georeferencing is the process of taking a digital image, air-photo, or scanned topographic map, and using spatial data or coordinates to locate the image in the real world using GIS software (USGS, 2023). Essentially, georeferencing ties an image to the coordinate system used on earth, allowing for digital map analysis (point-and-click for coordinates, calculate area and distance, etc) (USGS, 2023). It links known reference points to the earth in order to georeference the entire image. Digitization is a process where geographic data in a hardcopy or a scanned image form is converted into vector data by tracing the features as either points, lines, or polygons, to convert georeferenced data to a digital format, such as a shapefile (ArcGIS Developers, 2023). Both digitizing and georeferencing are useful skills to learn, as they allow users to easily determine real-world spatial information from an image, such as knowing coordinates and distances. They are also always the first processes when analyzing a scanned or hardcopy map, so they are good basic skills to master. Extra tutorials and readings on this topic are linked in the References and Resources section for your convenience.
   
 
The first section of this tutorial will focus on georeferencing, starting by downloading Google Earth imagery and reference points, then bringing these into QGIS and starting the georeferencing tool, tying reference points to the image, and finally producing the finished georeferenced file. The second section of the tutorial will use the georeferenced image from part 1 to explain basic digitizing skills, creating point, line, and polygon shapefiles from the image.
 
The first section of this tutorial will focus on georeferencing, starting by downloading Google Earth imagery and reference points, then bringing these into QGIS and starting the georeferencing tool, tying reference points to the image, and finally producing the finished georeferenced file. The second section of the tutorial will use the georeferenced image from part 1 to explain basic digitizing skills, creating point, line, and polygon shapefiles from the image.
Line 7: Line 7:
 
== Software ==
 
== Software ==
   
Georeferencing can be done in a variety of GIS software. Here, QGIS is used. Quantum GIS (QGIS) is a free, open source (FOSS) GIS system that allows users to interact with geospatial data and analysis tools similarly to with more advanced programs. It supports various datasets such as vector, raster, several Plug-ins, and database formats and lets the user browse and create map data on their computer. This tutorial also uses Google Earth Pro, which is another free program that allows users to create point KML files, download images, and even do simple map analysis (calculate distance, etc).
+
Georeferencing can be done in a variety of GIS software. Here, QGIS is used. Quantum GIS (QGIS) is a free, open source software (FOSS) that allows users to interact with geospatial data and analysis tools similarly to with more advanced programs. It supports various datasets such as vector and raster, several plug-ins and database formats, and lets the user browse and create map data on their computer. This tutorial also uses Google Earth Pro, which is another free program that allows users to create point KML files, download images, and even do simple map analysis like calculating distance.
   
 
== Data ==
 
== Data ==
   
The first step is to locate a suitable historical image to georeference. These can be found in many places online, but in this tutorial it was obtained from Google Earth Pro. Regardless of where the data is obtained from, it is essential to also download or create reference/ control points to go along with the image. These points are what will be used later to actually georeference the image.
+
The first step is to locate a suitable historical image to georeference. These can be found in many places online, but in this tutorial, it was obtained from Google Earth Pro. Regardless of where the data is obtained from, it is essential to also download or create reference/ control points to go along with the image. These points are what will be used later to actually georeference the image.
   
In this example, Carleton University was located on Google Earth Pro (see Figure 1 below).
+
In this example, Carleton University was located on Google Earth Pro (see image below).
   
 
[[File:Figure 1!!.jpg|frame|center|Carleton University's campus was located on Google Earth Pro, to be used as the example data for this tutorial]]
 
[[File:Figure 1!!.jpg|frame|center|Carleton University's campus was located on Google Earth Pro, to be used as the example data for this tutorial]]
   
Once you are happy with the location you've selected, go into the options panel > navigation > make sure that 'do not automatically tilt while zooming' is checked. As well, in the main menue, turn off terrain. This will ensure that your image is flat and easy to work with in QGIS.
+
Once you are happy with the location you've selected, go into Options > Navigation, and make sure that 'do not automatically tilt while zooming' is checked. As well, in the main menu, turn off Terrain. This will ensure that your image is flat and easy to work with in QGIS.
   
Next, create your reference points. The more points, the more accurate the georeferenced file will be, but a good basic number to start with is 4 - one in each corner of the image or area you are interested in. In the contents pane on the left of the screen, create a new folder, name it 'reference points', and move the four points into the folder. See Figure 2 and 3 below.
+
Next, create your reference points. The more points, the more accurate the georeferenced file will be, but a good basic number to start with is four - one in each corner of the image or area you are interested in. In the contents pane on the left of the screen, create a new folder, name it 'reference points', and move the four points into the folder. See images below.
   
 
[[File:Figure 2!!!.jpg|frame|center|Reference points are added to the image in Google Earth Pro]]
 
[[File:Figure 2!!!.jpg|frame|center|Reference points are added to the image in Google Earth Pro]]
 
[[File:Figure 3!!!.jpg|frame|center|Creating a folder of reference points in Google Earth Pro]]
 
[[File:Figure 3!!!.jpg|frame|center|Creating a folder of reference points in Google Earth Pro]]
   
Finally, you are ready to export your image and reference points. To save the reference points, right click the folder> save place as > and ensure you are saving a KML file. To save the map, make sure all points are visible in your view, then go to file> save> save image. Turn off extra map options (like the title, etc), and choose the highest file size. Save as a JPEG.
+
Finally, you are ready to export your image and reference points. To save the reference points, right-click the folder, hit save place as, and ensure you are saving a KML file. To save the map, make sure all points are visible in your view and the compass is oriented to north, then go to File> Save> Save Image. Turn off extra map options (like the title, etc), and choose the highest file size. Save as a JPEG.
   
 
== Tutorial for Georeferencing with QGIS ==
 
== Tutorial for Georeferencing with QGIS ==
Line 30: Line 30:
 
With QGIS software open, the first step is to check whether the Georeferencer plugin is installed:
 
With QGIS software open, the first step is to check whether the Georeferencer plugin is installed:
   
* Under the Plugins menu, Click on Manage and Install Plugins.
+
* Under the Plugins menu, click on Manage and Install Plugins.
   
* In the QGIS Plugin Manager Dialog box search for Georeferencer GDAL.
+
* In the QGIS Plugin Manager dialog box search for Georeferencer GDAL.
   
* Ensure it is installed. Also make sure the checkbox is checked, this will make it appear in the toolbar. Click Close.
+
* Ensure it is installed. Also, make sure the checkbox is checked, this will make it appear in the toolbar. Click Close.
   
   
Line 45: Line 45:
 
* Browse to the location where we have the Google Earth image, select it and open it.
 
* Browse to the location where we have the Google Earth image, select it and open it.
   
* In case the Coordinate Reference System Selector dialog opens, ensure the coordinate is set to the correct one for your location, then click OK.
+
* If the Coordinate Reference System Selector dialog opens, ensure the coordinate is set to the correct one for your location, then click Okay.
   
 
* On the Raster menu, click on the Georeferencer.
 
* On the Raster menu, click on the Georeferencer.
Line 54: Line 54:
 
Next, open the reference points file:
 
Next, open the reference points file:
   
* To import reference points, select Layer > add vector layer > and open the reference points KML
+
* To import reference points, select Layer > Add Vector Layer, and open the reference points KML
   
   
Line 63: Line 63:
 
* Click on the Add Points button
 
* Click on the Add Points button
   
* On the raster, click on the corner point, the enter map coordinates dialog will appear
+
* On the raster, click on the corner point, the Enter Map Coordinates dialog will appear
   
 
* Select 'from map canvas'. This will allow you to click on your reference points instead of typing the coordinates in by hand. You can always edit them if they are off.
 
* Select 'from map canvas'. This will allow you to click on your reference points instead of typing the coordinates in by hand. You can always edit them if they are off.
   
* Navigate to the correct point on your main map canvas, click it, and click OK.
+
* Navigate to the correct point on your main map canvas, click it, and click Okay.
   
 
[[File:Figure 4!!.jpg|frame|center|Entering map coordinates]]
 
[[File:Figure 4!!.jpg|frame|center|Entering map coordinates]]
 
 
* Repeat for all the other three corners. You can also decide to save the GCPs, load GCPs, delete point or remove GCP point. See Figure 5 below.
+
* Repeat for all the other corners. You can also decide to save the GCPs, load GCPs, delete point or remove GCP point. See Figure 5 below.
   
 
[[File:Figure 5!!!.jpg|frame|center|Points all added to the Google Earth image]]
 
[[File:Figure 5!!!.jpg|frame|center|Points all added to the Google Earth image]]
Line 78: Line 78:
 
Now that all points are added, you can start georeferencing:
 
Now that all points are added, you can start georeferencing:
   
* Click on the start georeferencing button to create the new georeferenced raster.
+
* Click on the Start Georeferencing button (green play button) to create the new georeferenced raster.
   
* Click OK on the info dialog when asked to set transformation type.
+
* Click Okay on the info dialog when asked to set transformation type.
   
* Fill in the transformation settings dialog as shown in the figure that follows.
+
* Fill in the transformation settings dialog as shown in the figure that follows. Ensure you have 'Load in QGIS when done' checked off.
   
[[File:Figure 6!!.jpg|frame|center|Filling in transformation settings]]
+
[[File:Figure 5!!.jpg|frame|center|Transformation settings dialog]]
   
 
If you would like to see that the georeference worked, you can perform a quick test:
   
 
* Add any default base map to the main canvas, where your new file should have opened
If you would like to see that the georeference worked, you can preform a quick test:
 
 
* Add any default basemap to the main canvas, where your new file should have opened
 
   
 
* Turn on and off your image, and see if the points stay in the same place on the map (see Figure 7 below)
 
* Turn on and off your image, and see if the points stay in the same place on the map (see Figure 7 below)
Line 95: Line 94:
 
[[File:Figure 7.jpg|frame|center|Testing that georeferencing worked]]
 
[[File:Figure 7.jpg|frame|center|Testing that georeferencing worked]]
   
==Digitizing tool==
+
==Tutorial for Digitizing with QGIS==
   
Digitizing is one of the most frequent duties assigned to a GIS Specialist. Often, a significant portion of GIS effort is spent digitizing raster data in order to create vector layers for analysis. QGIS includes robust on-screen digitizing and editing features, which we shall investigate in this course.
+
Digitizing is one of the most frequent duties assigned to a GIS Specialist. Often, a significant portion of GIS effort is spent digitizing raster data in order to create vector layers for analysis. QGIS includes robust on-screen digitizing and editing features, which we shall investigate in this section of the tutorial.
   
 
* Go to Layer > Add Raster Layer. Locate the georeferenced image and click Open.
==Procedure==
 
   
 
* Set the default Digitizing Options. Go to Settings > Options, and set similar to as shown in the image below:
* Go to Layer Add Raster Layer. Locate the georeferenced image and click Open
 
   
  +
[[File:Figure 8!.jpg|frame|center|Setting digitizing options]]
* Set the default Digitizing Options. Go to Settings Options…
 
   
 
* Select the Digitizing tab in the Options dialog. Set the Default snap mode to 'to vertex and segment'. Click Okay.
[[File:Picture8.png|frame|center]]
 
  +
  +
* Select Layer > Create Layer> New Shapefile. First, try digitizing line features, such as roads. Here, the main roads on Carleton's campus were digitized.
 
  +
[[File:Figure 9!!.jpg|frame|center|Creating a new shapefile]]
 
 
 
* Once the layer is loaded, click the Toggle Editing button to put the layer in editing mode.
   
 
* Click the Add feature button. Click on the map canvas to add a new vertex. Add new vertices along the road features. Once you have digitized a road segment, right-click to end the feature.
* Select the Digitizing tab in the Options dialog. Set the Default snap mode to To vertex and segment.
 
   
  +
* If the features you are digitizing have names or other identifiers you would like to keep on hand, you can edit the attribute table (right-click the new .shp, open the attribute table, and toggle editing on to add a field and fill it in for each new feature). Here, the names of the roads were included.
* Click OK.
 
   
  +
[[File:Figure 9.5!.jpg|frame|center|Attribute table for Carleton roads file]]
* Click on Layer then create layer then new shapefile
 
 
[[File:Picture9.png|frame|center]]
 
   
 
* Once you have finished digitizing all the roads, click the Toggle Editing button off.
[[File:Picture10.png|frame|center]]
 
 
* Once the layer is loaded, click the Toggle Editing button to put the layer in editing mode.
 
   
  +
[[File:Figure 10!.jpg|frame|center|Carleton's roads digitized in a new shapefile]]
* Click the Add feature button. Click on the map canvas to add a new vertex. Add new vertices along the road feature. Once you have digitized a road segment, right-click to end the feature.
 
   
  +
* Try digitizing some polygon features (here, Carleton's sports fields were done), and point features (here, outdoor study spots were done).
* Once you have finished digitizing all the roads, click the Toggle Editing button.
 
   
  +
* When you are done, try turning the original georeferenced image off to see your new shapefiles.
[[File:Picture11.png|frame|center]]
 
   
  +
[[File:Figure 11!!.jpg|frame|center|Complete digitized files]]
== References ==
 
  +
  +
== Conclusion ==
  +
In this tutorial, you have learned how to:
  +
  +
* Download reference points and imagery directly from Google Earth Pro
  +
  +
* Use QGIS to georeference Google Earth imagery
  +
  +
* Use QGIS to digitize georeferenced files
  +
 
== References and Resources ==
   
 
ArcGIS Developers. (2023). Geo-Referencing and Digitization of Scanned Maps. ArcGIS. https://developers.arcgis.com/python/guide/geo-referencing-and-digitization-of-scanned-maps/
 
ArcGIS Developers. (2023). Geo-Referencing and Digitization of Scanned Maps. ArcGIS. https://developers.arcgis.com/python/guide/geo-referencing-and-digitization-of-scanned-maps/
  +
* This page includes more advanced georeferencing and digitizing tips specific to scanned maps
  +
  +
GIS University. (n.d.). Georeferencing in QGIS. GIS University. https://gis-university.com/georeferencing-in-qgis/
  +
* This tutorial follows similar procedures to those encountered in this tutorial, but is more specific to georeferencing scanned paper maps.
  +
  +
Q-Tips. (2018, October 10). QGIS Georeferencing Google Earth Images. [Video]. YouTube. https://www.youtube.com/watch?v=RjkZgE_WVBk
  +
* This tutorial follows similar procedures to those encountered in this tutorial, and may be useful for more visual learners.
   
 
USGS. (2023). What does ‘georeferenced’ mean?. USGS. https://www.usgs.gov/faqs/what-does-georeferenced-mean#:~:text=Georeferencing%20means%20that%20the%20internal,ground%20system%20of%20geographic%20coordinates
 
USGS. (2023). What does ‘georeferenced’ mean?. USGS. https://www.usgs.gov/faqs/what-does-georeferenced-mean#:~:text=Georeferencing%20means%20that%20the%20internal,ground%20system%20of%20geographic%20coordinates
  +
* More information about georeferencing and its uses
  +
  +
[[Digitizing_in_QGIS|CUOSG Wiki - Digitizing in QGIS]]
  +
* Another tutorial from the CUOSG Wiki that gets into more advanced digitizing - a great resource to look into once you've gotten the hang of the basics from this one!

Latest revision as of 13:48, 25 September 2023

Introduction

This tutorial will demonstrate georeferencing and digitizing features in QGIS, using imagery downloaded from Google Earth Pro. Georeferencing is the process of taking a digital image, air-photo, or scanned topographic map, and using spatial data or coordinates to locate the image in the real world using GIS software (USGS, 2023). Essentially, georeferencing ties an image to the coordinate system used on earth, allowing for digital map analysis (point-and-click for coordinates, calculate area and distance, etc) (USGS, 2023). It links known reference points to the earth in order to georeference the entire image. Digitization is a process where geographic data in a hardcopy or a scanned image form is converted into vector data by tracing the features as either points, lines, or polygons, to convert georeferenced data to a digital format, such as a shapefile (ArcGIS Developers, 2023). Both digitizing and georeferencing are useful skills to learn, as they allow users to easily determine real-world spatial information from an image, such as knowing coordinates and distances. They are also always the first processes when analyzing a scanned or hardcopy map, so they are good basic skills to master. Extra tutorials and readings on this topic are linked in the References and Resources section for your convenience.

The first section of this tutorial will focus on georeferencing, starting by downloading Google Earth imagery and reference points, then bringing these into QGIS and starting the georeferencing tool, tying reference points to the image, and finally producing the finished georeferenced file. The second section of the tutorial will use the georeferenced image from part 1 to explain basic digitizing skills, creating point, line, and polygon shapefiles from the image.

Software

Georeferencing can be done in a variety of GIS software. Here, QGIS is used. Quantum GIS (QGIS) is a free, open source software (FOSS) that allows users to interact with geospatial data and analysis tools similarly to with more advanced programs. It supports various datasets such as vector and raster, several plug-ins and database formats, and lets the user browse and create map data on their computer. This tutorial also uses Google Earth Pro, which is another free program that allows users to create point KML files, download images, and even do simple map analysis like calculating distance.

Data

The first step is to locate a suitable historical image to georeference. These can be found in many places online, but in this tutorial, it was obtained from Google Earth Pro. Regardless of where the data is obtained from, it is essential to also download or create reference/ control points to go along with the image. These points are what will be used later to actually georeference the image.

In this example, Carleton University was located on Google Earth Pro (see image below).

Carleton University's campus was located on Google Earth Pro, to be used as the example data for this tutorial

Once you are happy with the location you've selected, go into Options > Navigation, and make sure that 'do not automatically tilt while zooming' is checked. As well, in the main menu, turn off Terrain. This will ensure that your image is flat and easy to work with in QGIS.

Next, create your reference points. The more points, the more accurate the georeferenced file will be, but a good basic number to start with is four - one in each corner of the image or area you are interested in. In the contents pane on the left of the screen, create a new folder, name it 'reference points', and move the four points into the folder. See images below.

Reference points are added to the image in Google Earth Pro
Creating a folder of reference points in Google Earth Pro

Finally, you are ready to export your image and reference points. To save the reference points, right-click the folder, hit save place as, and ensure you are saving a KML file. To save the map, make sure all points are visible in your view and the compass is oriented to north, then go to File> Save> Save Image. Turn off extra map options (like the title, etc), and choose the highest file size. Save as a JPEG.

Tutorial for Georeferencing with QGIS

With QGIS software open, the first step is to check whether the Georeferencer plugin is installed:

  • Under the Plugins menu, click on Manage and Install Plugins.
  • In the QGIS Plugin Manager dialog box search for Georeferencer GDAL.
  • Ensure it is installed. Also, make sure the checkbox is checked, this will make it appear in the toolbar. Click Close.


Next, open the Google Earth image to georeference:

  • Click on the Raster tab and launch the Georeferencer.
  • Click the Add Raster Layer icon.
  • Browse to the location where we have the Google Earth image, select it and open it.
  • If the Coordinate Reference System Selector dialog opens, ensure the coordinate is set to the correct one for your location, then click Okay.
  • On the Raster menu, click on the Georeferencer.
  • Click the Open Raster tool and select the raster file.


Next, open the reference points file:

  • To import reference points, select Layer > Add Vector Layer, and open the reference points KML


Now, all data needed for the georeferencing process are open in QGIS. Start by tying points on the image to the reference point file:

  • Zoom in to point A of the image.
  • Click on the Add Points button
  • On the raster, click on the corner point, the Enter Map Coordinates dialog will appear
  • Select 'from map canvas'. This will allow you to click on your reference points instead of typing the coordinates in by hand. You can always edit them if they are off.
  • Navigate to the correct point on your main map canvas, click it, and click Okay.
Entering map coordinates
  • Repeat for all the other corners. You can also decide to save the GCPs, load GCPs, delete point or remove GCP point. See Figure 5 below.
Points all added to the Google Earth image


Now that all points are added, you can start georeferencing:

  • Click on the Start Georeferencing button (green play button) to create the new georeferenced raster.
  • Click Okay on the info dialog when asked to set transformation type.
  • Fill in the transformation settings dialog as shown in the figure that follows. Ensure you have 'Load in QGIS when done' checked off.
Transformation settings dialog

If you would like to see that the georeference worked, you can perform a quick test:

  • Add any default base map to the main canvas, where your new file should have opened
  • Turn on and off your image, and see if the points stay in the same place on the map (see Figure 7 below)
Testing that georeferencing worked

Tutorial for Digitizing with QGIS

Digitizing is one of the most frequent duties assigned to a GIS Specialist. Often, a significant portion of GIS effort is spent digitizing raster data in order to create vector layers for analysis. QGIS includes robust on-screen digitizing and editing features, which we shall investigate in this section of the tutorial.

  • Go to Layer > Add Raster Layer. Locate the georeferenced image and click Open.
  • Set the default Digitizing Options. Go to Settings > Options, and set similar to as shown in the image below:
Setting digitizing options
  • Select the Digitizing tab in the Options dialog. Set the Default snap mode to 'to vertex and segment'. Click Okay.
  • Select Layer > Create Layer> New Shapefile. First, try digitizing line features, such as roads. Here, the main roads on Carleton's campus were digitized.
Creating a new shapefile
  • Once the layer is loaded, click the Toggle Editing button to put the layer in editing mode.
  • Click the Add feature button. Click on the map canvas to add a new vertex. Add new vertices along the road features. Once you have digitized a road segment, right-click to end the feature.
  • If the features you are digitizing have names or other identifiers you would like to keep on hand, you can edit the attribute table (right-click the new .shp, open the attribute table, and toggle editing on to add a field and fill it in for each new feature). Here, the names of the roads were included.
Attribute table for Carleton roads file
  • Once you have finished digitizing all the roads, click the Toggle Editing button off.
Carleton's roads digitized in a new shapefile
  • Try digitizing some polygon features (here, Carleton's sports fields were done), and point features (here, outdoor study spots were done).
  • When you are done, try turning the original georeferenced image off to see your new shapefiles.
Complete digitized files

Conclusion

In this tutorial, you have learned how to:

  • Download reference points and imagery directly from Google Earth Pro
  • Use QGIS to georeference Google Earth imagery
  • Use QGIS to digitize georeferenced files

References and Resources

ArcGIS Developers. (2023). Geo-Referencing and Digitization of Scanned Maps. ArcGIS. https://developers.arcgis.com/python/guide/geo-referencing-and-digitization-of-scanned-maps/

  • This page includes more advanced georeferencing and digitizing tips specific to scanned maps

GIS University. (n.d.). Georeferencing in QGIS. GIS University. https://gis-university.com/georeferencing-in-qgis/

  • This tutorial follows similar procedures to those encountered in this tutorial, but is more specific to georeferencing scanned paper maps.

Q-Tips. (2018, October 10). QGIS Georeferencing Google Earth Images. [Video]. YouTube. https://www.youtube.com/watch?v=RjkZgE_WVBk

  • This tutorial follows similar procedures to those encountered in this tutorial, and may be useful for more visual learners.

USGS. (2023). What does ‘georeferenced’ mean?. USGS. https://www.usgs.gov/faqs/what-does-georeferenced-mean#:~:text=Georeferencing%20means%20that%20the%20internal,ground%20system%20of%20geographic%20coordinates

  • More information about georeferencing and its uses

CUOSG Wiki - Digitizing in QGIS

  • Another tutorial from the CUOSG Wiki that gets into more advanced digitizing - a great resource to look into once you've gotten the hang of the basics from this one!