SlideShare a Scribd company logo
1 of 47
QGIS Tutorial



Prepared By:
Niloy Ghosh
Nitin Kumar Rathore

Students of 2nd Year MBA at Vinod Gupta School of Management
(VGSOM), IIT Kharagpur
Objective of the Tutorial
• To make a choropleth interactive map, as
  given in the picture, using open source QGIS
  mapping software.
What it does
A Choropleth map is a thematic map,
having different colours or shades for
representing different values in
geographic region. It can be population,
per capita income. This map makes it
easy to visualize how measurement
varies from a region to region.
Pre-Requirements
• Shapefile: of any country that you want to
  choropleth interactive map of. In our case its
  India.
• Data: Data of population, in table format, of
  the country.
• GIS Software: Should be installed beforehand.
Shapefile
• A Shapefile describe geometries, its a collection
  of points, lines, polylines and polygons.
• It can have data about the geometries it
  describes for example population, mortality rate,
  terrain.
• Extension of a shapefile is .shp
• A shape file is provided by many websites for
  free. Our shape for India can be found at this link:
  http://www.gadm.org/country
Data
• The data you want to be represented in the
  map can be taken from a mysql database,
  excel spreadsheet, access database, CSV file or
  any table.
• Our data for India was taken from this link
  – data for excel:
    http://en.wikipedia.org/wiki/Demographics_of_In
    dia
About QGIS Software
•Quantum Geographical Information System (QGIS) is
an open source software for representing
geographical information. It’s available for Mac, OSX
Linux and Windows platforms at http://www.qgis.org/
•QGIS will be used to join the geographical
information stored in shapefile and data we want to
represent on the map.
•After that we will create web version of map using
the image of map and html code.
Let’s Start
• We are going to build a map to show population data for each state of the country.
    The shapefile is to be download from http://www.gadm.org/country
•   Unzip the Zip file downloaded and you will find the following contents.
Preparing data for shapefile:
• Copy the population data from wiki link into the excel file
Preparing data for shapefile (contd.)
• Copy the data of two columns, states and population, in excel file and save the spreadsheet
    with CSV format(comma delimited) (*.csv). And format column types as general.
Load the shapefile in QGIS
• Click on Layer
• Choose add vector layer
Load the shapefile in QGIS (contd.)
• Select the IND_adm1.shp file from the unzipped folder you have downloaded, it contains the
   shape and data for indian states.
This is how it looks, color may vary
Open attribute table
• Click on menu “Layer”
• Choose “Open Attribute Table”
Attribute Table
• The attribute table will contain data for states (column “NAME_1”). This field is used as a join
    to CSV file data. So one must be cautious that the data of the column should match
    otherwise make the necessary changes in CSV file.
• We therefore advise you to download both files (shape and data) from the same websites if
    available.
To set the internet settings for downloading plugins, if you are workin under proxy server.
• Click on menu “Settings”
• Select “Options”
To set the internet settings for downloading plugins (contd.)
• Select “Network” Tab
• Enter your Host, Port and Proxy type of your proxy server
To download required plugins (mmqgis and HTML Image map plugin)
• There are 2 plugins we need to complete this lab exercise. If you can’t see them in plugins
    menu, please follow theseesteps to download
• Click on menu “Plugins”
• Choose “Fetch Python plugins”
To download required plugins (contd.)
• Click “Add 3rd party repositories”
To download required plugins (contd.)
• Click on “Plugins” Tab
• Type “mmqgis” in textbox for search
• Click on “MMQGIS” plugin
• Click on Command “Install plugin”
To download required plugins (contd.)
• Follow same steps for Html Image map plugin
Import the data file in csv format
• Click on menu “plugins”
• Click option “mmqgis” and then option “Attributes joins from csv file”
Import the data file in csv format
• Click on browse to select the data file(CSV) we dcreated earlier in excel
• In data file select field “State or Union territory” and in Join layer attribute select option
   “NAME_1”. These are the fields to be joined
• Save the output shapefile in your working directory and do same for the notfound csv output
   list.
• Add joined layer must be checked and clik ok.
Import the data file in csv format (Contd.)
• A new layer will be added to your project as indicated below
Attribute table with data
• Open the attribute table again
• Click “ Layer”, then click “Open attribute table”
• New data has been joined with data of shapefile as shown below
•   The problem mmqgis plugin is the it did not recognize number fields as numbers but as
    strings. So to use data properly it is to be converted into integers or reals.
•   For that click on pencill icon on ,as indicated in picture,to enter editing mode. Then click on
    calculator icon to launch field calculator
Format Strings to numbers
• Enter name(say pop_int)of new column that will hold no. value for all strings in populatio
   field
• select whole noumberinteger) for output field type
• Click “to real” in opertators section, to begin expression in the field calculator expression box.
   Enter field name Ppop_int” and close the paranthesis. Click ok
Format string to numbers(contd.)
• Now we will create a column that will hold a string value as a tooltip. When a mouse Is
   moved over a area in the map this is the message a person will see.
• In output field name, enter pop_str, choose text(string) and make the output filed width 50.
• Enter this formula in field calculator expression section: NAME_1+’:’+to string(populatio)
• This will concatenatese the name field with population of that sate.. Now click ok
Format string to numbers
• Now you can see different columns for population in numbers and in string form.
• To save these changes you must click the pencil icon.
Colouring the map
• Now we will color the map based on data file
• Click on layers and select properties
Coloring the map (cont.)
• In the layer properties dialog box , choose style tab(default). Choose legend type as
    ‘Graduated’. For column field select ‘pop_int’. For mode choose “equal interval”
• For classes choose 6, then click on classify and then click apply.
Colouring the map(cont.)
• Now the colours applied to map would be visible. And the colours of the map and legend of
    colours and values can be seen in layers window
• We can change the default colour palette selected by QGIS.
• To change colors go to style option by clicking layers menu then properties and then style
    tab.
Colouring the map(contd.)
• To change color, click on the color of the respective row. This will open symbol selector. click
    change.
• To change range, click on the range next to the first colour and a dialog box will appear to
    allow you to change the range upper and lower values
Colouring the map(contd.)
• By clicking on change (for colour). IT will open a window Select Color.
• Select bright red to differentiate it from blue.
• Follow similar steps to change the colors of other ranges
Colouring the map(contd.)
• To change range after clicking on the range values, as shown in previous slide , a dialog box
    will appear named “enter class bounds” as shown below. You can enter upper and lower limit
    to define range.
• Click ok
• Apply the same procedure to change ranges of the other rows
Colouring the map (contd.)
• Now change the row values and colors as given in the figure below (range values in the
    multiples of 3 crore).
• Also edit the labels next to range. You can edit labels just by double clicking on it.
• After all editing click ok
Colouring th e map (contd.)
• We can see different colour codes for the different range of population in the map.
Making an interactive web map
• Whatever you see in the map window will be in your final Html map. If you want to get rid of
   the default icons on maps: the copy right notice, a measurement bar and a north marker. We
   have circled the icons, which can remove them.
Making an interactive web map(contd.)
• You can resize the QGIS window to resize the map, according to your requirement of size on
   webpage.
• Click the magnifying class as indicated to fill up any extra space.
Making an interactive web map(contd.)
• Now we can export our map and html code to create an interactive web map.
• Click on menu ‘Plugins’ and select Html Image Map Plugin. Then select image map.
Making an interactive web map(contd.)
• The defauld dimension of image size is the size of QGIS map window. If you want to change
   these dimensions, you can change the size of map window and try again
• Set the path for file to be saved by ‘browse’. Choose a filename for the html map.
• Uncheck all the boxes except onMouseOver attr. Infront of that property select field value
   pop_str, the field that holds the tooltip/mouseover message. Click ok
Final Map
• Open the web page file in your browser. You can see a similar picture given below. Move your
    mouse over individual states to see the population of that state on the top left corner.
To use the map in already existing template
• A sample template can be found at http://tbarmann.webfactional.com/nicar
• Html plugin will create 3 files: an html page, a png file and a PNGw file. Open the Html file
    with a text editor and copy all code between the start tag (<map name =“mapmap”>)and the
    end tag.
To use the map in already existing template (contd.)
• Open the web page template you want to embed map on. Paste the map code into this
    template file.
• Change the src attribute to the name of the png file created by the html image map plugin.
    and save the png file In the new html page directory. Now save the web page.
To use the map in already existing template (contd.)
• This template file will show the same string but below the mouse as a tooltip rather than a
    message at top left. Like when we move mouse to West Bengal, this tooltip appears.
Thank You


Please visit our blog
http://gettingstartedwithqgis.blogspot.in/ for more such
tutorials

More Related Content

What's hot

QGIS Module 2
QGIS Module 2QGIS Module 2
QGIS Module 2CAPSUCSF
 
QGIS Training.pptx
QGIS Training.pptxQGIS Training.pptx
QGIS Training.pptxSeemaAjay7
 
Raster data model
Raster data modelRaster data model
Raster data modelPramoda Raj
 
GEOPROCESSING IN QGIS
GEOPROCESSING IN QGISGEOPROCESSING IN QGIS
GEOPROCESSING IN QGISSwetha A
 
Spatial analysis and modeling
Spatial analysis and modelingSpatial analysis and modeling
Spatial analysis and modelingTolasa_F
 
DATA in GIS and DATA Query
DATA in GIS and DATA QueryDATA in GIS and DATA Query
DATA in GIS and DATA QueryKU Leuven
 
Introduction to GIS
Introduction to GISIntroduction to GIS
Introduction to GISKU Leuven
 
Gis Applications Presentation
Gis Applications PresentationGis Applications Presentation
Gis Applications PresentationIdua Olunwa
 
Land Suitability Analysis.pdf
Land Suitability Analysis.pdfLand Suitability Analysis.pdf
Land Suitability Analysis.pdfMarkMwari
 
Basic of gis concept and theories
Basic of gis concept and theoriesBasic of gis concept and theories
Basic of gis concept and theoriesMohsin Siddique
 
Introduction to remote sensing and gis
Introduction to remote sensing and gisIntroduction to remote sensing and gis
Introduction to remote sensing and gisMohsin Siddique
 
Open Source GIS
Open Source GISOpen Source GIS
Open Source GISJoe Larson
 

What's hot (20)

QGIS Module 2
QGIS Module 2QGIS Module 2
QGIS Module 2
 
QGIS Training.pptx
QGIS Training.pptxQGIS Training.pptx
QGIS Training.pptx
 
Functions of GIS
Functions of GISFunctions of GIS
Functions of GIS
 
QGIS training class 1
QGIS training class 1QGIS training class 1
QGIS training class 1
 
Introduction to GIS
Introduction to GISIntroduction to GIS
Introduction to GIS
 
Raster data model
Raster data modelRaster data model
Raster data model
 
Raster data and Vector data
Raster data and Vector dataRaster data and Vector data
Raster data and Vector data
 
GEOPROCESSING IN QGIS
GEOPROCESSING IN QGISGEOPROCESSING IN QGIS
GEOPROCESSING IN QGIS
 
Gis functions
Gis functionsGis functions
Gis functions
 
Spatial analysis and modeling
Spatial analysis and modelingSpatial analysis and modeling
Spatial analysis and modeling
 
gis
gisgis
gis
 
DATA in GIS and DATA Query
DATA in GIS and DATA QueryDATA in GIS and DATA Query
DATA in GIS and DATA Query
 
QGIS training
QGIS trainingQGIS training
QGIS training
 
Introduction to GIS
Introduction to GISIntroduction to GIS
Introduction to GIS
 
Gis Applications Presentation
Gis Applications PresentationGis Applications Presentation
Gis Applications Presentation
 
Land Suitability Analysis.pdf
Land Suitability Analysis.pdfLand Suitability Analysis.pdf
Land Suitability Analysis.pdf
 
GIS MAPPING
GIS MAPPINGGIS MAPPING
GIS MAPPING
 
Basic of gis concept and theories
Basic of gis concept and theoriesBasic of gis concept and theories
Basic of gis concept and theories
 
Introduction to remote sensing and gis
Introduction to remote sensing and gisIntroduction to remote sensing and gis
Introduction to remote sensing and gis
 
Open Source GIS
Open Source GISOpen Source GIS
Open Source GIS
 

Similar to QGIS Tutorial 1

UNIT_4_data visualization.pptx
UNIT_4_data visualization.pptxUNIT_4_data visualization.pptx
UNIT_4_data visualization.pptxBhagyasriPatel2
 
Geohosting english manual
Geohosting english manualGeohosting english manual
Geohosting english manualSDIEDU
 
Map visualisation
Map visualisationMap visualisation
Map visualisationSDIEDU
 
Mapping Immigrants
Mapping ImmigrantsMapping Immigrants
Mapping Immigrantsborderzine
 
LoCloud MINT metadata mapping tool, Nikolaos Simou, Eleni Iskou, National Tec...
LoCloud MINT metadata mapping tool, Nikolaos Simou, Eleni Iskou, National Tec...LoCloud MINT metadata mapping tool, Nikolaos Simou, Eleni Iskou, National Tec...
LoCloud MINT metadata mapping tool, Nikolaos Simou, Eleni Iskou, National Tec...locloud
 
Coord transform 082014
Coord transform 082014Coord transform 082014
Coord transform 082014PramodPandit9
 
Applied GIS - 3022.pptx
Applied GIS - 3022.pptxApplied GIS - 3022.pptx
Applied GIS - 3022.pptxtemesgenabebe1
 
Crystal tr///SAP Design Studio online training by design studio Export-24/7//...
Crystal tr///SAP Design Studio online training by design studio Export-24/7//...Crystal tr///SAP Design Studio online training by design studio Export-24/7//...
Crystal tr///SAP Design Studio online training by design studio Export-24/7//...venkat training
 
Manual gis
Manual gisManual gis
Manual gissaha232
 
Autocad 2007 Workbook Tutorial
Autocad 2007 Workbook TutorialAutocad 2007 Workbook Tutorial
Autocad 2007 Workbook TutorialJhongNatz
 
Getting started with Tableau
Getting started with TableauGetting started with Tableau
Getting started with TableauParth Acharya
 
spatial anaylisi using ilwis
spatial anaylisi using ilwisspatial anaylisi using ilwis
spatial anaylisi using ilwisAsri Renggo
 
Necto 16 training 23 - visual studio modeling
Necto 16 training 23 -  visual studio modelingNecto 16 training 23 -  visual studio modeling
Necto 16 training 23 - visual studio modelingPanorama Software
 
Fly thru
Fly thruFly thru
Fly thruAli Sam
 
Concepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into MapsConcepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into MapsMohammad Liton Hossain
 

Similar to QGIS Tutorial 1 (20)

02+ +step+by+step+qgis
02+ +step+by+step+qgis02+ +step+by+step+qgis
02+ +step+by+step+qgis
 
UNIT_4_data visualization.pptx
UNIT_4_data visualization.pptxUNIT_4_data visualization.pptx
UNIT_4_data visualization.pptx
 
Power BI.pdf
Power BI.pdfPower BI.pdf
Power BI.pdf
 
Geohosting english manual
Geohosting english manualGeohosting english manual
Geohosting english manual
 
Bar chart Creation
Bar chart CreationBar chart Creation
Bar chart Creation
 
Map visualisation
Map visualisationMap visualisation
Map visualisation
 
Mapping Immigrants
Mapping ImmigrantsMapping Immigrants
Mapping Immigrants
 
LoCloud MINT metadata mapping tool, Nikolaos Simou, Eleni Iskou, National Tec...
LoCloud MINT metadata mapping tool, Nikolaos Simou, Eleni Iskou, National Tec...LoCloud MINT metadata mapping tool, Nikolaos Simou, Eleni Iskou, National Tec...
LoCloud MINT metadata mapping tool, Nikolaos Simou, Eleni Iskou, National Tec...
 
Coord transform 082014
Coord transform 082014Coord transform 082014
Coord transform 082014
 
Applied GIS - 3022.pptx
Applied GIS - 3022.pptxApplied GIS - 3022.pptx
Applied GIS - 3022.pptx
 
Simplymap guide
Simplymap guideSimplymap guide
Simplymap guide
 
Crystal tr///SAP Design Studio online training by design studio Export-24/7//...
Crystal tr///SAP Design Studio online training by design studio Export-24/7//...Crystal tr///SAP Design Studio online training by design studio Export-24/7//...
Crystal tr///SAP Design Studio online training by design studio Export-24/7//...
 
Manual gis
Manual gisManual gis
Manual gis
 
Autocad 2007 Workbook Tutorial
Autocad 2007 Workbook TutorialAutocad 2007 Workbook Tutorial
Autocad 2007 Workbook Tutorial
 
Getting started with Tableau
Getting started with TableauGetting started with Tableau
Getting started with Tableau
 
spatial anaylisi using ilwis
spatial anaylisi using ilwisspatial anaylisi using ilwis
spatial anaylisi using ilwis
 
Necto 16 training 23 - visual studio modeling
Necto 16 training 23 -  visual studio modelingNecto 16 training 23 -  visual studio modeling
Necto 16 training 23 - visual studio modeling
 
Introduction to MapBasic
Introduction to MapBasicIntroduction to MapBasic
Introduction to MapBasic
 
Fly thru
Fly thruFly thru
Fly thru
 
Concepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into MapsConcepts and Methods of Embedding Statistical Data into Maps
Concepts and Methods of Embedding Statistical Data into Maps
 

Recently uploaded

How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPCeline George
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 

Recently uploaded (20)

How to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERPHow to do quick user assign in kanban in Odoo 17 ERP
How to do quick user assign in kanban in Odoo 17 ERP
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 

QGIS Tutorial 1

  • 1. QGIS Tutorial Prepared By: Niloy Ghosh Nitin Kumar Rathore Students of 2nd Year MBA at Vinod Gupta School of Management (VGSOM), IIT Kharagpur
  • 2. Objective of the Tutorial • To make a choropleth interactive map, as given in the picture, using open source QGIS mapping software.
  • 3. What it does A Choropleth map is a thematic map, having different colours or shades for representing different values in geographic region. It can be population, per capita income. This map makes it easy to visualize how measurement varies from a region to region.
  • 4. Pre-Requirements • Shapefile: of any country that you want to choropleth interactive map of. In our case its India. • Data: Data of population, in table format, of the country. • GIS Software: Should be installed beforehand.
  • 5. Shapefile • A Shapefile describe geometries, its a collection of points, lines, polylines and polygons. • It can have data about the geometries it describes for example population, mortality rate, terrain. • Extension of a shapefile is .shp • A shape file is provided by many websites for free. Our shape for India can be found at this link: http://www.gadm.org/country
  • 6. Data • The data you want to be represented in the map can be taken from a mysql database, excel spreadsheet, access database, CSV file or any table. • Our data for India was taken from this link – data for excel: http://en.wikipedia.org/wiki/Demographics_of_In dia
  • 7. About QGIS Software •Quantum Geographical Information System (QGIS) is an open source software for representing geographical information. It’s available for Mac, OSX Linux and Windows platforms at http://www.qgis.org/ •QGIS will be used to join the geographical information stored in shapefile and data we want to represent on the map. •After that we will create web version of map using the image of map and html code.
  • 8. Let’s Start • We are going to build a map to show population data for each state of the country. The shapefile is to be download from http://www.gadm.org/country
  • 9. Unzip the Zip file downloaded and you will find the following contents.
  • 10. Preparing data for shapefile: • Copy the population data from wiki link into the excel file
  • 11. Preparing data for shapefile (contd.) • Copy the data of two columns, states and population, in excel file and save the spreadsheet with CSV format(comma delimited) (*.csv). And format column types as general.
  • 12. Load the shapefile in QGIS • Click on Layer • Choose add vector layer
  • 13. Load the shapefile in QGIS (contd.) • Select the IND_adm1.shp file from the unzipped folder you have downloaded, it contains the shape and data for indian states.
  • 14. This is how it looks, color may vary
  • 15. Open attribute table • Click on menu “Layer” • Choose “Open Attribute Table”
  • 16. Attribute Table • The attribute table will contain data for states (column “NAME_1”). This field is used as a join to CSV file data. So one must be cautious that the data of the column should match otherwise make the necessary changes in CSV file. • We therefore advise you to download both files (shape and data) from the same websites if available.
  • 17. To set the internet settings for downloading plugins, if you are workin under proxy server. • Click on menu “Settings” • Select “Options”
  • 18. To set the internet settings for downloading plugins (contd.) • Select “Network” Tab • Enter your Host, Port and Proxy type of your proxy server
  • 19. To download required plugins (mmqgis and HTML Image map plugin) • There are 2 plugins we need to complete this lab exercise. If you can’t see them in plugins menu, please follow theseesteps to download • Click on menu “Plugins” • Choose “Fetch Python plugins”
  • 20. To download required plugins (contd.) • Click “Add 3rd party repositories”
  • 21. To download required plugins (contd.) • Click on “Plugins” Tab • Type “mmqgis” in textbox for search • Click on “MMQGIS” plugin • Click on Command “Install plugin”
  • 22. To download required plugins (contd.) • Follow same steps for Html Image map plugin
  • 23. Import the data file in csv format • Click on menu “plugins” • Click option “mmqgis” and then option “Attributes joins from csv file”
  • 24. Import the data file in csv format • Click on browse to select the data file(CSV) we dcreated earlier in excel • In data file select field “State or Union territory” and in Join layer attribute select option “NAME_1”. These are the fields to be joined • Save the output shapefile in your working directory and do same for the notfound csv output list. • Add joined layer must be checked and clik ok.
  • 25. Import the data file in csv format (Contd.) • A new layer will be added to your project as indicated below
  • 26. Attribute table with data • Open the attribute table again • Click “ Layer”, then click “Open attribute table” • New data has been joined with data of shapefile as shown below
  • 27. The problem mmqgis plugin is the it did not recognize number fields as numbers but as strings. So to use data properly it is to be converted into integers or reals. • For that click on pencill icon on ,as indicated in picture,to enter editing mode. Then click on calculator icon to launch field calculator
  • 28. Format Strings to numbers • Enter name(say pop_int)of new column that will hold no. value for all strings in populatio field • select whole noumberinteger) for output field type • Click “to real” in opertators section, to begin expression in the field calculator expression box. Enter field name Ppop_int” and close the paranthesis. Click ok
  • 29. Format string to numbers(contd.) • Now we will create a column that will hold a string value as a tooltip. When a mouse Is moved over a area in the map this is the message a person will see. • In output field name, enter pop_str, choose text(string) and make the output filed width 50. • Enter this formula in field calculator expression section: NAME_1+’:’+to string(populatio) • This will concatenatese the name field with population of that sate.. Now click ok
  • 30. Format string to numbers • Now you can see different columns for population in numbers and in string form. • To save these changes you must click the pencil icon.
  • 31. Colouring the map • Now we will color the map based on data file • Click on layers and select properties
  • 32. Coloring the map (cont.) • In the layer properties dialog box , choose style tab(default). Choose legend type as ‘Graduated’. For column field select ‘pop_int’. For mode choose “equal interval” • For classes choose 6, then click on classify and then click apply.
  • 33. Colouring the map(cont.) • Now the colours applied to map would be visible. And the colours of the map and legend of colours and values can be seen in layers window • We can change the default colour palette selected by QGIS. • To change colors go to style option by clicking layers menu then properties and then style tab.
  • 34. Colouring the map(contd.) • To change color, click on the color of the respective row. This will open symbol selector. click change. • To change range, click on the range next to the first colour and a dialog box will appear to allow you to change the range upper and lower values
  • 35. Colouring the map(contd.) • By clicking on change (for colour). IT will open a window Select Color. • Select bright red to differentiate it from blue. • Follow similar steps to change the colors of other ranges
  • 36. Colouring the map(contd.) • To change range after clicking on the range values, as shown in previous slide , a dialog box will appear named “enter class bounds” as shown below. You can enter upper and lower limit to define range. • Click ok • Apply the same procedure to change ranges of the other rows
  • 37. Colouring the map (contd.) • Now change the row values and colors as given in the figure below (range values in the multiples of 3 crore). • Also edit the labels next to range. You can edit labels just by double clicking on it. • After all editing click ok
  • 38. Colouring th e map (contd.) • We can see different colour codes for the different range of population in the map.
  • 39. Making an interactive web map • Whatever you see in the map window will be in your final Html map. If you want to get rid of the default icons on maps: the copy right notice, a measurement bar and a north marker. We have circled the icons, which can remove them.
  • 40. Making an interactive web map(contd.) • You can resize the QGIS window to resize the map, according to your requirement of size on webpage. • Click the magnifying class as indicated to fill up any extra space.
  • 41. Making an interactive web map(contd.) • Now we can export our map and html code to create an interactive web map. • Click on menu ‘Plugins’ and select Html Image Map Plugin. Then select image map.
  • 42. Making an interactive web map(contd.) • The defauld dimension of image size is the size of QGIS map window. If you want to change these dimensions, you can change the size of map window and try again • Set the path for file to be saved by ‘browse’. Choose a filename for the html map. • Uncheck all the boxes except onMouseOver attr. Infront of that property select field value pop_str, the field that holds the tooltip/mouseover message. Click ok
  • 43. Final Map • Open the web page file in your browser. You can see a similar picture given below. Move your mouse over individual states to see the population of that state on the top left corner.
  • 44. To use the map in already existing template • A sample template can be found at http://tbarmann.webfactional.com/nicar • Html plugin will create 3 files: an html page, a png file and a PNGw file. Open the Html file with a text editor and copy all code between the start tag (<map name =“mapmap”>)and the end tag.
  • 45. To use the map in already existing template (contd.) • Open the web page template you want to embed map on. Paste the map code into this template file. • Change the src attribute to the name of the png file created by the html image map plugin. and save the png file In the new html page directory. Now save the web page.
  • 46. To use the map in already existing template (contd.) • This template file will show the same string but below the mouse as a tooltip rather than a message at top left. Like when we move mouse to West Bengal, this tooltip appears.
  • 47. Thank You Please visit our blog http://gettingstartedwithqgis.blogspot.in/ for more such tutorials