[postgis-users] Topology & Attributes

Nicolas Ribot nicolas.ribot at gmail.com
Mon Feb 9 01:05:51 PST 2015


Hi,

As usual with SQL, there must be several other ways to perform the same
query.

As the edge view stores 2 faces id per row (left and right), I duplicated
the joins to join both left_face and right face against the original
polygon table (p1 and p2 aliases)

Nicolas

On 8 February 2015 at 21:57, Ofer Zilberstein <zilberstein.ofer at gmail.com>
wrote:

> Much Thanks,
>
> First I will try to understand the join that you did and then try to
> implement it...
>
> Ofer
>
> On Sun, Feb 8, 2015 at 12:44 PM, Nicolas Ribot <nicolas.ribot at gmail.com>
> wrote:
>
>> Hi,
>>
>> When you build the topology, for instance with topology.toTopoGeom(), you
>> get back a TopoGeometry object for each polygon added to the topology.
>> This TopoGeometry is used to keep a link between your polygon object and
>> all the topological elements composing it.
>> 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.
>>
>> To get the right and left original polygons from the topology, you make a
>> join between edge, relation and pg table:
>> (topo_grass is the topo schema, parcelle is the polygon table with a topo
>> column containing the TopoGeometry object corresponding to the polygon):
>>
>> select e.edge_id, e.left_face, e.right_face,
>>   p1.id as left_id, p2.id as right_id
>> from topo_grass.edge e
>>   join topo_grass.relation r1 on r1.element_id = e.left_face
>>   join pe.parcelle p1 on (1, (p1.topo).id) = (r1.layer_id, r1.topogeo_id)
>>   join topo_grass.relation r2 on r2.element_id = e.right_face
>>   join pe.parcelle p2 on (1, (p2.topo).id) = (r2.layer_id, r2.topogeo_id);
>>
>> Nicolas
>>
>>
>>
>> On 8 February 2015 at 10:29, Ofer Zilberstein <zilberstein.ofer at gmail.com
>> > wrote:
>>
>>>
>>> Hi,
>>>
>>> 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.
>>>
>>> The edges hold the left & right faces.
>>>
>>> How or what is the right way to add to the edges the right and left
>>> original polygons ?
>>>
>>> --
>>>
>>> *Ofer Zilberstein*
>>>
>>>     Mobile: 972-544886873
>>>
>>>     Skype: ofer.zilberstein
>>>
>>>     Mail: zilberstein.ofer at gmail.com
>>>
>>> _______________________________________________
>>> postgis-users mailing list
>>> postgis-users at lists.osgeo.org
>>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>>
>>
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>>
>
>
>
> --
>
> *Ofer Zilberstein*
>
>     Mobile: 972-544886873
>
>     Skype: ofer.zilberstein
>
>     Mail: zilberstein.ofer at gmail.com
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20150209/485ec5c8/attachment.html>


More information about the postgis-users mailing list