[postgis-tickets] [PostGIS] #4627: ST_HexagonGrid produces overlapping hexagons

PostGIS trac at osgeo.org
Fri Jan 31 09:49:16 PST 2020


#4627: ST_HexagonGrid produces overlapping hexagons
----------------------+---------------------------
  Reporter:  dbaston  |      Owner:  pramsey
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 3.1.0
 Component:  postgis  |    Version:  master
Resolution:           |   Keywords:
----------------------+---------------------------

Comment (by Algunenano):

 An example that could be used as test based on that:

 {{{
 WITH geoms AS
 (
     SELECT * FROM  (SELECT (ST_HexagonGrid(5,
 '01030000000100000005000000fdffffffff7f66c0fcffffffff7f56c0fdffffffff7f66c07cc0e71a95e8544000000000008066407cc0e71a95e854400000000000806640fcffffffff7f56c0fdffffffff7f66c0fcffffffff7f56c0')).*)
 sq  WHERE i = 5 AND j IN (0, 1)
 ),
 j0 AS
 (
     SELECT * FROM geoms WHERE i = 5 AND j = 0
 ),
 j1 AS
 (
     SELECT * FROM geoms WHERE i = 5 AND j = 1
 )
 SELECT
     ST_Intersects(j0.geom, j1.geom),
     ST_AsText(ST_Intersection(j0.geom, j1.geom))
 FROM j0,j1;
 }}}


 The current output is:
 {{{
  st_intersects |
 st_astext
 ---------------+----------------------------------------------------------------------------------------------------------------
  t             | POLYGON((35 8.66025403784439,40 8.66025403784439,40
 8.66025403784439,35 8.66025403784439,35 8.66025403784439))
 }}}

 When transformed into text, the latitude is the same for all points but
 probably due to some rounding the binary value will be different, thus the
 intersection is a polygon and not a point.

 I'm not sure how hard this would be to fix.

-- 
Ticket URL: <https://trac.osgeo.org/postgis/ticket/4627#comment:1>
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