Geohash
{lat/lon → string}
Python Developer Nepal Meetup #6
March 19, 2015
Who am I?
Narayan Kandel
Developer at nLocate (Python/Django)
Previously Java Developer at Deerwalk
What I Will Cover
1. Our requirements
2. What is a geohash?
3. How does it work?
4. How we use it?
Our Requirement
● Analyze visitor from different location
○ different data
1. business data
2. user generated log
● Duplication Check
What is Geohashing
Simple way to encode lat/lng into a string
Compact string encoding of geographic coordinate with
arbitrary precision
Kathmandu - tuut, Chitwan - tuuj
Invented by Gustavo Niemeyer for geohash.org
Available in public domain http://en.wikipedia.org/wiki/geohash/
Why do we need it when we have lat/lon
Big address of venue
ABC road
Lalitpur Sub-Municipality -12, Kupondole
Lalitpur, Bagmati
Nepal
Complicated Lat/Long
{27.6830282799,85.3180309269}
● Subdivides space into "buckets" of grid shape
● Doesn't really represent a point, rather a bounding
area in which the point is present
● Hierarchical spatial structure with gradual degradation
● Longer the geohash
→ Smaller the area
snap taken from geohash.gofreerange.com
How does it work?
How does it work?
Mapping
5 bits (25
) = 32 alpha-numeric
1-9 b-z except a, i, l, o
*http://en.wikipedia.org/wiki/Geohash
How does it work?...
demo
snap taken from geohash.gofreerange.com
Lets come to our problem
● Analyze visitor from different location
Method 1:
Polygon
Analyze visitor from different location ...
Method 2
Geohashing
Prefix Matching
Other Area Where we used it
● To find duplicate Spot - O(n2
)
Other Application
● twitter - location based tweet count/find trend on particular location
● flickr/instagram - find location based photo with area selection on
number of prefix
● alerter system at telecommunication (integration of hardware
location + customer complain location)
● and many more...
References
● Geohash - http://en.wikipedia.org/wiki/Geohash
Thank You
twitter: @dearnarayan
email: narayan@nlocate.com

Geohash

  • 1.
    Geohash {lat/lon → string} PythonDeveloper Nepal Meetup #6 March 19, 2015
  • 2.
    Who am I? NarayanKandel Developer at nLocate (Python/Django) Previously Java Developer at Deerwalk
  • 3.
    What I WillCover 1. Our requirements 2. What is a geohash? 3. How does it work? 4. How we use it?
  • 4.
    Our Requirement ● Analyzevisitor from different location ○ different data 1. business data 2. user generated log ● Duplication Check
  • 5.
    What is Geohashing Simpleway to encode lat/lng into a string Compact string encoding of geographic coordinate with arbitrary precision Kathmandu - tuut, Chitwan - tuuj Invented by Gustavo Niemeyer for geohash.org Available in public domain http://en.wikipedia.org/wiki/geohash/
  • 6.
    Why do weneed it when we have lat/lon Big address of venue ABC road Lalitpur Sub-Municipality -12, Kupondole Lalitpur, Bagmati Nepal Complicated Lat/Long {27.6830282799,85.3180309269}
  • 7.
    ● Subdivides spaceinto "buckets" of grid shape ● Doesn't really represent a point, rather a bounding area in which the point is present ● Hierarchical spatial structure with gradual degradation ● Longer the geohash → Smaller the area snap taken from geohash.gofreerange.com
  • 8.
  • 9.
  • 10.
    Mapping 5 bits (25 )= 32 alpha-numeric 1-9 b-z except a, i, l, o *http://en.wikipedia.org/wiki/Geohash
  • 11.
    How does itwork?... demo snap taken from geohash.gofreerange.com
  • 12.
    Lets come toour problem ● Analyze visitor from different location Method 1: Polygon
  • 13.
    Analyze visitor fromdifferent location ... Method 2 Geohashing Prefix Matching
  • 14.
    Other Area Wherewe used it ● To find duplicate Spot - O(n2 )
  • 15.
    Other Application ● twitter- location based tweet count/find trend on particular location ● flickr/instagram - find location based photo with area selection on number of prefix ● alerter system at telecommunication (integration of hardware location + customer complain location) ● and many more...
  • 16.
    References ● Geohash -http://en.wikipedia.org/wiki/Geohash
  • 17.