Geohashing - System Design
1:22

Geohashing - System Design

Greg Hogg 23.05.2026 19 719 просмотров 960 лайков

Machine-readable: Markdown · JSON API · Site index

Поделиться Telegram VK Бот
Транскрипт Скачать .md
Анализ с AI
Описание видео
Geohashing is a hierarchical spatial data structure that encodes a geographic location into a short string of letters and digits. It works by dividing the entire surface of the Earth into a grid of interlocking bounding boxes. The first character of a geohash determines which of the primary global regions the coordinate falls into. Each additional character added to the string divides that specific box into a smaller more precise grid. A longer geohash string means a smaller box and a much more precise geographic location. For example a geohash with an exact length of twelve characters is accurate down to a few centimeters. This system converts two-dimensional latitude and longitude coordinates into a single one-dimensional string. Because it is a single string databases can index and search geohashed locations incredibly fast. Nearby locations often share the exact same prefix string which makes searching for local points of interest very efficient. However it can suffer from edge cases where two points are close physically but sit on different sides of a major grid boundary. Despite this limitation geohashing is a foundational technique used by location-based apps to find nearby drivers or restaurants.

Оглавление (1 сегментов)

Segment 1 (00:00 - 01:00)

If you don't know this, you suck at system design. Take the whole Earth and divide it into four quadrants. Mark the bottom and left as zeros and the top and right as ones. We first ask if it's left or right. Since it's left, we mark it as a zero. Then we ask if it's down or up, and since it's up, we mark it as a one. You would then take the quadrant that you've got and divide it up again. You could do this infinitely. Typically, when you hash, you have a binary sequence under the hood, and then you're going to read that in terms of hex. And that's pretty much done here. Hex is base 16 with the numbers 0 through 9 and then A through F. For whatever reason, geohashing uses base 32. So, what's cool about geohashing is that your precision is going to determine your specificity. Meaning, if you go to an extreme precision, you're actually going to get a very precise location on the Earth. For example, a one-character geohash is about 5,000 square kilometers, a very general place. If you get seven characters, you're at about the block level. By 12 characters, you're at almost their exact location. This is very useful for system design because nearby geohashes means that things are close. If you were in this geohash, anyone around you would make a good friend. Then, you would just need to determine your precision. Do you want general areas or do you want more specific? I teach this stuff every day and growing really fast, so follow along to learn more.

Другие видео автора — Greg Hogg

Ctrl+V

Экстракт Знаний в Telegram

Экстракты и дистилляты из лучших YouTube-каналов — сразу после публикации.

Подписаться

Дайджест Экстрактов

Лучшие методички за неделю — каждый понедельник