← 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:

  1. Compares your search text with location names (English and Myanmar)
  2. Ranks results by relevance (exact match → starts with → contains)
  3. 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:

  1. Looks up the exact PCode in our database
  2. Returns the matching administrative area
  3. 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:

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:

  1. Geocoding: Asks OpenStreetMap (OSM) "Where is Shwedagon Pagoda?"
  2. Gets Coordinates: OSM returns the latitude/longitude
  3. Local Search: Uses our coordinate search to find nearby Myanmar administrative areas
  4. 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:

⚡ Performance Optimizations

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

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


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