[postgis-users] breake lines

Alexandre Neto senhor.neto at gmail.com
Tue Oct 27 04:39:47 PDT 2020


Hello Paul,

It seems that, at least, one geometry in the data table is not correctly
defined.

Use this to confirm:

SELECT geom, ST_Geometrytype(geom)
FROM data;

Best regards,

Alexandre Neto
QGIS/PostGIS Support
www.cooperative.net

On Tue, Oct 27, 2020 at 9:40 AM <paul.malm at lfv.se> wrote:

>
>
> Hi I would like to break lines in intersections of polygons, but without
> erasing anything.
>
> I have used this (but now suddenly, it does not work) :
>
>
>
>
>
> Create table tmpint2 as
>
> WITH
>
> data AS (
>
>    SELECT * FROM public."linesToBeCut" AS t(id, geom)
>
> ),
>
> cutter AS (
>
>    SELECT * FROM "cutterPolygons" AS t(geom)
>
> )
>
> SELECT id,
>
>      CASE WHEN cutting IS NULL THEN geom
>
>          ELSE st_collectionExtract(ST_Split( geom, cutting ),2) END AS geom
>
> FROM (SELECT id, d.geom geom,
>
>             (SELECT ST_Collect(c.geom) geom
>
>                 FROM cutter c WHERE ST_Intersects(d.geom, c.geom)
>
>             ) AS cutting
>
>     FROM data d) AS t;
>
>
>
> The error code I get is :
>
> st_intersects(integer, geometry) does not exsits
>
> Can anyone please tell me what I’m doing wrong here. I’m not to bright in
> SQL.
>
> /Paul
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/postgis-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20201027/7c586f9e/attachment.html>


More information about the postgis-users mailing list