[postgis-tickets] [PostGIS] #3723: st_geohash not correct for some multipoint

PostGIS trac at osgeo.org
Sun Aug 27 08:39:55 PDT 2017


#3723: st_geohash not correct for some multipoint
----------------------+---------------------------
  Reporter:  hzhang   |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  high     |  Milestone:  PostGIS 2.4.0
 Component:  postgis  |    Version:  2.2.x
Resolution:           |   Keywords:  st_geohash
----------------------+---------------------------

Comment (by robe):

 I think the issue here has to do with how ST_GeoHash computes it's default
 precision. In the examples you demonstrated, it decided the best precision
 is 0  which always returns nothing.


  So for example:


 {{{
 SELECT ST_GeoHash(ST_GeomFromText('LINESTRING (1 1, 40 40)') ,2 );
 }}}

 yields:


 {{{
 s7
 }}}

 Which is probably closer to what you are expecting but then that is wrong
 too since it doesn't cover the linestring so it needs a lower precision
 than that.  1, would give you the right answer.

 Same case here:


 {{{
 SELECT st_geohash(st_geomfromtext('multipoint(166.2 60.2, 175.6
 67.5)'),1);
 }}}

 yields:

 z

 I wonder if it would be safe to change the precision to 1 in cases where
 it decides precision should be 0.

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3723#comment:3>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list