What I want to do is make the purple layer at the back having the same shape as the transparent layer.

However, I don't want any attributes of the transparent layer to be joined to the purple layer, is there any command I can use in Postgis to achieve this? enter image description here

  • 'attributes of the transparent layer to be joined to the purple layer" how do you want one layer to see the other? This obviously requires a join. You can't operate on two layers without joining them. Commented Jan 18, 2017 at 1:55
  • Does this query return all original table columns as well? it sounds like it is just replacing the geometry and therefore all original table attributes should pass through as well or is it just returning geometry?
    – flyfishwv
    Commented May 30, 2019 at 13:35

1 Answer 1


Just figured it out. Not sure if it helps anyone by answering my own question

UPDATE blue b
SET geom = ST_Intersection(b.geom, p.geom)
FROM purple p
WHERE ST_Intersects(b.geom, p.geom);

It gets the geometry of the intersection and use it to replace the one in the original table


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.