David,
Sorry for the delay. For points ST_GeoHash is an exact location.
For everything else it’s really the hash of the bounding box. Since bound box
covers more area, the length of the hash is shorter.
Here is an example to demonstrate:
SELECT ST_GeoHash(ST_GeomFromText('POINT(-20.234 50.897)', 4326));
Returns g919e9d098kp4n6m82ys
SELECT ST_GeoHash(ST_GeomFromText('LINESTRING(-20.234 50.897, -20.235 50.908)',
4326));
Returns: g919e
Note how the hash of the second is a subset of the first? So that means any
geometry that starts with g919e essentially falls in the bounding box that the
linestring forms.
Also note that the above answer is equivalent to:
SELECT ST_GeoHash(ST_GeomFromText('LINESTRING(-20.234 50.897, -20.235 50.908)',
4326)::box2d);
Hope that clarifies things,
Regina
From: postgis-users [mailto:[email protected]] On Behalf Of
Shaozhong SHI
Sent: Monday, November 14, 2022 3:46 AM
To: PostGIS Users Discussion <[email protected]>
Subject: [postgis-users] Understanding of Geohash of a line feature
Any detailed explanation on Gehash of a line feature?
The following works and returns output.
ST_geoHash(ST_transform(a_line_geometry,4326))
However, what exactly the output means?
Anyone knows what the output means?
Regards,
David
_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users