Table of Contents:
1. QGIS installation
QGIS software can be downloaded from https://www.qgis.org/en/site/forusers/download.html .
User can download the appropriate version. In this tutorial, we installed QGIS version 2.8 (64 bit) for the windows.
Click Finish at the end.
Click QGIS Desktop icon to open QGIS interface.
There are so many useful tools in the QGIS. Basic tools are already presen int the QGIS interface. If you need more tools then right click on the Menu bar and choose available tools.
All toolbar icons have small description if you hover the mouse cursor over it for a moment. This makes it easier to become familiar with the different options and tools in the QGIS.
Some window also contain a help button (normally in the bottom left) which can sometimes provide helpful tips and information.
Vector data is composed of discrete coordinates that can be used as points or connected to create lines and polygons.
There are several ways to add existing vector data to the project.
a- Go to the layer in main menu bar
b- Select add layer
c- Click on add vector layer
Another way is from Manage layer tool box
In Manage Layer tool bar click on Add vector Layer button.
Another way is from the browser tool box,
Browse the shape file location and double click it to add.
In all above process user has to browse the shape file location and choose file_name.shp file.
Note: If shape file doesn’t have CRS, then QGIS prompt CRS selection window.
Map navigation toolbox helps to explore map.
From left to right
|grab the map and move it about|
|This tool bring the selected part in the center of screen|
|Zooming to the interested area|
|Zooming out from the zoomed area|
|This is basically for Raster data zooming into pixel size|
|This will bring all map layer in screen extend|
|It will zoom the selected part|
|It will zoom selected layer to screen extend|
|return to the last map canvas position|
|go to the next canvas position|
|reload the map canvas (good if it gets stuck or does not display correctly first time)|
|It will show the information of clicked feature.|
To use the tool, Select the right tool and apply to the map canvas. User need to play with this tools to get familiar with it.
Where the added data goes?
All your added data goes to the Layers toolbar. Layer toolbox is one of the vital component of the QGIS where you can play with your data.
While working with many layers, it should be in right order to visualize data properly. User can drag the layer and move its current position. In the below example, street is move upward. Basic thump of rule is in layers toolbox, a polygon layer should be at the bottom, after that polyline and at the top should be the point file.
The function are
: A useful way of examining a study area is to zoom to a layer's extent in the display. This method is a quick and easy way of zooming in to the area of concern.
: The Overview window uses a box to show the extent of your display view within the total extent of your data. You can use the Overview window to navigate the map in the Data view display.
The red box is the extend of the current map display in the map canvas.
: It will remove selected layer from the Layers toolbox.
: It will create a copy of selected layer in the Layers toolbox.
: As name suggested, it sets the minimum and maximum scale to visualize in the map canvas.
: Feature count will show the number of feature on the selected layer as shown in the figure.
In the attribute table there are many functions and some of them are explain below
Editing mode: This function allow you to modify or update the attribute table.
Save: This button save the edit or update. Editing mode should be on.
Delete: This will delete the selected row. Editing mode should be on.
Selection by Expression.
Move selected feature on the top.
Pan to the selected row.
Zoom to the selected row.
Copy the selected row.
Delete column. This will prompt a window with list of attribute name. By selecting attribute name and pressing OK button will delete the selected column.
Add Attribute Column
On the bottom of the Attribute table there are filters in the drop down menu as shown in the below figure.
To go to layer properties either double click the selected layer or right click and go to properties. A layer may have different properties some are explain here
Symbol is the one of the important part for the map representation. Symbol distinguish one feature from another. To symbolize your map, right click on the selected layer then properties and then style. The below figure shows the changing of polygon fill color. This example is for a single symbol for all features.
There are many symbol style for representing different features in the same layer as shown in below figure.
The below figure shows the categorized symbol according to regions of the world map.
Not only polygon can be symbolized differently but also point and line can be.
Map composed of Symbols and Labels is the important part.
7.4 Other Properties
There are many other properties of the layer such as fields, rendering etc. User have to play with this properties to know more about layer properties.
While working with vector data some time we need to create it and/or edit existing data.
Alternately, Layers tab from main menu, Create Layer and then New Shape file Layer.
This will open a new window as below
Begin from the top, user have to first define shape file type i.e Point, Line or Polygon. Then define File encoding. After that user have to provide CRS for the new shape file. The newly created shape file might contain various attributes, this can be define in the section New Attribute. Finishing everything and clicking OK button will show up new windows where you have to give the name of the vector layer and the destination to save it.
8.2 Editing Shape Files.
After creating it, you can edit the shape file, either by right clicking the layer and ‘toggle editing’ or highlighting the layer and choosing the ‘edit’ button in the digitize toolbar (see below).
When edit button pressed, the pencil sign shows up on the layer that is editable.
You can then edit the shape file –if you want to add to the shape file (either more points, more lines or more polygons) you click the ‘add feature’ button next to the save button on the above toolbar.
You can also move it and delete parts using the tools on this toolbar.
To save your edits right click once you are done and click OK on the window that pops up. You can then toggle editing off. It will prompt you to save changes if necessary.
The vector files you create can snap or join to other shapes files –this can be useful if you are trying to create a complete shape or tracing a feature directly.
>To set the snapping options first go to Settings/Snapping Option.
You will get the Snapping option windows
You can change the snapping mode. The snapping mode define the in which layer includes in snapping.
Set the snapping tolerance to pixels or map unit –Choose a tolerance suitable for the work (5 is a good starting point).
User might also enable snapping for topological editing and/or intersection at the bottom of snapping option window.
Sometime user might have a set of x, y coordinates and other data tables from survey. This data need to be added into the QGIS for further analysis. To do so, if the data table is in csv format is the best. This can be achieved in Excel, by saving as .csv (Comma Delimited).
The csv file can be added as
>Click the layer in main menu then add layer and add delimited text layer
>Browse for the table
>Name the layer
>Choose the file format, if you have other *.txt with different delimiters then choose custom delimiters and Specify the delimiter string –such comma ‘,’, semicolon ‘;’ etc.
>X field is your Easting column, Y field is your Northing column if they are coordinates related entries. Finally you got your x, y coordinates and other data in QGIS.
Then a polygon mask is digitize as mentioned on the above process
> Create new shape file
>Add feature (Draw or digitize polygon)
>Save and exit edit mode.
>Make fill color as transparent
You will get following windows
In this windows, user have to define
a. Source feature in which selection has to be made
b. Spatial Condition for selection such as
c. Then user has to define the reference feature for selection
d. Then press on apply button that gives results as below
Create layer of selected feature press button and you will see one more layer name + selected. In this example streets is selected so streets selected is added.
The added layer streets selected is temporary so user have to save it for permanency by right clicking and then go to save as.
9.2 Geo-Processing tools
While working with vector data, data has to be processed to get the desired result. For this purpose QGIS provides many Geo-processing tools under vector menu in main menu bar.
In the following figure the back ground polygon is the convex hull generated for the street network shape file.
Sometimes with larger datasets, it is useful to extract the small area for the region you are working on. This can be done by creating a new shp file –polygon. Drawing a polygon over the area you want to extract then choosing the clip function in the Vector tools menu. The example is same as the spatial query.
Buffering usually creates two areas: one area that is within a specified distance to select real world features and the other area that is beyond. The area that is within the specified distance is called the buffer zone.
A buffer zone is any area that serves the purpose of keeping real world features distant from one another. Buffer zones are often set up to protect the environment, protect residential and commercial zones from industrial accidents or natural disasters, or to prevent violence. Common types of buffer zones may be greenbelts between residential and commercial areas, border zones between countries, noise protection zones around airports, pollution protection zones along rivers or the right of way of road.
Generally buffer creates a polygon file.
QGIS supports various kinds of raster data and Imagery such as *.tiff, *.ecw, *.jpeg etc. Most of the time these raster data need to be geo-reference to its actual ground position. Sometime Raster images comes with location data –for example tiffs accompanied with .tfw files. These files should be kept together in the same folder. When the tiff image is added into QGIS, it should drop into the correct location (assuming all projections are correct) and if it does not then we have to do Geo-referencing.
There are several ways to go Geo-referencing in QGIS. One of them is
Main Menu>> Raster>> Georeferencer
Which open a new window
Add the raster you want to georeferenced by clicking the ‘Add raster layer’ icon in the window that pops up. Geo-referencing can take place using control points –i.e. points that the image and the actual location on the map are in common. These can be derived from features marked on the map that correspond to known features on the image. Or survey data from a GPS or Total Station marking the corners of grids or field boundaries. The important thing is to have control points decided in advance of starting this process, depending on the number of control points that are suitable this will influence the transformation type you select (more detail on this below).
Add the raster you want to georeferenced by clicking the ‘Add raster layer’ icon
in the window that pops up.
>Click the ‘add control points’ icon
Then click on the first control point on the raster image you want to locate –a window pops up.
There is the second option of determining this corresponding point by clicking on the map canvas –follow the onscreen instructions and click the pencil icon labelled ‘From map canvas’. Then make sure to zoom in as close to this point on the map as possible and click on this point. (toggling between zoom function in main QGIS window and the second georeferencing window –it often reduces to the bottom left corner of the screen)
>Click OK and the first point appears in the panel below the raster.
>Repeat this for the rest of your control points –if you make a mistake at any point you can delete the control point and start it again or move the control point to the correct position using the icons on the georeferencing window toolbar.
Click the green triangle icon for ‘start georeferencing’ and a window pops up asking you to set the transformation type –click OK.
>Transformation Type drop down menu gives you a choice –linear requires 2 control points, polynomials require more depending on the degrees of transformation.
(Generally it is better where possible to go for polynomial transformation in terms of increased accuracy.)
>Leave resampling method and Compression on their defaults (see figure below).
>Choose a location and name for the output raster (clicking the browse button to the left of this field)
>There is the option to check a box to create a world (.wld) file –this saves the locational data and can be kept with the original raster to use as location data in future projects.
>Check the ‘load in QGIS when done’ box to display the located layer
You can also save your georeferencing control points (GCP) using the save icon in this window –this could be useful if you want to try different transformation types before deciding on the most useful one.
After pressing OK button, new window will popup.
In composer interface, there are many buttons. If you hover over the button you can see the tool-tip providing info about it. Some of the buttons are explain here.
Add new map: This button add the QGIS canvas (the map that we want to present) to our composer.
Add image: to add image
Add new label: This button help to provide information about generated map such as Title, Author, and Date etc.
Add new Legend: This button bring the symbol from the map canvas.
Add new scale: This button provide the map scale.
Add new arrow: This button help to show north arrow in map.
Add new attribute: This will add the desired attribute table of available layer. This help to show statistics data on map.
This buttons help to print map either in hard-copy or in image or in pdf as per user needs.
To compose map, first click Add new map, then draw rectangle box in working space. Note that this is your main map so present. The added map can be seen in items toolbar and its properties can be edited as per needed.