I have lines that I would like to split at polygon boundaries. The line table is MULTI and the polygon table is MULTI and was derived from a MULTILINESTRING table that was buffered then unioned to create one geometry.
The pink is the polygon and the white lines are what needs to be split at the polygon boundaries.
This is the returned geometry after running my query. Note the missing geoms, both inside and outside of the polygon, relative to the first pic.
I am almost there but my query is not returning all the lines that are in my original table and I can't figure out why.
CREATE TABLE split As WITH dmp_geom As ( -- used to dump from MULTILINESTRING to LINESTRING SELECT (ST_Dump(multiline.geom)).geom As dmp_geom FROM multiline ), split_geom As ( --splitting dumped lines at polygon boundaries SELECT ST_Split(t1.dmp_geom, t2.geom) As split_geom FROM dmp_geom t1, unioned_poly t2 ) SELECT ST_CollectionExtract(split_geom, 2) As geom --select only lines FROM split_geom;
My question is: how can adjust my query so that I will get all the features in my original table, just split at the polygon boundaries?