Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. with poly as (
  2. SELECT ST_UNION(ST_BUFFER(lines.geom, 3)) as newgeom
  3. FROM roads
  4. )
  5. select
  6. case
  7. when ST_coveredby(l.geom, poly.newgeom)
  8. then l.geom
  9. else
  10. ST_Intersection(geom, poly.newgeom) end as geom
  11. from lines as l
  12. inner join poly
  13. on ST_Intersects(l.geom, poly.newgeom)
  14. and not ST_touches(l.geom, poly.newgeom)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement