← Back to Myanmar PCode Search
How Search Works - Myanmar PCode Search
Search Methods
Our application provides four different ways to search for Myanmar locations:
1. Text Search (Name Search)
How it works: Type any town, ward, village tract, or village name
Example: "Yangon" → finds all locations with "Yangon" in the name
Search Process:
- Compares your search text with location names (English and Myanmar)
- Ranks results by relevance (exact match → starts with → contains)
- Shows results sorted by best match first
2. PCode Search
How it works: Search using official administrative codes
Example: "MMR001" → finds the specific administrative area with that PCode
Search Process:
- Looks up the exact PCode in our database
- Returns the matching administrative area
- Very fast since PCodes are unique identifiers
3. Coordinate Search
How it works: Enter latitude and longitude to find nearby locations
Example: "16.8661, 96.1951" → finds villages near Yangon City Hall
Supported Input Formats:
- Direct coordinates: 16.8661, 96.1951
- Google Maps URLs: Paste any Google Maps link and we extract coordinates automatically
- Various formats: Decimal degrees, with/without spaces
4. Landmark Search
How it works: Search for places near famous landmarks, temples, or businesses
Example: "Shwedagon Pagoda" → finds villages near the famous pagoda
Search Process:
- Geocoding: Asks OpenStreetMap (OSM) "Where is Shwedagon Pagoda?"
- Gets Coordinates: OSM returns the latitude/longitude
- Local Search: Uses our coordinate search to find nearby Myanmar administrative areas
- Results: Shows PCodes and postal codes for areas near that landmark
Key Technical Innovations
🚀 Smart Spatial Indexing
We made searching 50-100x faster by dividing Myanmar into invisible grid squares (~11km each):
Myanmar Map divided into grid squares:
┌─────┬─────┬─────┬─────┐
│ A │ B │ C │ D │ Each square = ~11km x 11km
├─────┼─────┼─────┼─────┤
│ E │ F │ G │ H │ Your search only checks
├─────┼─────┼─────┼─────┤ nearby squares, not all squares
│ I │ J │ K │ L │
└─────┴─────┴─────┴─────┘
Performance Impact:
Before: Check ALL 50,000+ locations ❌ (2-5 seconds)
Now: Check only ~100-500 nearby locations ✅ (50-200ms)
🎯 Google Maps Integration
Paste any Google Maps URL and we automatically extract coordinates using regex patterns:
Supported URL formats:
• https://maps.google.com/maps?q=16.8661,96.1951
• https://www.google.com/maps/@16.8661,96.1951,15z
• https://goo.gl/maps/xyz (shortened URLs)
🗺️ OpenStreetMap Integration
Search landmarks using OSM Nominatim geocoding:
- Real landmarks: "Shwedagon Pagoda", "Mandalay Airport"
- Business areas: "Bogyoke Market", "Junction City"
- Multiple languages: English and Myanmar names supported
⚡ Performance Optimizations
- Smart Caching: Remembers distance calculations for instant repeated searches
- Haversine Formula: Accurate Earth-curvature distance calculations
- Parallel Processing: Batch coordinate uploads process multiple locations simultaneously
- Bounding Box Filtering: Quick rectangular checks before expensive distance calculations
Batch Processing
Process up to 1000 coordinates with parallel processing:
CSV Format:
id,latitude,longitude
1,16.8661,96.1951
2,21.9588,96.0891
- 100 coordinates: ~30-60 seconds
- 1000 coordinates: ~5-10 minutes
- Real-time progress: Live updates during processing
Technical Details
Distance Calculation
We use the Haversine Formula for precise Earth-surface distances:
Input: Two points (lat1,lon1) and (lat2,lon2)
Output: Distance in kilometers
Accuracy: Precise to within a few meters
Data Coverage
- 50,000+ villages with coordinates and postal codes
- Myanmar boundaries: Lat 9.5° to 28.5°N, Lon 92.0° to 101.5°E
- Administrative hierarchy: Region → District → Township → Ward/Village Tract → Village
Summary: We transformed a slow location search into a lightning-fast system using spatial indexing, smart caching, and modern web APIs. What used to take minutes now happens in milliseconds.
← Back to Myanmar PCode Search