<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div>Hi,<br><br>I believe QGIS can not deal with GeometryCollections which are the resulting geometrytype of ST_Split.</div><div><br data-mce-bogus="1"></div><div>Your idea is not bad, but why do you save the result as wkt?<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I would try:<br data-mce-bogus="1"></div><div>SELECT (ST_Dump(ST_Split(circle, line))).geom::geometry (polygon,0) As geom<br>INTO layerq<br>FROM (SELECT<br>    ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)) As line,<br>    ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;</div><div><br data-mce-bogus="1"></div><div>If you cast the geometry type like that (::geometry (polygon,0)), PostGIS should be able to populate the geometry_columns table automaticly.<br></div><div><br data-mce-bogus="1"></div><div>Regards,<br data-mce-bogus="1"></div><div>Birgit<br data-mce-bogus="1"></div><div><br></div><hr id="zwchr" data-marker="__DIVIDER__"><div data-marker="__HEADERS__"><b>Von: </b>"Shane Carey" <careyshan@gmail.com><br><b>An: </b>"arnaud listes" <arnaud.listes@codata.eu><br><b>CC: </b>postgis-users@lists.osgeo.org<br><b>Gesendet: </b>Donnerstag, 18. Oktober 2018 18:55:44<br><b>Betreff: </b>Re: [postgis-users] Split polygon by line<br></div><div><br></div><div data-marker="__QUOTED_TEXT__"><div dir="ltr"><div dir="ltr"><div>Ok thanks, will do in future:</div><br><div>This is what I have tried and no joy- any ideas? Thanks in advance.</div><br><div>SELECT ST_AsText((ST_Dump(ST_Split(circle, line))).geom) As wkt<br>INTO layerq<br>FROM (SELECT<br>    ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)) As line,<br>    ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;<br>select populate_geometry_columns();<br></div><br><div><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Le gach dea ghui,<br></div><div><span style="color:rgb(61,133,198)"><b><span style="background-color:rgb(255,255,255)"><i>Shane Carey</i></span></b></span></div><div><span style="color:rgb(61,133,198)"><b><span style="background-color:rgb(255,255,255)"><i>GIS and Data Solutions Consultant</i></span></b></span><br></div></div></div></div></div></div></div></div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Oct 18, 2018 at 3:38 PM Arnaud L. <<a href="mailto:arnaud.listes@codata.eu" target="_blank">arnaud.listes@codata.eu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Le 18/10/2018 à 18:43, Shane Carey a écrit :<br>
> Yep, I run the following:<br>
> <br>
> SELECT ST_Split(circle, line)<br>
> INTO qlayer<br>
> FROM (SELECT<br>
>      ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)) As line,<br>
>      ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo;<br>
> <br>
> But this layer does not show up as a gis layer in qgis?<br>
<br>
Probably because the geometry_columns table is not populated.<br>
Try to either create the destination table first and then to insert in <br>
it, or maybe just run :<br>
SELECT Populate_Geometry_Columns();<br>
<br>
> Thanks in advance for your help. Sorry, what do you mean by top post? <br>
<br>
<a href="https://en.wikipedia.org/wiki/Posting_style" rel="noreferrer" target="_blank">https://en.wikipedia.org/wiki/Posting_style</a><br>
Bottom or interleaved posting are the preferred style.<br>
<br>
--<br>
Arnaud<br>
</blockquote></div>
<br>_______________________________________________<br>postgis-users mailing list<br>postgis-users@lists.osgeo.org<br>https://lists.osgeo.org/mailman/listinfo/postgis-users<br></div></div></body></html>