<div dir="ltr">thanks for the quick reply strk<div><br></div><div><span style="background-color:rgb(255,255,255)"><font color="#ff0000">>How do you think they should?</font></span></div><div>My understanding was in order to associate your attributes from your original data to the new topological geometry you would be joining them like it is done here:</div><div><br></div><div><pre class="" style="margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(239,240,241)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,'Lucida Console','Liberation Mono','DejaVu Sans Mono','Bitstream Vera Sans Mono','Courier New',monospace,sans-serif;white-space:inherit"><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">SELECT</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> r</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">road_type</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> r</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">road_name</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> e</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">geom
</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">FROM</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> roads_topo</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">edge e</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
     roads_topo</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">relation rel</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
     roads r
</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">WHERE</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> e</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">edge_id </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> rel</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">element_id
  </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">AND</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> rel</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">topogeo_id </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">r</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">topo_geom</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">).</span><span class="" style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">id</span></code></pre></div><div>Which came from this answer in stackexchange<br></div><div><a href="http://gis.stackexchange.com/a/71756">http://gis.stackexchange.com/a/71756</a><br></div><div><br></div><div>In my case thought for some reason topogeo_id is not that same ID that is given in the original data.</div><div><br></div><div><span style="font-size:12.8px"><font color="#ff0000">>Where's the statement creating the "temp_trails" table ?</font></span><br></div><div><span style="font-size:12.8px"><font color="#000000">i just used </font></span></div><div><span style="font-size:12.8px"><font color="#000000"><br></font></span></div><div><span style="font-size:12.8px"><font color="#000000">create public.temptrails as select * from production.trails;</font></span></div><div>alter table public.temptrails add primary key (trails_id);</div><div><span style="font-size:12.8px"><font color="#000000"><br></font></span></div><div><font color="#ff0000"><span style="font-size:12.8px">>The attributes should be associated to the TopoGeometry objects (for >example </span><span style="font-size:12.8px">in "temp_trails"), not to the records in the relation table.</span></font><span style="font-size:12.8px"><font color="#000000"><br></font></span></div><div><span style="font-size:12.8px"><font color="#000000"><br></font></span></div><div><span style="font-size:12.8px"><font color="#000000">Hmm...From the results I get I dont see how that would be. I dont see anything that relates directly back to the original data. </font></span></div><div><span style="font-size:12.8px"><font color="#000000"><br></font></span></div><div><span style="font-size:12.8px"><font color="#000000">As I had mentioned before, testing out how to associate the original attributes back to the topological geometry worked using the select statement above (the one from stackexchange).</font></span></div><div><span style="font-size:12.8px"><font color="#000000"><br></font></span></div><div><span style="font-size:12.8px"><font color="#000000">Hopefully that all makes sense.</font></span></div><div><span style="font-size:12.8px"><font color="#000000">Garret</font></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, May 27, 2016 at 3:13 PM, Sandro Santilli <span dir="ltr"><<a href="mailto:strk@kbt.io" target="_blank">strk@kbt.io</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, May 27, 2016 at 02:34:24PM -0500, Garret W wrote:<br>
<br>
> After creating a topology on a trail network, the unique IDs used in my<br>
> dataset are not the showing up as they should in relations.topogeo_id.<br>
<br>
</span>How do you think they should ?<br>
<span class=""><br>
> Here are my steps (pretty standard):<br>
><br>
> SELECT CreateTopology('trails_topo', 3435);<br>
> SELECT AddTopoGeometryColumn('trails_topo', 'myschema', 'temp_trails',<br>
> 'topogeom', 'LINESTRING');<br>
> UPDATE public.temp_trails SET topogeom = toTopoGeom(geom, 'trails_topo', 1,<br>
> 3);<br>
<br>
</span>Where's the statement creating the "temp_trails" table ?<br>
<span class=""><br>
> Afterwards Im just using the relations table to join the attributes to the<br>
> new topological data.<br>
<br>
</span>The attributes should be associated to the TopoGeometry objects (for example<br>
in "temp_trails"), not to the records in the relation table.<br>
<br>
--strk;<br>
<br>
  ()   Free GIS & Flash consultant/developer<br>
  /\   <a href="https://strk.kbt.io/services.html" rel="noreferrer" target="_blank">https://strk.kbt.io/services.html</a><br>
</blockquote></div><br></div>