[postgis-tickets] [PostGIS] #3447: PG::InternalError: ERROR: Error computing Voronoi diagram.

PostGIS trac at osgeo.org
Tue Feb 9 17:46:09 PST 2016


#3447: PG::InternalError: ERROR:  Error computing Voronoi diagram.
----------------------+---------------------------
  Reporter:  loarie   |      Owner:  dbaston
      Type:  defect   |     Status:  new
  Priority:  medium   |  Milestone:  PostGIS 2.3.0
 Component:  postgis  |    Version:  trunk
Resolution:           |   Keywords:  ST_Voronoi
----------------------+---------------------------

Comment (by dbaston):

 I take that back - JTS produced a result for this case only because of the
 rounding that occurred when I transferred the geometry using WKT.  In
 fact, the problem can be produced in both PostGIS and JTS with a smaller
 example of only 7 points:

 {{{
 SELECT
 ST_Voronoi('01040000000700000001010000000f8b33e3d97742c038c453588d0423c001010000001171d6d1b45d42c06adc1693e78c22c001010000001c8b33e3d97742c062c453588d0423c00101000000afa5c71fda7742c04b93c61d8e0423c00101000000b0cddcb4b57942c026476887d7b122c00101000000e0678421dc7642c0f7736021e1fb22c00101000000e32fd565018d42c0c7ea1222167c22c0',
 tolerance := 0.02);
 }}}

 This should be probably reported upstream to JTS; I don't think there's
 much that can be done at the PostGIS level.

 For your particular case, it seems like the problem can be solved by
 running ST_SnapToGrid on your inputs before sending them to ST_Voronoi.  I
 was able to get a diagram on your inputs with a tolerance of 0.0 if I ran
 ST_SnapToGrid(geom, 1e-18) beforehand:

 {{{
 SELECT name, ST_AsText(ST_Voronoi(ST_SnapToGrid(geom, 1e-18))) as geom
 FROM voronoi_test_pt WHERE name = 'all';
 }}}

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