<div dir="ltr">Hi,<div><br></div><div>Please post your points to <a href="https://trac.osgeo.org/geos/">https://trac.osgeo.org/geos/</a> as a bug report.</div><div><br></div><div>In my experience two things help with Voronoi issues:</div><div> - ST_SnapToGrid;</div><div> - falling back to non-geos voronoi implementation, <a href="https://github.com/wgnet/globalmap/blob/master/code/postgis_wrappers/ST_VoronoiPolygons.sql">https://github.com/wgnet/globalmap/blob/master/code/postgis_wrappers/ST_VoronoiPolygons.sql</a>, sometimes heals issues (by the price of super slow processing).</div></div><br><div class="gmail_quote"><div dir="ltr">сб, 24 февр. 2018 г. в 13:20, J.J. Green <<a href="mailto:j.j.green@gmx.co.uk">j.j.green@gmx.co.uk</a>>:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I have some point data in latlong which I project onto<br>
some SRID, then perform the following query:<br>
<br>
CREATE TEMPORARY TABLE cell_poly_tmp ON COMMIT DROP AS<br>
SELECT<br>
Geometry(<br>
(<br>
ST_Dump(<br>
ST_CollectionExtract(<br>
ST_VoronoiPolygons(<br>
ST_Collect(point),<br>
0.0<br>
),<br>
3<br>
)<br>
)<br>
).geom<br>
) AS poly<br>
FROM cell_point_tmp;<br>
<br>
For most SRIDs this works OK, but for 3857, I get<br>
<br>
56966976: ERROR: GEOSVoronoiDiagram: TopologyException:<br>
Input geom 1 is invalid: Self-intersection at or near point<br>
444332.38647522771 8548816.0569835864 at<br>
444332.38647522771 8548816.0569835864<br>
<br>
Now this is a bit of a pain, since 3857 is SRID I want to use --<br>
the target is an OpenLayers application and their 3857 tiles.<br>
<br>
I observe that the (projected) points in this case are on a<br>
uniform grid (clearly the source used a uniform grid in 3875<br>
and transformed to latlong), and that the failed point is at<br>
the dead-centre of one of the grid-cells at the edge of the<br>
domain.<br>
<br>
A plot of the geometry and the input data point are at<br>
<br>
<a href="https://gist.github.com/jjgreen/b0846716cfe076ae194217d1585783bb" rel="noreferrer" target="_blank">https://gist.github.com/jjgreen/b0846716cfe076ae194217d1585783bb</a><br>
<br>
I've tried sliding ST_MakeValid() in various places in the query,<br>
but without success.<br>
<br>
Any thoughts as to how to proceed?<br>
<br>
My setup is Ubuntu Xenial with PostGIS from <a href="http://apt-postgresql.org" rel="noreferrer" target="_blank">apt-postgresql.org</a>,<br>
and<br>
<br>
POSTGIS="2.3.3 r15473"<br>
GEOS="3.5.0-CAPI-1.9.0 r4084"<br>
PROJ="Rel. 4.9.2, 08 September 2015"<br>
GDAL="GDAL 1.11.3, released 2015/09/16"<br>
LIBXML="2.9.3"<br>
LIBJSON="0.11.99" RASTER<br>
<br>
Cheers<br>
<br>
Jim<br>
--<br>
J.J. Green<br>
<a href="http://soliton.vm.bytemark.co.uk/pub/jjg/en/" rel="noreferrer" target="_blank">http://soliton.vm.bytemark.co.uk/pub/jjg/en/</a><br>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a></blockquote></div>