[postgis-users] Geohash of line features

Shaozhong SHI shishaozhong at gmail.com
Mon Nov 14 00:15:07 PST 2022


Which geohash grid a line feature fall into can be determined by working
out the following:

hash_start=left(ST_geoHash(ST_transform(ST_StartPoint(geom),4326)),5),
hash_end=left(ST_geoHash(ST_transform(ST_EndPoint(geom),4326)),5)

and working out which hash = a geohash grid found where hash = hash_start
or hash = hash_end

The following also produces a result but needs to understand explicitly.

hash = left(ST_geoHash(ST_transform(wkb_geometry,4326)),5)

Any explicit explanation on GeoHash of a whole line?

Regards,

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20221114/735e5f07/attachment.htm>


More information about the postgis-users mailing list