<div dir="ltr">Much Thanks,<div><br></div><div>First I will try to understand the join that you did and then try to implement it...</div><div><br></div><div>Ofer</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 8, 2015 at 12:44 PM, Nicolas Ribot <span dir="ltr"><<a href="mailto:nicolas.ribot@gmail.com" target="_blank">nicolas.ribot@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>When you build the topology, for instance with topology.toTopoGeom(), you get back a TopoGeometry object for each polygon added to the topology.</div><div>This TopoGeometry is used to keep a link between your polygon object and all the topological elements composing it. </div><div>The "relation" table inside the topo schema holding the topology contains the identifier of the topoGeometry object and the identifiers of topo elements composing the polygon.</div><div><br></div><div>To get the right and left original polygons from the topology, you make a join between edge, relation and pg table: </div><div>(topo_grass is the topo schema, parcelle is the polygon table with a topo column containing the TopoGeometry object corresponding to the polygon):</div><div><pre style="color:rgb(169,183,198);font-family:Menlo;background-color:rgb(43,43,43)"><font size="1"><span style="color:rgb(204,120,50);font-weight:bold;background-color:rgb(62,56,80)">select </span><span style="background-color:rgb(62,56,80)">e.edge_id</span><span style="color:rgb(204,120,50);background-color:rgb(62,56,80)">, </span><span style="background-color:rgb(62,56,80)">e.left_face</span><span style="color:rgb(204,120,50);background-color:rgb(62,56,80)">, </span><span style="background-color:rgb(62,56,80)">e.right_face</span><span style="color:rgb(204,120,50);background-color:rgb(62,56,80)">,</span><span style="color:rgb(204,120,50)"><br></span><span style="color:rgb(204,120,50)">  </span>p1.<span style="color:rgb(208,208,255);font-weight:bold">id </span><span style="color:rgb(204,120,50);font-weight:bold">as </span>left_id<span style="color:rgb(204,120,50)">, </span>p2.<span style="color:rgb(208,208,255);font-weight:bold">id </span><span style="color:rgb(204,120,50);font-weight:bold">as </span>right_id<br><span style="color:rgb(204,120,50);font-weight:bold">from </span>topo_grass.edge e<br>  <span style="color:rgb(204,120,50);font-weight:bold">join </span>topo_grass.relation r1 <span style="color:rgb(204,120,50);font-weight:bold">on </span>r1.<span style="color:rgb(208,208,255);font-weight:bold">element_id </span>= e.<span style="color:rgb(208,208,255);font-weight:bold">left_face<br></span><span style="color:rgb(208,208,255);font-weight:bold">  </span><span style="color:rgb(204,120,50);font-weight:bold">join </span>pe.parcelle p1 <span style="color:rgb(204,120,50);font-weight:bold">on </span>(<span style="color:rgb(104,151,187)">1</span><span style="color:rgb(204,120,50)">, </span>(p1.<span style="color:rgb(208,208,255);font-weight:bold">topo</span>).<span style="color:rgb(208,208,255);font-weight:bold">id</span>) = (r1.<span style="color:rgb(208,208,255);font-weight:bold">layer_id</span><span style="color:rgb(204,120,50)">, </span>r1.<span style="color:rgb(208,208,255);font-weight:bold">topogeo_id</span>)<br>  <span style="color:rgb(204,120,50);font-weight:bold">join </span>topo_grass.relation r2 <span style="color:rgb(204,120,50);font-weight:bold">on </span>r2.<span style="color:rgb(208,208,255);font-weight:bold">element_id </span>= e.<span style="color:rgb(208,208,255);font-weight:bold">right_face<br></span><span style="color:rgb(208,208,255);font-weight:bold;background-color:rgb(62,56,80)">  </span><span style="color:rgb(204,120,50);font-weight:bold;background-color:rgb(62,56,80)">join </span><span style="background-color:rgb(62,56,80)">pe.parcelle p2 </span><span style="color:rgb(204,120,50);font-weight:bold;background-color:rgb(62,56,80)">on </span><span style="background-color:rgb(62,56,80)">(</span><span style="color:rgb(104,151,187);background-color:rgb(62,56,80)">1</span><span style="color:rgb(204,120,50);background-color:rgb(62,56,80)">, </span><span style="background-color:rgb(62,56,80)">(p2.topo).id) = (r2.layer_id</span><span style="color:rgb(204,120,50);background-color:rgb(62,56,80)">, </span><span style="background-color:rgb(62,56,80)">r2.topogeo_id)</span><span style="color:rgb(204,120,50)">;</span></font></pre></div><div>Nicolas</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On 8 February 2015 at 10:29, Ofer Zilberstein <span dir="ltr"><<a href="mailto:zilberstein.ofer@gmail.com" target="_blank">zilberstein.ofer@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div dir="ltr"><br clear="all"><div>Hi,</div><div><br></div><div>When you build topology from set of connected polygons, the original polygon attributes are not part of the topology model. The model creates MBR face for each original polygon. </div><div><br></div><div>The edges hold the left & right faces.</div><div><br></div><div>How or what is the right way to add to the edges the right and left original polygons ?</div><span><font color="#888888"><div><br></div>-- <br><div><div dir="ltr"><p><span style="font-size:10pt;font-family:Arial,sans-serif"><b>Ofer Zilberstein</b></span></p><p><span style="font-size:9pt;line-height:14px;font-family:Arial,sans-serif;color:rgb(95,95,95)">    Mobile: <a href="tel:972-544886873" value="+972544886873" target="_blank">972-544886873</a><u></u></span></p><p><span style="font-size:9pt;line-height:14px;font-family:Arial,sans-serif;color:rgb(95,95,95)">    Skype: ofer.zilberstein</span></p><p><span style="font-size:9pt;line-height:14px;font-family:Arial,sans-serif;color:rgb(95,95,95)">    Mail: <a href="mailto:zilberstein.ofer@gmail.com" target="_blank">zilberstein.ofer@gmail.com</a></span></p></div></div>
</font></span></div>
<br></div></div>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br></div>
<br>_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org">postgis-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users" target="_blank">http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><p><span style="font-size:10pt;font-family:Arial,sans-serif"><b>Ofer Zilberstein</b></span></p><p><span style="font-size:9pt;line-height:14px;font-family:Arial,sans-serif;color:rgb(95,95,95)">    Mobile: 972-544886873<u></u></span></p><p><span style="font-size:9pt;line-height:14px;font-family:Arial,sans-serif;color:rgb(95,95,95)">    Skype: ofer.zilberstein</span></p><p><span style="font-size:9pt;line-height:14px;font-family:Arial,sans-serif;color:rgb(95,95,95)">    Mail: <a href="mailto:zilberstein.ofer@gmail.com" target="_blank">zilberstein.ofer@gmail.com</a></span></p></div></div>
</div>