Adding a Geohash Index to a Snowflake Table - spectrum_spatial - Latest

Spectrum Spatial Guide

Product type
Software
Portfolio
Locate
Product family
Spectrumâ„¢ software
Product
Spectrumâ„¢ software > Spatial > Spectrum Spatial
Version
Latest
ft:locale
en-US
Product name
Spectrum Technology Platform
ft:title
Spectrum Spatial Guide
Copyright
2025
First publish date
2007
ft:lastEdition
2025-03-07
ft:lastPublication
2025-03-07T10:28:48.112000
Changes in this topic Description
Introduced in version 24.1 Snowflake Datasource
To enable clustering (aggregated tables) and facilitate large data visualization, generate the geohash index from the geometry (or the XY).

Below is a sample query for creating and updating geohash ID in a Snowflake table.

Add a geohash column to table public.geohash_table,

ALTER table public.geohash_table ADD geohash varchar(20);

Update geohash from Geometry or Geography column,

UPDATE public.geohash_table SET geohash = ST_GEOHASH(geog, 12);

Or update geohash from X/Y column,

UPDATE public.geohash_table SET 
geohash = ST_GEOHASH(TO_GEOMETRY('POINT (' || X || ' ' || Y || ')', 4326), 12);
Note: When using an X/Y table, ensure that both the X and Y columns are indexed.