Geek Culture
Published in

Geek Culture

Creating a Location-Based Search using Geocoding

https://miro.medium.com/max/1181/1*AS1LAUPL5gfRCZb1M2T1gg.jpeg

What is location-based search?

You probably already know what it is. You use it every day when you look for a new restaurant in your area to try out or when you’re looking for the nearest gas station when you’re out and about on the road.

How I went about implementing a location-based search?

Gathering Data

The first thing you need is some data. Whether it be fake locations that you create with some random GPS coordinates or real data that was scraped from websites, you definitely need some kind of data that contains GPS coordinates.

Turning a Search String to GPS Coordinates

Now that I had the list of slips with their coordinates, I needed to figure out how to get the GPS coordinates of the location that the user had entered.

Doing Some Math

Now that I had a list of locations with their GPS coordinates and the GPS coordinates of the searched location, I had to figure out which slips were in a certain radius of the searched location.

Finalizing Everything

All I had to do was go through each slip and check whether the geocoded search location was within a given radius and that was it.

--

--

A new tech publication by Start it up (https://medium.com/swlh).

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Felix Seip

Freelance Full Stack Software Engineer based in Frankfurt Germany. Expanding my horizon in any way I can. https://felixseip.de