<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#ffffff">
Hi Teresa,<br>
<br>
I'm struggeling with the translation of the union (analysis) tool of
ArcGIS into PostGIS myself since a while. The problem is, that in
PostGIS, you always compare one row of the first data set with one row
of the second data set. That means, that interaction of more than 2
polygons is always a problem... I try to solve it by using loops
written with pl/pgsql. They loop through all polygons of one data set
and compare every single polygon with all polygons of the other data
set. All polygons of the second data set that intersect with the
reviewed polygon of the first data set are written into a new table. As
for the difference part they are bundled with st_union and then
st_difference is performed with the polygon of the first data set.
Regarding the intersection part, st_intersection is performed for all
combinations of polygon (data set 1) and the intersecting polygons of
data set 2. Then the resulting polygons have to be intersected again in
a loop until no new intersections occur.<br>
<br>
If you are interested, I could share the current state of my
experimentation with you... But don't expect too much - as Ralf already
said, allocation of attributes (and not only that) is very difficult.
But, unfortunately, most datasources, I have to use, contain
overlapping polygons. Therefore, I have to deal with that situation
somehow as you may have to do, too.<br>
<br>
Regards,<br>
<br>
Birgit.<br>
<blockquote type="cite">
  <div class="moz-text-plain" wrap="true" graphical-quote="true"
 style="font-family: -moz-fixed; font-size: 12px;" lang="x-western">
  <pre wrap="">Hi Teresa,

you can't get a intersection from more then two polygons at a time. Think 
about the attributes you get. The attributes are from poly1 and or poly2. The 
solution is to use only datasources with non overlaping polygons.

Gr
Ralf

Am Donnerstag 08 Juli 2010, 09:27:06 schrieb Teresa Fazio:
  </pre>
  <blockquote type="cite" style="color: rgb(0, 0, 0);">
    <pre wrap=""><span class="moz-txt-citetags">> </span>The solution you propose is valid to get polygons describing
<span class="moz-txt-citetags">> </span>intersections between two polygons, but I cannot figure out how to
<span class="moz-txt-citetags">> </span>obtain polygons describing intersections between more than two polygons
<span class="moz-txt-citetags">> </span>like the central polygon drawn in the shape TEST_Union.
<span class="moz-txt-citetags">> </span>I repeat that the TEST_Union shapefile was simply obtained using the
<span class="moz-txt-citetags">> </span>"union (analysis)" tool in ESRI ArcGIS.
<span class="moz-txt-citetags">> </span>
<span class="moz-txt-citetags">> </span>Any other help?
<span class="moz-txt-citetags">> </span>Thank you.
<span class="moz-txt-citetags">> </span>
<span class="moz-txt-citetags">> </span>_______________________________________________
<span class="moz-txt-citetags">> </span>postgis-users mailing list
<span class="moz-txt-citetags">> </span><a
 class="moz-txt-link-abbreviated"
 href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<span class="moz-txt-citetags">> </span><a
 class="moz-txt-link-freetext"
 href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>
    </pre>
  </blockquote>
  <pre wrap="">_______________________________________________
postgis-users mailing list
<a class="moz-txt-link-abbreviated"
 href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a>
<a class="moz-txt-link-freetext"
 href="http://postgis.refractions.net/mailman/listinfo/postgis-users">http://postgis.refractions.net/mailman/listinfo/postgis-users</a>

  </pre>
  </div>
</blockquote>
</body>
</html>