A simple data visualization that maps (pun intended) Postal Index Number (PIN) Codes of India to Hex Triplet colours, resulting in a colourful geographic representation of the Indian Postal Code System.
This project converts each 6-digit PIN Code into a hexadecimal colour code and displays the corresponding postal areas on an interactive map. Each geographical region of a PIN is filled with the corresponding hexadecimal colour, creating a vibrant mosaic representing Indian postal geography.
Each 6-digit PIN (for example, 560001
) becomes a hexadecimal colour code (#560001
). For more, read my LinkedIn, Substack Post.
-
Download the required data file
- From data.gov.in, download the data.
- Place the file as
data.geojson
in the same directory asindex.html
.
-
Start a local web server
Using Python3 (recommended):
python -m http.server 8000
Using Python 2
python -m SimpleHTTPServer 8000
Using Node.js:
npx http-server
Using PHP:
php -S localhost:8000
-
Open in browser
- Navigate to
http://localhost:8000
- Wait for the map to load (may take time depending on data size)
- Navigate to
- leaflet.js. It is the interactive mapping library.
- OpenStreetMap for base map tiles.
- No additional build tools or frameworks are required
- Created by Hiran Venugopalan using Claude AI
- Thanks to OSM Kerala Team
- Data Source is on Government of India Open Data Platform