<div dir="ltr">It looks like just adjusting some gt/lt tests into gte/lte effects your rount-trip test... it breaks one regression test, for ticket <a href="https://trac.osgeo.org/postgis/ticket/4399">https://trac.osgeo.org/postgis/ticket/4399</a> but that's it, and the test isn't really pushing on geohash behaviour. I would need to add some tests and confirm the behaviour is consistent in other ways.<div><br></div><div>P.</div></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Wed, Jan 28, 2026 at 9:26 AM Sztegi <<a href="mailto:sztegi@gmail.com">sztegi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Hi!<br>
<br>
I have bumped into something I find counter intuitive with<br>
St_GeoHash() - boundary checking for non-point objects seems stricter<br>
than for points in case precision is not set:<br>
<br>
select st_geohash(ST_MakeLine(st_point(0, 0), st_point(0.00002, 0.00002)));<br>
-- returns "" <- this is unexpected, I expected "s00000000"<br>
<br>
This breaks my assumption that st_geoshash(st_geomfromgeohash(hash))<br>
will return the original geohash:<br>
select st_geohash(st_geomfromgeohash('s0'));<br>
-- returns "" <- I expected "s0"<br>
<br>
I bumped to this in Postgis 3.2.1 and it is still reproducible in 3.6.1<br>
<br>
Meanwhile if precision is set OR the geometry is a point OR it doesn't<br>
touch geohash boundaries then I get what I expect:<br>
<br>
select st_geohash(st_point(0, 0), 8));<br>
-- returns "s0000000"<br>
<br>
select st_geohash(st_point(0, 0));<br>
--- returns "s0000000000000000000"<br>
<br>
select st_geohash(ST_MakeLine(st_point(0, 0), st_point(0.00002, 0.00002)), 8);<br>
-- returns "s0000000"<br>
<br>
select st_geohash(ST_MakeLine(st_point(0.00001, 0.00001),<br>
st_point(0.00002, 0.00002)), 8);<br>
-- returns "s0000000"<br>
<br>
select st_geohash(ST_MakeLine(st_point(0.00001, 0.00001),<br>
st_point(0.00002, 0.00002)));<br>
-- returns "s00000000"<br>
<br>
I plan to create a bug report about this, but wanted to check first on<br>
the mailing list if this is something intended.<br>
<br>
These edge cases are interesting to me because I am trying to create<br>
an implementation of st_geohash()/st_geomfromgeohash() for two Apache<br>
projects (Hive, Impala), and cross- checked my tests with the results<br>
in postgis.<br>
<br>
regards,<br>
Csaba<br>
</blockquote></div>