Skip to content

Data Formats Explained

Shapefiles, CSVs, Rasters, APIs β€” demystified in plain language.


Why Formats Matter

When you find a dataset, it usually comes in a specific file format. The format tells you:

  1. What software can open it
  2. What kind of data it contains (tables? maps? images?)
  3. What skills you need to use it

This page explains the most common formats you will encounter in this book.


Non-Spatial Formats (Tables & Reports)

These formats contain rows and columns of data β€” no geographic component.

πŸ“Š CSV (Comma-Separated Values)

The most common, most useful format

A CSV is essentially a spreadsheet saved as plain text. Every row is a record (e.g., a district), every column is a field (e.g., population, literacy rate).

Pros Cons
Opens in Excel, Google Sheets, Python, R No geographic info (just names/codes)
Small file size No styling or formulas
Works everywhere Large files can be slow

How to open: Excel β†’ File β†’ Open β†’ Browse to .csv file

Example in this book: Census population tables, MGNREGA work data, UDISE+ school data


πŸ“„ PDF / Reports

Human-readable, not machine-readable

Many government datasets come as PDF reports. These are great for reading but difficult to analyse automatically.

Tip: Look for the "Data" or "Tables" section on the same portal β€” often a downloadable Excel or CSV version exists alongside the PDF.

Example in this book: ASER Annual Reports, Forest Survey of India reports


πŸ“‹ Excel / ODS

Spreadsheet with multiple sheets

Similar to CSV but with multiple tabs, formulas, and formatting. Government portals often provide both Excel and CSV.

How to open: Microsoft Excel, LibreOffice Calc, Google Sheets


Spatial / Geographic Formats

These formats store location information β€” points, lines, polygons, or images tied to real-world coordinates.

πŸ“ Shapefile (.shp)

The most common GIS vector format

A Shapefile is not one file β€” it's a bundle of at least 3 files:

district_boundary/
β”œβ”€β”€ districts.shp   β†’ The actual geometry (shapes)
β”œβ”€β”€ districts.dbf   β†’ The attribute table (data about each shape)
β”œβ”€β”€ districts.prj   β†’ The projection (coordinate system)
└── districts.shx   β†’ Index file

Keep All Files Together

Never move just the .shp file β€” always keep the entire folder. QGIS and other GIS software need all files to open a Shapefile correctly.

How to open: QGIS (free), ArcGIS, Python (geopandas)

Example in this book: District boundaries, PMGSY road networks, village boundaries


πŸ—ΊοΈ GeoJSON (.geojson)

The modern, web-friendly vector format

GeoJSON stores the same information as Shapefiles but in a single file, readable by any text editor. It's widely used in web maps.

How to open: QGIS, any text editor, JavaScript/Python

When to use: Web development, sharing data online, modern GIS workflows


πŸ–ΌοΈ GeoTIFF (.tif / .tiff)

Raster image with geographic coordinates

A GeoTIFF looks like a photograph but it's attached to real-world coordinates. Each pixel has a geographic location.

Examples: - Satellite images (Landsat, Sentinel) - Elevation models (DEM) - Land use maps - Rainfall grids

How to open: QGIS, Python (rasterio, rioxarray)


🌐 NetCDF (.nc)

Scientific data for climate and weather

NetCDF (Network Common Data Form) is used for multi-dimensional data like rainfall over time, temperature grids, and ocean data.

Example in this book: IMD gridded rainfall data (daily/monthly, 0.25Β° grid across India)

How to open: Python (xarray, netCDF4), QGIS with NetCDF plugin


Web Service Formats

These are not files you download β€” instead, you connect to a live server.

🌍 WMS β€” Web Map Service

A map that loads live from a server

WMS delivers pre-rendered map tiles (images) from a server. You can view them in QGIS or embed them in a web map, but you cannot query individual features.

Use case: Load Bhuvan satellite imagery as a background layer in QGIS.

How to use: QGIS β†’ Layer β†’ Add Layer β†’ Add WMS/WMTS Layer β†’ Enter URL


πŸ”· WFS β€” Web Feature Service

Vector data delivered live from a server

WFS delivers actual vector features (geometries + attributes) that you can query, filter, and download.

Use case: Get all river polygons within a specific district from the Bhuvan server.

How to use: QGIS β†’ Layer β†’ Add Layer β†’ Add WFS Layer β†’ Enter URL


⚑ API (Application Programming Interface)

Programmatic access to data

An API lets software communicate with a data server. Instead of downloading a file, you send a request and get back data in JSON format.

Use case: Get the latest MGNREGA employment data for your district using a Python script.

How to use: Python requests library or JavaScript fetch()


Format Decision Guide

I need data for...
β”‚
β”œβ”€β”€ Excel analysis or charts?
β”‚   β†’ CSV or Excel (.xlsx)
β”‚
β”œβ”€β”€ Making a map in QGIS?
β”‚   β”œβ”€β”€ Boundaries / roads / points? β†’ Shapefile or GeoJSON
β”‚   └── Satellite image or rainfall grid? β†’ GeoTIFF or NetCDF
β”‚
β”œβ”€β”€ Web development / JavaScript?
β”‚   β†’ GeoJSON or API (JSON)
β”‚
└── Python / R data science?
    β”œβ”€β”€ Table data? β†’ CSV
    β”œβ”€β”€ Spatial vector? β†’ GeoJSON (geopandas)
    β”œβ”€β”€ Raster? β†’ GeoTIFF (rasterio)
    └── Climate/time-series? β†’ NetCDF (xarray)

✏️ Exercise: Identify the Format

Exercise 0.2 β€” Match the Format

For each use case below, decide which format would be best:

  1. You want to show the boundaries of India's states on a Google Maps-style web app.
  2. You want to analyse district-wise literacy rates in Python using pandas.
  3. You want to visualise monthly rainfall patterns across India for 10 years.
  4. You want to add a satellite imagery background to your QGIS map.
  5. You want to automatically fetch live data from a government portal every day.

Answers: GeoJSON | CSV | NetCDF | WMS/GeoTIFF | API


Next Chapter: Chapter 1 β€” Administrative Boundaries & Maps β†’