GeoHashencode(lat/long) --> string
Whats the plan today?What is geohash?Why do we need it?geohash.orgHow does it work?Grouping and ZoomingNearby (proximity) ...
Who am I?Co-Founded Ideophone with @oligoglot & @anenthhelped building @pyka, @suruk, @onetouchsos,@kopa_appproduct archit...
What is geohash?Simple way to encode lat/long into a stringCompact string encoding of geographic coordinate witharbitrary ...
Why do we need it when we have LL?Big address of this venueComplicated Lat/Long {12.963787,77.637789}      The Mail from C...
● Subdivides space into "buckets" of grid shape● Doesnt really represent a point, rather a bounding   area in which the po...
How does it work?11001 01100 10111 00001 11100 11101 11110 10101 00101 01100 10100 00111 11011  t     d     r    1     w  ...
geohash.org              Short URL uniquely              identifying points on              earth              Referencing...
Grouping and ZoomingEasy grouping   ○ tdr1wxyp5dn7v -> {12.9637069, 77.6377931}         ●   4th Main Rd, Domlur II Stage, ...
Nearby (Proximity) Search● Nearby locations usually share similar prefixes.● Long common prefixes indicate two places are ...
Nearby Searchtdr1wxyp5dn7v (TERI)tdr1wxyqekmg (Bangalore Intl Chapter)tdr1y8jbvrmc (Domlur Club)tdr1y8jykh6w (CIS)tdr1ybmh...
Finding Nearby PlacesPython, Perl, PHP, Java etcpython-geohash    ○   Encode/Decode    ○   BoundingBox           {s: 12.91...
Finding Nearby Places● Proximity Search   ○ Bottoms-Up                        ● Bounding Box Search                       ...
Finding Nearby Places● Compute geohash  values for all Lat/Long● Have index on  geohash for quicker  retrievals
Finding Nearby Places● Prefix Match:   SELECT * FROM table WHERE place_geohash LIKE hashcode%● Expand/Neighbors Match   SE...
Limitations● Locality Anomalies   ○ Complicates Proximity Searches   ○ Need to use bounding box extensively making      se...
Demohttp://openlocation.org/geohash/geohash-js/http://geohash.gofreerange.com/
Conclusions● Simple and effective system to map complex lat-long   coordinates into simple string representations● Useful ...
Thank you!@sandeepbhaskarhttps://github.com/sandeepbhaskar/geohash-demo
Upcoming SlideShare
Loading in...5
×

Geohash

3,407

Published on

Talk at Cartonama'12
http://funnel.hasgeek.com/cartonama/502-geohash-system-and-nearby-searches

Published in: Technology
1 Comment
6 Likes
Statistics
Notes
  • Hi ,i am doing the project on geohash.Can you send me the data base like lat-lon tables of places you have in database.........My email Id is :narendra.palempati@yahoo.in
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total Views
3,407
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
56
Comments
1
Likes
6
Embeds 0
No embeds

No notes for slide

Geohash

  1. 1. GeoHashencode(lat/long) --> string
  2. 2. Whats the plan today?What is geohash?Why do we need it?geohash.orgHow does it work?Grouping and ZoomingNearby (proximity) searchesThe Edge caseLimitationsDemo (Lets see it working)
  3. 3. Who am I?Co-Founded Ideophone with @oligoglot & @anenthhelped building @pyka, @suruk, @onetouchsos,@kopa_appproduct architecture, platform developmentx-SunTec, x-TAT, mtech from IIIT-B
  4. 4. What is geohash?Simple way to encode lat/long into a stringCompact string encoding of geographic coordinate witharbitrary precision Bangalore - TDR1, Domlur - TDR1WXInvented by Gustavo Niemeyer for geohash.orgAvailable in public domain http://en.wikipedia.org/wiki/geohash/
  5. 5. Why do we need it when we have LL?Big address of this venueComplicated Lat/Long {12.963787,77.637789} The Mail from Cartonama couldve said Venue: "tdr1wxyp5dn7v"
  6. 6. ● Subdivides space into "buckets" of grid shape● Doesnt 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 areaDemo
  7. 7. How does it work?11001 01100 10111 00001 11100 11101 11110 10101 00101 01100 10100 00111 11011 t d r 1 w x y p 5 d n 7 v !
  8. 8. geohash.org Short URL uniquely identifying points on earth Referencing them on emails, website etc becomes far more convenient Bangalore: http://geohash.org/tdr1 Domlur: http://geohash. org/tdr1wx
  9. 9. Grouping and ZoomingEasy grouping ○ tdr1wxyp5dn7v -> {12.9637069, 77.6377931} ● 4th Main Rd, Domlur II Stage, Domlur, Bengaluru, Karnataka ○ tdr1wxyp5dn7v -> {12.9637, 77.6378} ● Domlur, Bengaluru, Karnataka ○ tdr1wxyp5dn7v -> {12.96, 77.64} ● Bengaluru, Karnataka ○ tdr1wxyp5dn7v -> {13, 78} ● Malur-Bangarapettu Rd
  10. 10. Nearby (Proximity) Search● Nearby locations usually share similar prefixes.● Long common prefixes indicate two places are near, however two nearby places do not always have common prefixesThere is an Edge Case:E.g. Two nearby places in BostonDRT..DRM..
  11. 11. Nearby Searchtdr1wxyp5dn7v (TERI)tdr1wxyqekmg (Bangalore Intl Chapter)tdr1y8jbvrmc (Domlur Club)tdr1y8jykh6w (CIS)tdr1ybmhdj4p (Ideophone)tdr1v4e3mecx (Majestic Station)tf346wn2t49t (Chennai Central)9q8vzpgn7we0 (SFO Airport)
  12. 12. Finding Nearby PlacesPython, Perl, PHP, Java etcpython-geohash ○ Encode/Decode ○ BoundingBox {s: 12.919921875, e: 77.6513671875, w: 77.607421875, n: 12.9638671875} ○ Neighbours [ezefx,ezefr,ezefp,ezs40, ezs41,ezs43,ezs49,ezs48]
  13. 13. Finding Nearby Places● Proximity Search ○ Bottoms-Up ● Bounding Box Search ○ Hops to neighbors until POI is found
  14. 14. Finding Nearby Places● Compute geohash values for all Lat/Long● Have index on geohash for quicker retrievals
  15. 15. Finding Nearby Places● Prefix Match: SELECT * FROM table WHERE place_geohash LIKE hashcode%● Expand/Neighbors Match SELECT * FROM table WHERE place_geohash IN (geohash.expand(tzxy1))
  16. 16. Limitations● Locality Anomalies ○ Complicates Proximity Searches ○ Need to use bounding box extensively making search an expensive operation● Projection based model ○ A geohash of given length will denote different region size in poles than in equator region
  17. 17. Demohttp://openlocation.org/geohash/geohash-js/http://geohash.gofreerange.com/
  18. 18. Conclusions● Simple and effective system to map complex lat-long coordinates into simple string representations● Useful in applications where "nearness" of POIs is more relevant than accurate distance computation● Enables quick db access using LIKE using grouping of prefixes of geohashes
  19. 19. Thank you!@sandeepbhaskarhttps://github.com/sandeepbhaskar/geohash-demo
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×