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.