<div dir="ltr">Hi,<div><br></div><div>I am running a Overlay analysis, and I am following what is proposed by Paul Ramsey in this article:</div><div><br></div><div><a href="http://blog.cleverelephant.ca/2019/07/postgis-overlays.html">http://blog.cleverelephant.ca/2019/07/postgis-overlays.html</a><br></div><div><br></div><div>I am using this query on PostgreSQL 10 and PostGIS </div><div><br></div><div>With isolated_polygons as <br>(<br>select st_exteriorring((st_dumprings((st_dump(geom)).geom)).geom) as geom<br>from OUTPUTS_FINAIS.estabelecimentos_as_400<br>)<br>, boundaries as (<br>SELECT st_union(geom) AS geom<br>FROM isolated_polygons<br>)<br>, poligonos as (<br>SELECT (st_dump(st_polygonize(geom))).geom as geom<br>FROM boundaries<br>)<br>, n_poligonos as (<br>SELECT row_number() over() as id, geom<br>FROM poligonos<br>)<br>SELECT <a href="http://p.id">p.id</a>, count(id) as n_sobreposicoes, p.geom::geometry(polygon,4326)<br>into temp.sobreposicoes_400m<br>FROM n_poligonos as p <br>    join outputs_finais.estabelecimentos_as_400 as t <br>     on st_contains(t.geom,st_pointonsurface(p.geom))<br>GROUP BY id, p.geom;<br></div><div><br></div><div>When I use this with a sample set of input multipolygons, The results are what we would expect, all the overlapping polygons split and the count of the number of overlapping polygons.</div><div><br></div><div>When I run it with the full set (around 4800 polygons)</div><div><br></div><div>The precison of the output polygons gets truncated and instead of detailed polygons I get a "pixelied" output:</div><div><br></div><div>POLYGON ((-8.99 39.42, -8.99 39.43, -8.98 39.43, -8.97 39.43, -8.97 39.42, -8.98 39.42, -8.99 39.42))<br>POLYGON ((-8.19 39.56, -8.2 39.56, -8.2 39.57, -8.19 39.57, -8.18 39.57, -8.19 39.56))<br>POLYGON ((-8.54 41.02, -8.55 41.02, -8.55 41.03, -8.54 41.03, -8.54 41.02))<br>POLYGON ((-8.39 40.17, -8.4 40.17, -8.4 40.18, -8.39 40.18, -8.39 40.17))<br>POLYGON ((-8.57 38.83, -8.58 38.83, -8.59 38.84, -8.58 38.84, -8.57 38.84, -8.57 38.83))<br></div><div><br></div><div>My gut feeling is that this is happening at the polygonize level, but I am not sure.</div><div><br></div><div>I have also tried to use st_node + st_collect getting the same kind of results</div><div><br></div><div>Any idea of what can this be?</div><div><br></div><div>Since not all polygons are overlapping each other, I wanted to try to separate the analysis by chunks, but I fail to see how can I union or collect only not disjoint line groups.</div><div><br></div><div>I am using</div><div><br></div><div>PostgreSQL 10.12 (Ubuntu 10.12-0ubuntu0.18.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0, 64-bit<br></div><div><br></div><div>POSTGIS="2.5.3 r17699" [EXTENSION] PGSQL="100" GEOS="3.7.1-CAPI-1.11.1 27a5e771" PROJ="Rel. 4.9.3, 15 August 2016" GDAL="GDAL 2.2.3, released 2017/11/20" LIBXML="2.9.4" LIBJSON="0.12.1" LIBPROTOBUF="1.2.1" RASTER<br></div><div><br></div><div>Thanks,</div><div><br></div><div>Alexandre Neto</div><div><br></div><div><br></div></div>