[postgis-users] topology, joining attributes
Richard Greenwood
richard.greenwood at gmail.com
Wed Jul 23 05:23:56 PDT 2014
Got it. Thank you very much. I was close but would not have gotten there
without your explanation.
Rich
On Wed, Jul 23, 2014 at 2:49 AM, Rémi Cura <remi.cura at gmail.com> wrote:
> Hey,
> the mapping is not direct.
> Schematically,
> it would be :
> your topogeom -> (topogeom_id) relation table (element_id)-> (face_id)
> face.
> Maybe this schema can help you :
>
> http://trac.osgeo.org/postgis/attachment/ticket/2578/postgis_topology_data_model_explained%20%286%29.png
>
> Your querry could look like this:
>
> SELECT my_topogeom, f.face_id
> FROM my_table AS mt
> INNER JOIN relation AS r ON (((mt.mytopogeom).id ,
> (mt.mytopogeom).layer_id)) = (r.topogeo_id, r.layer_id )
> INNER JOIN face AS f ON (r.element_id = f.face_id)
>
> Cheers,
> Rémi-C
>
>
> 2014-07-23 3:17 GMT+02:00 Richard Greenwood <richard.greenwood at gmail.com>:
>
>> I have a table of simple polygons named work.aliquot with a primary key
>> named ogc_fid and several columns of attribute data. I created a topology
>> and added a topogeometry column and then:
>>
>> UPDATE aliquot SET topogeom = toTopoGeom(wkb_geometry,
>> 'aliquot_topology', 1);
>>
>> The various fields and tables all appear to have been populated correctly.
>>
>> Now I need to join the attributes from the work.aliquot table to
>> aliquot_topology.face but I'm stuck. I was guessing that
>> aliquot_topology.relation would be the route but after some experimenting
>> that seems not to be the case, or else I'm not getting it. Do I have to do
>> a spatial join to get my attributes from the source table into my new
>> topology?
>>
>> Thanks,
>> Rich
>>
>> --
>> Richard W. Greenwood, PLS
>> www.greenwoodmap.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
>
--
Richard W. Greenwood, PLS
www.greenwoodmap.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20140723/1f884c5f/attachment.html>
More information about the postgis-users
mailing list