Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. SELECT A.id,
  2. ST_Union(
  3. COALESCE(
  4. ST_Difference(
  5. A.the_geom,
  6. B.the_geom
  7. ),
  8. A.the_geom
  9. )
  10. ) As the_geom
  11. FROM A
  12. LEFT JOIN b ON ST_Intersects(A.the_geom, B.the_geom)
  13. GROUP BY A.id;
  14.  
  15. SELECT A.id,
  16. ST_Union(
  17. COALESCE(
  18. ST_Difference(
  19. A.the_geom,
  20. ST_Union(B.the_geom)
  21. ),
  22. A.the_geom
  23. )
  24. ) As the_geom
  25. FROM A
  26. LEFT JOIN B ON ST_Intersects(A.the_geom, B.the_geom)
  27. GROUP BY A.id;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement