What Is A Geohash And How Is It Used?

What Is A Geohash And How Is It Used?

What Is A Geohash?

Geohashing is a geocoding system created in 2008 that encodes geographic coordinates (latitude and longitude) into a short and compact string of characters made up of letters and numbers. The resulting compact string of characters is a Geohash.

Think of it like a secret code for locations on Earth – a short and easy-to-understand code. It turns a place’s latitude and longitude, which are like its coordinates on a big map, into a simple code.

For example, the coordinates “latitude 40.7128 degrees North and longitude 74.0060 degrees West” is the same as geohash “6gkzwgjz.” – this shorter code pinpoints the same location but is much easier to share or remember.

In a nutshell, a geohash is a clever way to turn complex latitude and longitude coordinates into simple codes that make it easier to talk about places and share location information.

This is also what makes geohash a versatile tool, making it easier to work with location-based data and services in a wide range of industries and applications.

Breaking Down Geohash – How the World is Encoded into Precise Rectangles

The main concept behind Geohash is to divide the world into a grid of rectangles and then represent each of these rectangles with a unique code. This code becomes shorter as you zoom out to cover larger areas and gets longer as you zoom in for more precision.

Here’s a technical explanation of how Geohash works:

  1. Dividing the world into rectangles
    Geohash starts by dividing the Earth into a grid of rectangles. The whole Earth is initially represented by one big rectangle.
  2. Choosing a binary representation
    Each rectangle is further divided into smaller rectangles. Geohash uses a binary search approach to determine which half of a rectangle contains a given point.
    It assigns a binary digit of 1 for the upper half of the rectangle and 0 for the lower half.
  3. Building the geohash string
    Starting with the whole Earth as one big rectangle, geohash determines whether a point falls into the top or bottom half (binary digit 1 or 0) and appends that digit to the geohash string.The Earth is then divided into the top or bottom half based on the chosen digit.
    This process is repeated iteratively until you have the desired level of precision or length in the geohash string.
  4. Precision and length of the geohash
    The length of the geohash string determines the level of precision: A shorter geohash represents a larger area, while a longer geohash represents a smaller and more precise area:
    – A Geohash of length 1 represents a large area, such as a continent.

    – A Geohash of length 2 represents a smaller area, such as a country.
    – A Geohash of length 3 represents a region or large city.
    – A Geohash of length 4 represents a smaller city or town.
    – Geohashes of length 5 or higher represent progressively smaller areas, down to street level and even specific locations.

  5. Encoding characters
    To enable the geohash string to be more easily read by humans and generally be more user-friendly, it translates the binary digits into a set of characters. Geohash typically uses a character set of 32 characters: 0-9 and the letters a through z (excluding i, l, o).
  6. Final geohash
    The result is a geohash string that represents a specific geographic location. This string is both compact and can be easily shared or stored.

What Does Geohash Look Like?

Geohash divides the world into a grid of rectangles, as indicated in this portion of the world map.

Geohash

Use Cases of Geohash

Geohash is widely used for its simplicity and efficiency in spatial indexing, making it useful for a wide range of practical applications across industries.

  • Location-based searches
    Geohash is used in location-based search engines and applications, showing nearby points of interest, businesses, or places based on their current location or a specified area.
  • Geofencing
  • Geohash is employed to create geofences, or virtual boundaries, which can be used for triggering actions or alerts when a device or user enters or exits a specific geographic area, such as location-based marketing, asset tracking, security applications, social networking and even dating apps.
  • Mapping and cartography
    Geohash is used in cartography to represent geographic data efficiently. It can simplify the storage and retrieval of spatial information in mapping systems.
  • Digital adventures
    Users can connect with people and discover new destinations worldwide via apps which leverage geohashes to enhance travel journaling and social interactions, making global adventures more interactive and engaging.

These are just a few examples, and the applications of geohash continue to expand as location-based data becomes increasingly important across various domains.

The simplified representation of geographic coordinates makes geohash more accessible and user-friendly, which is why it is such a versatile geocoding system with a wide range of uses.

How Does Geohash Compare With Other Spatial Encoding Systems?

A geohash is one of many spatial encoding systems designed to represent geographic locations compactly and efficiently. Geohash can be substituted with alternative systems depending on the specific requirements of the application.

Each spatial encoding system is tailored to address particular needs, offering unique features and trade-offs that make some systems more suitable for specific use cases. For example, geohashes excel in simplicity and spatial indexing, while systems like H3 or Plus Codes may provide advantages in precision, scalability, or user-friendliness.

Read our blog which compares Geohash with H3>

Originally published: 26 September, 2023

Last updated: 26 November, 2024

Read more from The Proptech Cloud

Alternative Data: What Is It, Who Uses It And Why It Matters

Discover the powerful intel alternative data can offer. Learn why businesses and investors are turning to non-traditional data sources for deeper insights and smarter decisions.

What Is A Geohash And How Is It Used?

Discover what a geohash is, how it works, and its real-world applications in mapping, logistics and data analysis.

What Is A Cadastre?

Learn how cadastres capture property boundaries, ownership details, and values, and see how technology is transforming them with 3D models, GIS and digital platforms.

Top Property and Proptech Events in Australia 2025

These industry events provide valuable opportunities to learn from industry leaders, explore emerging technologies, and network with peers who are shaping the future of the sector.

The Shifting Landscape of Property Ownership in Australia

Uncover the ways in which fintech and proptech are revolutionising property ownership in Australia, making it more accessible and dynamic than ever before.

Geohash vs H3: Which Geospatial Indexing System Should I Use?

Geohash vs H3: Which Geospatial Indexing System Should I Use?

For years, the go-to geospatial indexing system has been Geohash. However, a relative new contender has emerged, challenging the status quo – H3. So should you use Geohash or H3?

Here, we’ll explore the differences between Geohash and H3, to help you decide which geospatial indexing system best suits your needs.

Geohash: A Familiar Friend

Geohash is a widely-used geocoding system that encodes geographic coordinates into a short string of letters and numbers. It divides the world into a grid of rectangles, each with a unique Geohash code. The longer the Geohash string, the more precise the location it represents.

H3: The Challenger

H3, on the other hand, is a relatively newer geospatial indexing system that’s gaining traction for its unique approach. Developed by ride-sharing company Uber, H3 uses a hexagonal grid to represent the Earth’s surface. Each hexagon is assigned a unique H3 index, offering a different perspective on geospatial indexing compared to Geohash.

Comparing Geohash and H3

We delve into the main differences between Geohash and H3 on a number of measures.

Precision

  • Geohash: Precision varies based on the length of the code. Longer codes are more precise, but this increases storage and complexity.
  • H3: H3 offers consistent precision regardless of location. Hexagons can be further subdivided for more precision, ensuring uniformity.

Spatial Relationships

  • Geohash: Geohash’s rectangular grid can struggle to represent spatial relationships accurately, especially near the poles (it should be noted that realistically, this is not going to be an issue in most use cases).
  • H3: H3’s hexagonal grid provides better spatial relationships, making it ideal for applications like ride-sharing services and navigation.

Support and Ease of Use

  • Geohash: Geohash is simple and widely adopted, making it easier to find resources and libraries for various programming languages.
  • H3: While H3 is gaining popularity, it may not have the same level of community support and resources as Geohash.

Applications

  • Geohash: Geohash is well-suited for applications that require basic geospatial indexing, such as location-based search or geofencing.
  • H3: H3 shines in complex applications like urban planning, logistics, and ride-sharing due to its consistent precision and better spatial relationships.

Scalability

  • Geohash: As Geohash codes get longer for more precision, storage and indexing can become inefficient.
  • H3: H3 scales more efficiently because it maintains uniform precision, regardless of location.
Geohash vs H3 Comparison

Source: H3

Geohash or H3: Choosing the right system

When it comes down to the choice between Geohash and H3, it really depends on your specific needs:

  • If you require a straightforward geospatial indexing system for basic applications, Geohash is a reliable choice with extensive community support.
  • On the other hand, if you’re dealing with complex spatial relationships, require consistent precision, or are working on innovative projects like urban planning or ride-sharing services, H3 offers a more promising solution. In the real estate context, it can be useful in urban planning, geofencing, spatial analysis, property market analysis.

Geospatial indexing is a fundamental technique used to manage and organise geographic or location-based data efficiently, in order to make data-based decisions or enhance applications.

Geohash is the old guard, tried and tested, while H3 is the newcomer with fresh ideas and uniform precision.

As we can see, both Geohash and H3 have their merits. However, the ultimate decision of which system to use should be based on the requirements of your project.

Snowflake releases H3 functionality

Snowflake provides SQL functions that enable you to use H3 with GEOGRAPHY objects.
This preview feature is now available to all accounts.

Read more from The Proptech Cloud

Alternative Data: What Is It, Who Uses It And Why It Matters

Discover the powerful intel alternative data can offer. Learn why businesses and investors are turning to non-traditional data sources for deeper insights and smarter decisions.

What Is A Geohash And How Is It Used?

Discover what a geohash is, how it works, and its real-world applications in mapping, logistics and data analysis.

What Is A Cadastre?

Learn how cadastres capture property boundaries, ownership details, and values, and see how technology is transforming them with 3D models, GIS and digital platforms.

Top Property and Proptech Events in Australia 2025

These industry events provide valuable opportunities to learn from industry leaders, explore emerging technologies, and network with peers who are shaping the future of the sector.

The Shifting Landscape of Property Ownership in Australia

Uncover the ways in which fintech and proptech are revolutionising property ownership in Australia, making it more accessible and dynamic than ever before.

Geohashes and Efficient Geospatial Joins in Snowflake

Geohashes and Efficient Geospatial Joins in Snowflake

Geohashes are an incredibly useful tool when it comes to spatial analysis. They serve as an encoding system that translates geographic coordinates into a short string of letters and digits, which simplifies and optimises geospatial operations.

One area where geohashes shine is in making geospatial joins more efficient. In this blog, we’ll dive into what geohashes are, and how you can leverage Snowflake’s ST_GEOHASH function to improve your geospatial joins in Snowflake.

What is a geohash?

A geohash is a hierarchical spatial data structure that subdivides space into a grid of cells, each cell having a unique string identifier. Geohashes convert a two-dimensional geographic coordinate (latitude and longitude) into this alphanumeric string. The length of the string determines the precision of the geohash; a longer string means a more precise location.

Read our blog on What is a Geohash for a detailed overview.

Geohash

How geohashes make geospatial joins more efficient

Geospatial joins can be computationally expensive because they often require pairing each record in one dataset with every record in another to calculate distances or find overlaps. This can lead to a computational complexity of O(N*M), which is not ideal for large datasets.

Geohashes simplify this problem by converting the geospatial coordinates into strings. When you want to join based on geographic proximity, you can simply perform a string comparison, which is far less computationally expensive than a full spatial join.

Snowflake and ST_GEOHASH

Snowflake offers native support for geospatial functions, including ST_GEOHASH. Below is a simple example of how you can use this function to create a geohash in Snowflake:

-- Create a geohash for a specific latitude and longitude
SELECT ST_GEOHASH(37.7749, -122.4194, 12) AS geohash;
In this example, 37.7749 is the latitude, -122.4194 is the longitude, and 12 is the precision of the geohash.

To perform a geospatial join using geohashes, you can do the following:

-- Create two tables with geospatial data
CREATE TABLE locations1 (id INT, latitude FLOAT, longitude FLOAT);
CREATE TABLE locations2 (id INT, latitude FLOAT, longitude FLOAT);

-- Populate tables (this is just a representation)
-- ...

-- Add a geohash column to both tables
ALTER TABLE locations1 ADD COLUMN geohash STRING;
ALTER TABLE locations2 ADD COLUMN geohash STRING;

-- Update the geohash columns using ST_GEOHASH
UPDATE locations1 SET geohash = ST_GEOHASH(latitude, longitude, 12);
UPDATE locations2 SET geohash = ST_GEOHASH(latitude, longitude, 12);

-- Perform the join using the geohash
SELECT a.*, b.*
FROM locations1 a, locations2 b
WHERE a.geohash = b.geohash;

 

Geohash – Streamlining geospatial joins

Geohashes offer a streamlined way to perform geospatial joins, drastically reducing the computational resources required. With native functions like ST_GEOHASH in Snowflake, it’s easier than ever to incorporate geohashes into your geospatial workflows. By leveraging the power of geohashes, you can perform complex geospatial analyses more efficiently, saving both time and money.

Read more from The Proptech Cloud

Alternative Data: What Is It, Who Uses It And Why It Matters

Discover the powerful intel alternative data can offer. Learn why businesses and investors are turning to non-traditional data sources for deeper insights and smarter decisions.

What Is A Geohash And How Is It Used?

Discover what a geohash is, how it works, and its real-world applications in mapping, logistics and data analysis.

What Is A Cadastre?

Learn how cadastres capture property boundaries, ownership details, and values, and see how technology is transforming them with 3D models, GIS and digital platforms.

Top Property and Proptech Events in Australia 2025

These industry events provide valuable opportunities to learn from industry leaders, explore emerging technologies, and network with peers who are shaping the future of the sector.

The Shifting Landscape of Property Ownership in Australia

Uncover the ways in which fintech and proptech are revolutionising property ownership in Australia, making it more accessible and dynamic than ever before.