Serving Location-based data

Serving Location-based data

by Julian Shen @LINE Developer Meetup https://linegroup.kktix.cc/events/20200918

2102a6b8760bd6f57f672805723dd83a?s=128

line_developers_tw

September 18, 2020
Tweet

Transcript

  1. Serving Location-based data Julian Shen/LINE SPOT Development

  2. Julian Shen • Graduated from NCTU • Joined LINE from

    2017 • Backend engineer • Dev Lead of LINE SPOT Team • Live in Hsinchu, work at Neihu @jlnshen julianshen Who am I ?
  3. What is LINE SPOT? Let’s start from a simple scenario

    LINE 
  4. Imagine This 要不要約在Big City? 晚餐約哪兒呀? 還Big City?? 來找些不一樣的吧!!

  5. What Would You Do?

  6. Find Paste

  7. Coupons Recommenation

  8. Make a Reservation

  9. Need a ride?

  10. Discuss Discover Reserve Transport A Long Journey Lots of tools

    to use
  11. Put it all together Makes life easier

  12. LINE SPOT is 值得信賴的生活幫手 LINE 

  13. How to find LINE SPOT (LINE ) ?

  14. What is a Location-based service (LBS) Is a software service

    which utilizes geographic data and information to provide services or information to users 適地性服務
  15. Navigation Transportation Game Safety Information Advertising, Tracking ….

  16. Search by location Finding something nearby Finding something somewhere 進入了城隍廟步行區

    新竹的咖啡廳 Sorting/Ranking by distance Search geo shapes Knowing which area I am Check if in service area 新竹市在服務範圍內 附近三公里內的藥局 Geo coding/Reverse Geo Coding
  17. Geospatial data Location: • Latitude • Longitude • Elevation* Name

    Address ..... 24.7861672 新竹市東區大學路1001 國立交通大學 120.9973317
  18. NCTU Costco TSMC NCHU   Big City  

       R (24.7861672, 120.9973317) MOS NOVA 7-11 7-11 7-11 7-11 7-11 7-11 7-11 D Finding all 7-11 in range (D<R) Euclidean distance? X Scan all data in DB?
  19. NCTU Costco TSMC NCHU   Big City  

       (24.7861672, 120.9973317) MOS NOVA 7-11 7-11 7-11 7-11 7-11 7-11 7-11 Indexing location-based data 1 2 3 4 5 6 7 8 9 A B C 1 0 1 1 A B C 1 K-D Tree …
  20. Luckily, you don’t need to invent wheels again Mongo DB

    Elastic Search Postgres SQL MySQL Redis
  21. NCTU Costco TSMC NCHU   Big City  

       R MOS NOVA 7-11 7-11 7-11 7-11 7-11 7-11 7-11 D Finding all 7-11 in range (D<R)  Julian Evan (24.7861672, 120.9973317) (24.7861671, 120.9973318) • Julian & Evan should get similar results • GPS coordinates will never be the same even if you stay in the same place • Caching results is a problem
  22. What if (24.7861672, 120.9973317) (24.7861671, 120.9973318) wsqj125tf Geohash

  23. 1 2 0 4 5 h j n p 3

    6 7 k m q r 8 9 d e s t w x z y v u g f c b t w ws ws wsq wsqj125tf wsqj125t0 wsqj125t wsqj125tfb Geohash Level 1 Level 2 Level 3 Level 8
  24. Geohash length Cell width Cell height 1 ≤ 5,000km 5,000km

    2 ≤ 1,250km 625km 3 ≤ 156km 156km 4 ≤ 39.1km 19.5km 5 ≤ 4.89km 4.89km 6 ≤ 1.22km 0.61km 7 ≤ 153m 153m 8 ≤ 38.2m 19.1m 9 ≤ 4.77m 4.77m 10 ≤ 1.19m 0.596m 11 ≤ 149mm 149mm 12 ≤ 37.2mm 18.6mm Precision
  25. gbpbpbp u000000 ezzzzzz spbpbpb u0000000 spbpbpbp ezzzzzzz gbpbpbpb Problem

  26. S2 Cell ID H3

  27. 美食沙漠的出口

  28. Thank You