QGIS Basics for Beginners¶
The world's most popular open-source GIS software — make professional maps without writing a single line of code.
Installing QGIS¶
Windows¶
- Go to qgis.org/download
- Click "Download for Windows" → Choose the Long Term Release (LTR) — most stable
- Download the installer (~450 MB) → Run it → Follow setup wizard
- Select QGIS Desktop (tick the box)
- Installation takes about 5 minutes
On your bookenv (Python) — QGIS Python console¶
QGIS comes with a built-in Python console. But for this chapter, we focus on the GUI.
QGIS Interface Overview¶
┌─────────────────────────────────────────────────────────────┐
│ Menu Bar: Project | Edit | View | Layer | Vector | Raster │
├──────────────────────────────────────────────────────────────┤
│ Toolbars: Zoom | Pan | Select | Identify | Measure │
├──────────────────────────────────────────────────────────────┤
│ Layers Panel │ │
│ ┌───────────┐ │ MAP CANVAS │
│ │ ✅ Layer 1│ │ (Your map appears here) │
│ │ ✅ Layer 2│ │ │
│ │ ❌ Layer 3│ │ │
│ └───────────┘ │ │
├────────────────┴─────────────────────────────────────────────┤
│ Status Bar: CRS | Scale | Coordinates | Rotation │
└──────────────────────────────────────────────────────────────┘
Loading Your First Shapefile¶
- Download a shapefile — e.g., GADM India Level 2 from gadm.org
- Open QGIS
- Drag and drop the
.shpfile onto the map canvas - The districts appear on screen!
Alternatively: Layer → Add Layer → Add Vector Layer → Browse to your .shp file
Styling: Graduated Colours (Choropleth Map)¶
To colour districts by an attribute (e.g., literacy rate):
- Right-click your district layer → Properties
- Click the Symbology tab on the left
- Change "Single Symbol" to "Graduated"
- Value field: Select your data column (e.g.,
Literacy_R) - Color ramp: Choose a colour ramp (e.g.,
Reds,RdYlGn) - Classes: 5 is a good starting point
- Click "Classify" → Click "OK"
Your choropleth map is ready!
Joining CSV Data to Boundaries¶
You often have statistics (CSV) and boundaries (Shapefile) separately. Join them:
- Load your district shapefile in QGIS
- Load your CSV file: Layer → Add Layer → Add Delimited Text Layer
- Click the district layer → Layer Properties → Joins
- Click + → Set Join Layer (your CSV) → Join Field (district name in CSV) → Target Field (district name in shapefile)
- Click OK → The CSV columns are now joined to the shapefile
Join Key: Name Matching
District names in Census CSV and shapefile may not match exactly ("PUNE" vs "Pune" vs "पुणे"). Use Python to clean the names before joining, or use district codes (more reliable).
5 Essential QGIS Plugins¶
Install via Plugins → Manage and Install Plugins:
| Plugin | What It Does |
|---|---|
| QuickMapServices | Add Google Maps, OSM, Bing as background |
| QGIS2Web | Export your map to a Leaflet/MapLibre web page |
| mmqgis | Geocoding, CSV join tools, label placement |
| QuickOSM | Download OpenStreetMap data for any area |
| Profile Tool | Create elevation profile along a path |
Making a Print-Ready Map¶
- Project → New Print Layout → Give it a name
- Add Map: Click the map icon → Drag a rectangle on the canvas → The map view appears
- Add Title: Add Item → Add Label → Type your title
- Add Legend: Add Item → Add Legend → Click on the map
- Add Scale Bar: Add Item → Add Scale Bar
- Add North Arrow: Add Item → Add North Arrow → Choose a style
- Export: Layout → Export as PDF (or PNG/SVG)
✏️ Practice Exercise¶
Exercise 7.1 — Publication-Quality Literacy Map
Goal: Make a complete, publication-quality map of India's district-level literacy rates.
Data needed: - Census 2011 district literacy CSV (from data.gov.in) - GADM Level 2 shapefile (from gadm.org)
Steps:
1. Load GADM India Level 2 in QGIS
2. Load Census literacy CSV as a Delimited Text Layer
3. Join: Layer Properties → Joins → Join Census CSV to GADM shapefile using district name
4. Style: Graduated → Value = literacy rate → Color = RdYlGn reversed → 7 classes → Classify
5. Add QuickMapServices background: select OSM Standard
6. Open Print Layout:
- Title: "Literacy Rates by District — India 2011 Census"
- Add legend (labelled correctly)
- Add scale bar
- Add north arrow
- Add data source note in a text box: "Source: Census of India 2011"
7. Export as PDF
Questions: - [ ] Which state shows the most uniformly high literacy? - [ ] Are there any districts with literacy below 40%? Where are they? - [ ] Can you see a north-south divide in literacy rates?