Skip to content

nviewsweb/digipin

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

India Post

भारतीय डाक · डाक सेवा जन सेवा

DIGIPIN logo DIGIPIN

Ministry of Communications

Government of India

🌐 A Geospatial Addressing Solution by India Post

DIGIPIN logo DIGIPIN (Digital PIN) is visualized as an geospatial addressing grid system that assigns a unique 10-digit alphanumeric code that represents a 4-meter by 4-meter(approx.) units, derived from the latitude and longitude coordinates of the unit. This alphanumeric code serves as the addressing reference for any specific location within the DIGIPIN system. DIGIPIN is a function of the latitude and longitude of the location represented as a grid value.

This open-source Node.js project exposes a public API to generate and decode DIGIPINs, supporting geolocation services, postal logistics, and spatial analysis applications.

License Node.js Express


🏛️ About DIGIPIN

The Department of Posts has undertaken an initiative to establish a Digital Public Infrastructure (DPI) for a standardized, geo-coded addressing system in India. DIGIPIN represents the foundation layer of this infrastructure.

Developed in collaboration with IIT Hyderabad and NRSC (National Remote Sensing Centre, ISRO), DIGIPIN is an open-source national-level addressing grid that serves as a key component of India's digital address ecosystem.

After extensive public consultation and expert review, the DIGIPIN Grid has been finalized to provide simplified addressing solutions for seamless delivery of public and private services, enabling "Address as a Service" (AaaS) across the country.

It provides a precise, user-friendly, and interoperable method for representing geographic locations, enabling seamless conversion between DIGIPIN codes and latitude/longitude coordinates for easy sharing, navigation, and digital addressing.

✨ Key Highlights

  • Uniform Referencing Framework: Provides logical, precise location identification both offline and online
  • GIS Integration: Bridges the gap between physical and digital addresses
  • Cross-Sector Support: Enhances service delivery across emergency response, e-commerce, logistics, BFSI, and governance
  • Policy Alignment: Complies with the National Geospatial Policy 2022, enriching India's geospatial knowledge stack

DIGIPIN simplifies address management and enhances service delivery accuracy, promoting a thriving geospatial ecosystem for India's digital economy.


⚙️ Features

  • Encode: Convert latitude and longitude into a compact 10-character DIGIPIN
  • Decode: Transform a DIGIPIN back to its center-point coordinates
  • Lightweight: Optimized for performance and minimal resource usage
  • RESTful API: Clean, standard-compliant endpoints
  • Interactive Documentation: Comprehensive Swagger UI for easy exploration
  • Production-Ready: Built with Node.js and Express for reliability

🔖 DIGIPIN Representation Guidelines

DIGIPIN shall be represented using the official DIGIPIN symbol adopted by the Department of Posts, Government of India, followed by a valid 10-character alphanumeric DIGIPIN.

For digital processing, storage, transmission, and interoperability, DIGIPIN shall be maintained as a continuous 10-character identifier containing only approved DIGIPIN characters. Hyphens (-) and other punctuation characters are not permitted. For display purposes, spaces may optionally be used in a 3-4-3 grouping pattern to improve readability.

Representation Status
DIGIPIN  C4P8K63M4M ✅ Approved
DIGIPIN  C4P 8K63 M4M ✅ Acceptable Display Format
C4P8K63M4M ❌ DIGIPIN symbol missing
DIGIPIN  C4P-8K6-3M4M ❌ Hyphens are not permitted

Note: For APIs, databases, integrations, and system-to-system exchange, DIGIPIN shall always be represented as a continuous 10-character alphanumeric identifier without spaces, hyphens, or other punctuation characters.


📦 Installation

Prerequisites

  • Node.js (v14 or higher)
  • npm (v6 or higher)

Getting Started

  1. Clone the Repository
git clone https://github.com/INDIAPOST-gov/digipin.git
cd digipin
  1. Install Dependencies
npm install
  1. Environment Setup

Create a .env file in the project root with the following variables:

PORT=5000
NODE_ENV=development
  1. Start the Server
npm start

For development with hot reloading:

npm run dev

The API will be available at http://localhost:5000.


🚀 API Usage

The project exposes two primary REST APIs: an encoding API to generate a DIGIPIN from latitude and longitude coordinates, and a decoding API to derive geographic coordinates from a valid DIGIPIN.

1. Encode Coordinates to DIGIPIN

The API validates the supplied latitude and longitude coordinates and encodes them into a single unique 10-character alphanumeric DIGIPIN string, without any punctuations.

Example Request

GET /api/digipin/encode?latitude=13.11179621&longitude=80.20264269

Example Response:

json
{
  "digipin": "4T396F42L7"
}

2. Decode DIGIPIN to Coordinates

The API validates the supplied 10-character alphanumeric DIGIPIN and decodes it into the corresponding geographic coordinates (latitude and longitude) representing the center point of the identified grid cell.

Example Request

GET /api/digipin/decode?digipin=4P3JK852C9

Example Response:

json
{
    "latitude": "12.971601",
    "longitude": "77.594584"
}

Interactive API Documentation

Access the Swagger UI documentation at:

http://localhost:5000/api-docs

🔧 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Please ensure your code adheres to the existing style and passes all tests.


📜 License

This project is licensed under the Apache License, Version 2.0 - see the LICENSE file for details.


🙏 Acknowledgements

  • Department of Posts, Government of India
  • Indian Institute of Technology, Hyderabad
  • National Remote Sensing Centre, ISRO

⚖️ Legal


Transforming addresses for Digital India

📝 Release Information

See CHANGELOG.md for version history and release notes.

About

DIGIPIN is an open-source, geo-coded addressing system developed by India Post in collaboration with IIT Hyderabad and NRSC, ISRO. It enables “Address as a Service” (AaaS) by linking physical locations to its digital representation, allowing seemless encoding/decoding

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%