[postgis-users] can not get st_split to work.

paul.malm at lfv.se paul.malm at lfv.se
Tue Jan 7 05:23:21 PST 2020


Thanks, Regina....

Från: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] För Regina Obe
Skickat: den 23 december 2019 20:31
Till: 'PostGIS Users Discussion'
Ämne: Re: [postgis-users] can not get st_split to work.

I don't see your blade CTE used at all and both a and b are roads which wouldn't work with ST_Split, since the blade needs to be one dimension lower than the thing you are splitting.

So the error you are getting  "Splitter line has linear intersection with input SQL state: XX000"

Is because your intersection literally is returning a line instead a point.


From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of paul.malm at lfv.se
Sent: Monday, December 23, 2019 2:52 AM
To: postgis-users at lists.osgeo.org
Subject: [postgis-users] can not get st_split to work.

Hi ,
I've created a point-table (point) where I would like to split the lines in table roads.

SQL:
CREATE TABLE  roads_splitted AS
WITH
blade AS (SELECT ST_Collect(the_geom) AS the_geom  FROM  point)

SELECT fid, (ST_Dump
                           (ST_Split(
                                              a.the_geom, (SELECT ST_Collect(b.the_geom) AS geom FROM
                                                                           roads AS b WHERE ST_Intersects(a.the_geom, b.the_geom)
                                                                           )
                                               )
                              )).geom
FROM roads AS a
UNION ALL SELECT fid, the_geom FROM roads AS a
WHERE  NOT EXISTS (
           SELECT 1  FROM  point AS b WHERE  ST_Intersects(a.the_geom, b.the_geom)
);

I'm getting this error message:
ERROR: Splitter line has linear intersection with input SQL state: XX000


Anyone who knows wat I'm doing wrong? Linear intersection with a point and a line?

Kind regards,
Paul

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20200107/4ed8718f/attachment.html>


More information about the postgis-users mailing list