QUADRANT DATA OVERVIEW

Product Overview

Data Dictionary

Global Data Counts

About Mobile Location Data

 

RESOURCES

Cross Account Bucket Access

A. AWS S3

 

Getting Started with Quadrant Mobile Location Data

A. Create a Database, Table and Partition

B. How To Run Basic Location Data Queries

i. Scale and Trend

ii. Depth

iii. Accuracy

C. How Geohash Works (Coming Soon)

 

All You Need To Know About Data Evaluation

A. Best Practices

B. SDK vs Bidstream Data

C. Data Evaluation using AWS Athena

 

Location Data Algorithms and Queries

A. Geo-fencing Query

B. Footfall Query

C. Nearest POI Model

D. Location Algorithms

 

SDK INTEGRATIONS

Android Integration

iOS Integration

Integrate with Unity3D for Android

Integrate with Unity3D for iOS

 
ASIA PACIFIC DATA ALLIANCE

About The Alliance

The Data

Use Cases & Data Science Algorithms

Access APAC Data Alliance Data with AWS S3

 
MEDIA LIBRARY
FREQUENTLY ASKED QUESTIONS

 

 

 

 

ALL YOU NEED TO KNOW ABOUT GEOHASH


The guide below will show you how to run a simple Geohash queries and explains why Geohash benefits your business.

All about Geohash

Geohash is one of the convenient ways of expressing a location (anywhere in the world) using alphanumeric string. Geohash is a unique string that is derived by encoding/reducing the geographic coordinates (latitude and longitude) into a short string of digits and letters. Precision is a number between 1 and 12 that specifies the precision (i.e., number of characters) of the Geohash. Each additional character of the Geohash adds precision to your location. Geohashing can be used for various analysis like spatial indexing, spatial binning, proximity searches, location searching, creating unique place identifiers, etc.

When it comes to location data, finding points within a nearby vicinity is a common use case. However, as we enter the big data universe, this problem becomes a bit complex if you have Gigabytes or Terabytes of data to be analysed. With Geohash, these problems could be solved in a smarter way.

 

Example of Geohash representation

 Latitude

 1.320527

Longitude

103.81726

Precision

9

Geohash

w21zd2mkt

 

Encoding the Geohash 

Looking at the image below, we represent Geohash by splitting the world into recursive grids.


World Map with one layer of Geohash

Image: World Map with one layer of Geohash

 

Next, we look at how Geohash works when applying a second layer to split the recursive grids further.

Image: World Map with 2 layers of Geohash

 

The grids above are represented by strings and numbers. The top-most grid is represented by 1 character, and if you choose a second level grid within a grid, it is represented by appending another character and so on. As you 'zoom' into each grid, your grids become smaller and the length of your geohash increase.

Geohash ranges from 1 to 12 characters as shown in the table below:

GeoHash length

Grid Area width x height

1

5,009.4km x 4,992.6km

2

1,252.3km x 624.1km

3

156.5km x 156km

4

39.1km x 19.5km

5

 4.9km x 4.9km

6

 1.2km x 609.4m

7

 152.9m x 152.4m

8

 38.2m x 19m

9

 4.8m x 4.8m

10

 1.2m x 59.5m

11

 14.9cm x 14.9cm

 12

 3.7cm x 1.9cm


Note that the maximum level of geohash precision is 12 and it represents a tile of 3.7 cm * 1.9 cm. So, finding a location can be very efficient with Geohash.

 

Therefore, the benefit of geohash is that a geo-coordinate (latitude and longitude) can be encoded to a Geohash (string) which in turn can provide a lot of operational efficiency benefits more of which are explained below.

 

How do we do a Geohash query?

There are lots of libraries available based on your programming language that can be used to create Geohash.

Programming Language

Library

Relevant Links

Python

For python, you have libraries like Geohash

https://pypi.org/project/Geohash/

Nodejs

For nodejs

https://github.com/sunng87/node-geohash

Java Maven

For Java maven dependency

https://mvnrepository.com/artifact/ch.hsr/geohash/1.3.0

Others
Visual

For a visual example

https://www.movable-type.co.uk/scripts/geohash.html

 

Note, with the APDA data, we have provided the Geohash as well.

 

Use Case: How you can execute a Geohash query

Objective: To find people in Singapore Botanical Gardens

Methodology: The Singapore Botanical Gardens could be encapsulated within the geohashes w21zd2, w21z6r, w21z6q, w21z6m. It includes some regions out of the botanical gardens but let’s assume you will use a point in polygon algorithm to remove the points outside botanical garden.

Image: Singapore Botanical Gardens with Geohash

 

The following steps are done to retrieve points in Singapore Botanical Gardens:

 

Step 1: Using the query below, you will first filter out the points within the 4 Geohashes mentioned above (w21zd2, w21z6r, w21z6q, w21z6m)

SELECT * from input_data where country = 'SG' and substr(geohash,1,6) IN ('w21zd2', 'w21z6r', 'w21z6q', 'w21z6m')

 

After running the above query, you now have the data points from the 4 Geohashes,

Geohash without FilteringImage: Singapore Botanical Gardens with Data Points from 4 Geohashes

 

Step 2: Having created a smaller dataset based on the 4 Geohashes, you can refine further by taking these data points and inputting them into your algorithm (e.g. circle or polygon query) to get the points specifically within the Singapore Botanical Gardens.

Geohash with filteringImage: Data Points seen within Singapore Botanical Gardens after refining

 

Geohash vs Non-Geohash Query

Below we will show how Geohash benefits you operationally.:

 

Executing a query with Geohash

Slide1-2

 

Executing a query without Geohash

Slide2-1

 

As shown above, using Geohash queries lead to the following operational efficiencies:

1) Lower processing costs due to smaller file sizes

2) Faster processing times of data

3) Lower storage costs of data

 

How Geohash queries help your business

Geohash provides a multitude of efficiencies from different perspectives:

  • Increased operational efficiencies with faster querying time – Querying for regions or sub-regions can be really fast.
  • Less input data load – To input data in your algorithm, you only take the necessary data. E.g. if you want to understand behaviours of people in Kuala Lumpur, you do not need to key in the whole of Malaysia but only the points within Kuala Lumpur, which can be found more quickly by using the Geohash.
  • Cost effective – If you run queries on cloud services like AWS or GCP, you will be charged based on the data scanned. As Geohash will scan less data, the charges incurred will be less provided data is partitioned in the appropriate manner.

 

Note: All data provided by Quadrant to our clients is based on Geohash, and Geohash is a standard attributes provided within our data feeds. 

We hope that the above technical education piece helps you with your Geohash queries, if you need further information, contact us at support@quadrant.io