[postgis-users] Create numerous polygons to divide by lines (split)

teddy guerin teddyguerin at yahoo.fr
Fri May 12 10:13:44 PDT 2017

Hi everybody, 

I apologize for my english.I have create an another post on georezo (french geomatic  :https://georezo.net/forum/viewtopic.php?pid=295258#p295258).I would like create numerous polygons (like divide main polygons by lines). 
In attachment 2 screenshots (theoric results and problems) and datas for tests (2 shapes)
I use this query (I add st_snaptogrid for more precisions) :WITH t AS (
select p.id_triangle, array_agg(l.geom)||st_exteriorring(p.geom) as t
from "CTRL_SONDE_7123"."7123_TRIANGLE_non_intersect_Delau" p, "CTRL_SONDE_7123"."7123_line_intertriangle_Delau_step1_sel" l
WHERE st_intersects(st_snaptogrid(p.geom,0.0000001), st_snaptogrid(l.geom,0.0000001)) group by  p.id_triangle,p.geom),
u AS (SELECT id_triangle, st_dump(st_node(st_collect(t))) d FROM t)

SELECT (st_dump(st_polygonize((d).geom ORDER BY (d).path))).geom FROM u
GROUP BY id_triangle;

Best regardsTed

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20170512/2f536f1e/attachment.html>

More information about the postgis-users mailing list