[postgis-users] breake lines

paul.malm at lfv.se paul.malm at lfv.se
Tue Oct 27 23:53:47 PDT 2020


Hi, I’ve checked:
all geometries are of type ST_MultiLineString

Kind regards,
Paul

Från: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] För Malm, Paul (Operations AIM)
Skickat: den 27 oktober 2020 13:10
Till: postgis-users at lists.osgeo.org
Ämne: Re: [postgis-users] breake lines

Thanks, will check!
/paul

Från: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] För Alexandre Neto
Skickat: den 27 oktober 2020 12:40
Till: PostGIS Users Discussion
Ämne: Re: [postgis-users] breake lines

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<https://url11.mailanyone.net/v1/?m=1kXNKs-0006Zi-5R&i=57e1b682&c=5Sou3JJva6RDnTVM4f5yzufEHOxUs6yzTUgitDxzMOqJmZIpZuRh0FE3V8n9K0XU3Zv5FKi7N3IcHFDxO8sQFG0cSRttPzd6eEi1rmnrnxd5Tlmt-exgn53wWY_-fjT3Vzo_Za73H014NEUCtk5V13aEgggeKtqcPAGElC6fb0mcPI1WfO4VsnzLLiDqeMK_nb6TC8eu_F-AIaoA0HdTkcFhUyPKM65QLvAhM2cv06o>

On Tue, Oct 27, 2020 at 9:40 AM <paul.malm at lfv.se<mailto: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<mailto:postgis-users at lists.osgeo.org>
https://lists.osgeo.org/mailman/listinfo/postgis-users<https://url11.mailanyone.net/v1/?m=1kXNKs-0006Zi-5R&i=57e1b682&c=D9kMtVC14ee6ZKV0ncdfu8pIGPpX1uwohghuRc5cvHCvMS1iVL2Po9TF6dGL6EcNNFqdHugoyesFAu8mh2fvjfJ4U-bHLp4w7G6m8H3uAWWMxTPbovBY_QgPtBbFdX3lGeG4mXLVRWbcMiAPgBy5I356s3Z1jN7olnk701a48yahx4HBoyGfDwslozpuBSajBawXMzSd550qJCBKtI0ghvLx-kg1eoyvZXiYYZgO0DNi7h_eL9Ey68BCboRs8cutfaTGGeOKkhAzXyLZrcVN6g>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20201028/b7820156/attachment.html>


More information about the postgis-users mailing list