Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- with poly as (
- SELECT ST_UNION(ST_BUFFER(lines.geom, 3)) as newgeom
- FROM roads
- )
- select
- case
- when ST_coveredby(l.geom, poly.newgeom)
- then l.geom
- else
- ST_Intersection(geom, poly.newgeom) end as geom
- from lines as l
- inner join poly
- on ST_Intersects(l.geom, poly.newgeom)
- and not ST_touches(l.geom, poly.newgeom)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement