O slideshow foi denunciado.
Utilizamos seu perfil e dados de atividades no LinkedIn para personalizar e exibir anúncios mais relevantes. Altere suas preferências de anúncios quando desejar.


6.953 visualizações

Publicada em

Talk at Cartonama'12

Publicada em: Tecnologia
  • 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
    Tem certeza que deseja  Sim  Não
    Insira sua mensagem aqui


  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