digicode.preview.mp4
A location encoding system that assigns three unique words to pinpoint any location on the Indian map with 3-meter grid accuracy. This project combines the concepts of what3words and DIGIPIN to provide exact addresses using just 3 words.
DIGICODE converts geographical coordinates to three unique words and vice versa, enabling users to:
- Share precise locations using memorable three-word combinations
- Navigate to locations using word-based addresses
- Achieve reproducible results across different devices
- Maintain 3×3 meter grid accuracy throughout India
- Interactive Map Interface: Click anywhere on the map to generate three words
- Bidirectional Conversion: Convert coordinates ↔ three words seamlessly
- Real-time Synchronization: Map clicks update input fields automatically
- Copy/Paste Functionality: Easy sharing of coordinates and word combinations
- 3-Meter Accuracy: Precise location encoding with 3×3 meter grid resolution
- India-Focused: Optimized for Indian geographical boundaries
- Algorithmic Generation: Words generated on-the-go, no pre-stored database
- React 18 - Modern React with hooks and functional components
- TypeScript - Type-safe development
- Vite - Fast build tool and development server
- Tailwind CSS - Utility-first CSS framework
- shadcn/ui - Beautiful and accessible React components
- Sonner - Toast notifications for user feedback
- Google Maps API - Interactive map functionality
- @react-google-maps/api - React wrapper for Google Maps
- Custom Word Encoding System - Proprietary algorithm for coordinate-to-word conversion
- 10,000+ Word Dictionary - Extensive wordlist for unique combinations
- Grid-based Positioning - Mathematical grid system for precise location mapping
- Node.js (v16 or higher)
- npm or yarn
- Google Maps API key
-
Clone the repository
git clone <repository-url> cd DIGICODE
-
Install dependencies
npm install
-
Set up environment variables Create a
.envfile in the root directory:VITE_GOOGLE_MAPS_API_KEY=your_google_maps_api_key_here
-
Start the development server
npm run dev
-
Open in browser Navigate to
http://localhost:5173
-
Generate Words from Map:
- Click anywhere on the map
- Three unique words will be generated and displayed
- Copy the words using the "Copy" button
-
Navigate Using Words:
- Paste three words in the format:
word1.word2.word3 - Click "Locate" to navigate to that position
- Paste three words in the format:
-
Coordinate Input:
- Enter coordinates in format:
latitude, longitude - Click "Locate" to navigate and see corresponding three words
- Enter coordinates in format:
-
Copy Functions:
- Copy coordinates:
22.288783, 70.775314 - Copy three words:
example.words.here
- Copy coordinates:
Input Coordinates: 22.3215616, 70.7657728
Generated Words: abolish.aback.abacus
Input Words: abolish.aback.abacus
Generated Coordinates: 22.321500, 70.765700
src/
├── components/
│ ├── ui/ # shadcn/ui components
│ ├── Map.tsx # Interactive map component
│ ├── LeftPanel.tsx # Input/output panel
│ └── GridLayer.tsx # Map grid overlay
├── lib/
│ ├── wordEncoding.ts # Core encoding/decoding logic
│ ├── wordlist.ts # 10k+ words dictionary
│ └── utils.ts # Utility functions
└── App.tsx # Main application component
The encoding system uses a mathematical approach:
- Converts lat/lng to grid coordinates
- Creates a unique index from grid position
- Maps index to three words using modular arithmetic
- Ensures reproducible and reversible encoding
Grid Resolution: 0.000027 degrees (~3 meters) Coverage Area: India (6.5°N to 37.1°N, 68.1°E to 97.4°E) Unique Combinations: 10,000³ = 1 trillion possible locations
✅ Three words for exact addresses: Implemented with 3-meter accuracy ✅ Reproducibility: Same coordinates always generate same words ✅ Easy pronunciation: Uses common English words ✅ Algorithmic generation: No pre-stored coordinate-word database ✅ Bidirectional conversion: Works both ways seamlessly
npm run buildThe built files will be in the dist/ directory.
This project is part of an internship assignment demonstrating location encoding concepts.
This is an educational project. Feel free to fork and experiment with different encoding algorithms or UI improvements.
Made with ❤️ for precise location sharing in India