DEV Community

Evan Lin
Evan Lin

Posted on • Originally published at evanlin.com on

Conference Notes: Handling Geographic Information in LINE Hotspots

Preface

Hello everyone, I am Evan Lin from the LINE Taiwan DevRel team. I am very happy to share with you in this year's third developer meetup, where Julian Shen from the LINE SPOT Team will share his experiences and the problems he encountered when dealing with geographic data (location-based data). Regarding LINE SPOT, you can refer to Julian's introduction to the LINE SPOT service at TECHPULSE 2019. For more information on the LINE SPOT service and its architecture, please refer to this article: "LINE TAIWAN TECHPULSE 2019 Tech Conference Highlights".

KKTIX event webpage: Event URL

Other related articles:

LINE Shopping App with Flutter: Using Flutter to build the LINE Shopping mobile dual-platform application

"How ML Powers LINE Services" How machine learning makes LINE's services more user-friendly

Slides

Lecture Video

Geographic Information Services Location-Based Services

This time, we will mainly introduce LBS: Location-Based Service. We often see LBS-related games or services, such as check-ins, maps, and navigation. There are also many technologies that can be used to find the distance between two points.

Finding attractions within a few kilometers

When dealing with the above, we often get GPS coordinates or directly get the address. Addresses are convenient for humans to read, but the coordinates of latitude and longitude are what computers can truly process. If you want to find all the coordinates within a three-kilometer radius of a certain coordinate, do you need to calculate all the locations in the database? Here, a method called K-D Tree is introduced.

The K-D Tree method is to divide the map plane by bisection, and find the distance between every two points as a block. In this way, you can quickly find the two closest distance points.

How to Cache Search Results

If a group of people are simultaneously using LINE SPOT and need to find all coordinates within three kilometers, is there a way to quickly cache the data and quickly respond to user needs? At this time, you can consider using Hashing to directly convert the latitude and longitude values into a string of text. Through this method, you can quickly find the results of the last search. If you haven't searched before, then run the K-D Tree search, so that you can quickly respond to the user without complex calculations.

Although this method can quickly determine whether a search has been performed, there are some problems as follows:

  • Due to the use of zig zag traversal for hashing, different latitudes and longitudes may have very similar results.
  • It may be very close, and the geohashing results may be different due to the boundary.

Other methods

Google has also proposed the S2 Cell ID method to distinguish geographic information. Uber has also proposed the H3 method, which divides the entire geographic information through hexagonal blocks. Because of the use of hexagons, the spherical geographic conditions of the earth can be expressed more accurately.

"LINE Hotspot" Food Recommendations

Don't say that Hsinchu City is a food desert anymore, LINE Hotspot also has a selection of "Ten Hsinchu Local Food Stores".

Event Summary

I hope that after the students understand the experience sharing of geographic information processing. You can also come to LINE Hotspot to share your Hsinchu food map.

Join the "LINE Developer Official Community" official account immediately, and you will receive push notifications of the latest Meetup events or the latest news related to the developer program. ▼

"LINE Developer Official Community" Official Account ID: @line_tw_dev

About the "LINE Developer Community Program"

LINE launched the "LINE Developer Community Program" in Taiwan at the beginning of this year, and will invest manpower and resources in Taiwan for a long time to hold internal and external developer community gatherings, recruitment days, developer conferences, etc., and has held more than 30 events. Readers are welcome to continue to check back for the latest updates. For details, please see:

Top comments (0)