<div dir="ltr">Thank you for the reply.  I’ve prepared two examples to illustrate the behavior I’m observing:<br><br>CREATE TABLE example1 AS SELECT * FROM (VALUES<br>  (1, 'POLYGON ((10 10, 30 10, 30 30, 10 30, 10 10))'::geometry),<br>  (2, 'POLYGON ((0 10, 10 10, 9.5 20, 10 30, 0 30, 0 10))'::geometry),<br>  (3, 'POLYGON ((10 10, 9.5 20, 10 30, 10 10))'::geometry)<br>) AS v(id, geom);<br><br>CREATE TABLE  example1_c AS<br>  SELECT id,  ST_CoverageClean(geom,0.0,1) OVER () AS GEOM<br>  FROM  example1;<br><br>In this example, polygon 3 is removed, even though it is not a gap or an overlap. Could this be due to the use of the maximum inscribed circle method, which might classify this polygon as a gap?<br><br>Here’s another example:<br><br>CREATE TABLE  example2  AS SELECT * FROM (VALUES<br>  (1, 'POLYGON ((10 10, 30 10, 30 30, 10 30, 10 10))'::geometry),<br>  (2, 'POLYGON ((0 10, 10 10, 9.5 20, 9.5 20.5, 10 30, 0 30, 0 10))'::geometry),<br>  (3, 'POLYGON ((10 10, 9.5 20,  9.5 20.5, 10 30, 10 10))'::geometry)<br>) AS v(id, geom);<br><br>CREATE TABLE  example2_c AS<br>  SELECT id,  ST_CoverageClean(geom,0.0,1) OVER () AS GEOM<br>  FROM  example2;<br><br>In this case, polygon 3 is also removed. Additionally, the vertex at (9.5, 20.5) appears to have been snapped to (9.5, 20), even though I set the snappingDistance to 0.0, expecting no snapping to occur.<br><br>I don’t think these results are necessarily incorrect—polygon 3 is arguably a sliver in both examples—but I’d like to better understand how the snappingDistance and gapMaximumWidth parameters work together, especially before applying this function in production workflows.<br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, Sep 23, 2025 at 6:21 PM Paul Ramsey <<a href="mailto:pramsey@cleverelephant.ca">pramsey@cleverelephant.ca</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">If you want to pose your question closer to the actual code that implements it, asking in the GEOS list might be good. In general, as Greg notes, a simple example geometry demonstrating your misgivings, if such a thing exists, is a great way to seed a discussion. Particularly for something as “personal” as coverage cleaning, there is a lot of opinion involved in what is “correct” for any given input.<br>
<br>
ATB,<br>
P<br>
<br>
> On Sep 23, 2025, at 5:24 AM, Douglas Fan <<a href="mailto:douglas.mhfan@gmail.com" target="_blank">douglas.mhfan@gmail.com</a>> wrote:<br>
> <br>
> Dear PostGIS Developers and Users,<br>
> <br>
> First of all, thank you for the development of the new ST_CoverageClean function in PostGIS 3.6.0. It’s a fantastic addition that has already helped a lot in my work with polygonal coverages. I really appreciate the effort that went into making this tool available.<br>
> While testing the function, I’ve encountered some behaviors that I’d like to better understand, particularly regarding the snappingDistance and gapMaximumWidth parameters.<br>
> <br>
> From the documentation, I understand that:<br>
> 1. snappingDistance controls vertex snapping, with -1 applying an automatic distance, and 0.0 disabling snapping.<br>
> 2. gapMaximumWidth closes gaps smaller than the specified tolerance.<br>
> <br>
> However, during testing with various combinations (e.g., snappingDistance set to -1, 0.0, 1, 2 and gapMaximumWidth set to 0, 1, 2), I noticed:<br>
> 1. Even when snappingDistance is explicitly set to 0.0, small sliver vertices still appear to be snapped or altered when gapMaximumWidth is greater than 0.<br>
> 2. Slivers that are thinner than the gapMaximumWidth are removed, even when they are not actual gaps or overlaps. <br>
> <br>
> This behavior seems counterintuitive, as I expected no snapping to occur with snappingDistance = 0.0. Could this be due to internal gap cleaning logic that also affects vertex positions? Or is there an implicit snapping step tied to gapMaximumWidth?<br>
> <br>
> I’d be grateful for any insights into:<br>
> <br>
> 1. How do these two parameters interact?<br>
> 2. Best practices or recommended workflows for cleaning polygonal coverages with minimal geometry distortion.<br>
> 3. Any known edge cases or limitations when using ST_CoverageClean.<br>
> 4. Whether gapMaximumWidth also triggers geometry simplification or sliver removal beyond gap closing.<br>
> <br>
> Thanks in advance for your help and for the continued development of PostGIS.<br>
> <br>
> Best regards,<br>
> Man Ho Fan<br>
<br>
</blockquote></div></div>