<html>
<head>
</head>
<body>Apostolis<br />
<br />
What confuses here is that union means different things in Arc world and PostGIS. PostGIS union is dissolved in ArcMap (I think).<br />
<br />
The problem is that the easy way in PostGIS only compares 2 geometries at a time and here you need to get a result from many polygons. <br />
<br />
As I understand the ArcMap uion is about the same as decribed here:<br />
http://trac.osgeo.org/postgis/wiki/UsersWikiExamplesOverlayTables<br />
<br />
and also the accepted answer here:<br />
http://gis.stackexchange.com/questions/83/separate-polygons-based-on-intersection-using-postgis<br />
<br />
It is maybe not exactly the same because this PostGIS approach will only give one p<br />
HTH<br />
<br />
Nicklas <br />
<br />
2011-01-04 skrev Ben Madin :<br />
<br />
Apostolis,<br />
><br />
>On 04/01/2011, at 4:55 AM, ΑΠΟΣΤΟΛΟΣ ΛΕΛΕΝΤΖΗΣ wrote:<br />
><br />
>> Indeed, i understand the power of spatial SQL, but now i am a beginner, and i need a lot of work.<br />
>> <br />
>> As i mentioned, i want to union two layers, typing a spatial SQL query.<br />
>> I want to take the same result, if i use the tool union of ArcGIS. But, i don't like to talk with terminal of ArcGIS, so i want to execute one of the classic spatial action, namely UNION (A or B).<br />
>> Because, i can't type the right command..could you help me???<br />
><br />
>It is fairly well documented, but this example unions two polygons (A Red, B Green).<br />
><br />
><br />
><br />
><br />
><br />
><br />
>SELECT ST_AsText( <br />
> ST_Union( <br />
> ST_GeomFromText( <br />
> 'POLYGON (( 1 1,1 3, 3 3 ,3 1,1 1))' -- Polygon A<br />
> ), <br />
> ST_GeomFromText( <br />
> 'POLYGON((2 2, 2 4, 4 4, 4 2, 2 2))' -- Polygon B<br />
> ) <br />
> ) <br />
>);<br />
><br />
> st_astext <br />
>------------------------------------------------<br />
> POLYGON((1 1,1 3,2 3,2 4,4 4,4 2,3 2,3 1,1 1))<br />
>(1 row)<br />
><br />
><br />
><br />
><br />
>_______________________________________________<br />
>postgis-users mailing list<br />
>postgis-users@postgis.refractions.net<br />
>http://postgis.refractions.net/mailman/listinfo/postgis-users<br />
><br />
>
</body>
</html>