8

This question already has an answer here:

I'm trying to use PostGIS to do a 'union' of polygons. When I Googled "PostGIS Union", I found the ST_Union function, which performs what I would call a 'dissolve,' not a Union. What I actually want to do is what GRASS refers to as an "Overlay" with the "OR" operator, or QGIS/ArcGIS just simply call a "Union." For example:

enter image description here

From what I can tell, in PostGIS it appears I need to use both ST_Intersection and ST_SymDifference together to get the results I am seeking. I have had some success with the following syntax, but it's terribly inefficient. Is there a better/more efficient way to do what I'm hoping to accomplish?

INSERT INTO "CombinedResults" ("geom")
SELECT ST_SymDifference(
        "test1".GEOM
        ,"test2".GEOM
        )
    FROM "test1","test2";

INSERT INTO "CombinedResults" ("geom")
SELECT ST_Intersection(
        "test1".GEOM
        ,"test2".GEOM
        )
    FROM "test1","test2"

marked as duplicate by PolyGeo Mar 27 '16 at 0:49

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

-1

Maybe ST_ConvexHull will help you. See this snippet to understand how it works http://www.bostongis.com/postgis_concavehull.snippet

  • This is not a definitive answer, also the relevant information from the link should be provided in the answer in order to mitigate link rot – raphael Mar 26 '16 at 18:19

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