Hi, 

I believe QGIS can not deal with GeometryCollections which are the resulting 
geometrytype of ST_Split. 

Your idea is not bad, but why do you save the result as wkt? 

I would try: 
SELECT (ST_Dump(ST_Split(circle, line))).geom::geometry (polygon,0) As geom 
INTO layerq 
FROM (SELECT 
ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)) As line, 
ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo; 

If you cast the geometry type like that (::geometry (polygon,0)), PostGIS 
should be able to populate the geometry_columns table automaticly. 

Regards, 
Birgit 


Von: "Shane Carey" <[email protected]> 
An: "arnaud listes" <[email protected]> 
CC: [email protected] 
Gesendet: Donnerstag, 18. Oktober 2018 18:55:44 
Betreff: Re: [postgis-users] Split polygon by line 

Ok thanks, will do in future: 

This is what I have tried and no joy- any ideas? Thanks in advance. 

SELECT ST_AsText((ST_Dump(ST_Split(circle, line))).geom) As wkt 
INTO layerq 
FROM (SELECT 
ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)) As line, 
ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo; 
select populate_geometry_columns(); 

Le gach dea ghui, 
Shane Carey 
GIS and Data Solutions Consultant 


On Thu, Oct 18, 2018 at 3:38 PM Arnaud L. < [ mailto:[email protected] | 
[email protected] ] > wrote: 


Le 18/10/2018 à 18:43, Shane Carey a écrit : 
> Yep, I run the following: 
> 
> SELECT ST_Split(circle, line) 
> INTO qlayer 
> FROM (SELECT 
> ST_MakeLine(ST_MakePoint(10, 10),ST_MakePoint(190, 190)) As line, 
> ST_Buffer(ST_GeomFromText('POINT(100 90)'), 50) As circle) As foo; 
> 
> But this layer does not show up as a gis layer in qgis? 

Probably because the geometry_columns table is not populated. 
Try to either create the destination table first and then to insert in 
it, or maybe just run : 
SELECT Populate_Geometry_Columns(); 

> Thanks in advance for your help. Sorry, what do you mean by top post? 

[ https://en.wikipedia.org/wiki/Posting_style | 
https://en.wikipedia.org/wiki/Posting_style ] 
Bottom or interleaved posting are the preferred style. 

-- 
Arnaud 




_______________________________________________ 
postgis-users mailing list 
[email protected] 
https://lists.osgeo.org/mailman/listinfo/postgis-users 
_______________________________________________
postgis-users mailing list
[email protected]
https://lists.osgeo.org/mailman/listinfo/postgis-users

Reply via email to