<div dir="ltr">Hi Steve,<br><br>It has changed table name to the_network and after that to ways. Error is same all the time. Is there something wrong in function? Or i am missing something?<br><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; font-size: 13px;"><p>

<b>SQL error:</b><br></p><pre class="data" style="font-size: 13px; font-family: arial,tahoma,verdana,helvetica,sans-serif,serif;">ERROR:  column &quot;’the_network’&quot; does not exist<br>LINE 1: SELECT assign_vertex_id3d(’the_network’, 1, ’the_geom’, ’gid...<br>

                                  ^</pre><p><b>In statement:</b><br>SELECT assign_vertex_id3d(’the_network’, 1, ’the_geom’, ’gid’, &#39;F_LEVEL&#39;, &#39;T_LEVEL&#39;);</p><p>Function <span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; font-size: 13px;">assign_vertex_id3d </span></span>is bellow<br>

</p></span></span><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: &#39;Times New Roman&#39;; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; font-size: medium;"><span class="Apple-style-span" style="font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; font-size: 13px;"><table width="90%">

<tbody><tr><td class="data1" style="background-color: rgb(243, 243, 233); margin: 4px; font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; padding: 0px; font-size: smaller; color: rgb(0, 0, 0); text-align: left;">

assign_vertex_id3d</td><td class="data1" style="background-color: rgb(243, 243, 233); margin: 4px; font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; padding: 0px; font-size: smaller; color: rgb(0, 0, 0); text-align: left;">

&quot;geom_table&quot; character varying, &quot;tolerance&quot; double precision, &quot;geo_cname&quot; character varying, &quot;gid_cname&quot; character varying, &quot;source_zlevel_cname&quot; character varying, &quot;target_zlevel_cname&quot; character varying</td>

<td class="data1" style="background-color: rgb(243, 243, 233); margin: 4px; font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; padding: 0px; font-size: smaller; color: rgb(0, 0, 0); text-align: left;">character varying</td>

<td class="data1" style="background-color: rgb(243, 243, 233); margin: 4px; font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; padding: 0px; font-size: smaller; color: rgb(0, 0, 0); text-align: left;">plpgsql</td>

</tr><tr><th class="data" colspan="4" style="color: rgb(0, 0, 0); background-color: rgb(230, 230, 204); font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; font-size: smaller;">Definition</th></tr><tr><td class="data1" colspan="4" style="background-color: rgb(243, 243, 233); margin: 4px; font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; padding: 0px; font-size: smaller; color: rgb(0, 0, 0); text-align: left;">

<table><tbody><tr><td class="data1" style="background-color: rgb(243, 243, 233); margin: 4px; font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; padding: 0px 10px 0px 0px; font-size: smaller; color: rgb(0, 0, 0); text-align: left; vertical-align: top;">

<pre class="data1" style="font-size: 12px;">1<br>2<br>3<br>4<br>5<br>6<br>7<br>8<br>9<br>10<br>11<br>12<br>13<br>14<br>15<br>16<br>17<br>18<br>19<br>20<br>21<br>22<br>23<br>24<br>25<br>26<br>27<br>28<br>29<br>30<br>31<br>

32<br>33<br>34<br>35<br>36<br>37<br>38<br>39<br>40<br>41<br>42<br>43<br>44<br>45<br></pre></td><td class="data1" style="background-color: rgb(243, 243, 233); margin: 4px; font-family: arial,tahoma,verdana,helvetica,sans-serif,serif; padding: 0px; font-size: smaller; color: rgb(0, 0, 0); text-align: left; vertical-align: top;">

<pre class="data1" style="font-size: 12px;"><span class="keyword" style="color: rgb(255, 128, 0);">DECLARE</span><br>   _r record;<br>   source_id <span class="keyword" style="color: rgb(255, 128, 0);">int</span>;<br>   target_id <span class="keyword" style="color: rgb(255, 128, 0);">int</span>;<br>

   srid <span class="keyword" style="color: rgb(255, 128, 0);">integer</span>;<br><span class="keyword" style="color: rgb(255, 128, 0);">BEGIN</span><br><br>   <span class="keyword" style="color: rgb(255, 128, 0);">BEGIN</span><br>

   <span class="keyword" style="color: rgb(255, 128, 0);">DROP</span> <span class="keyword" style="color: rgb(255, 128, 0);">TABLE</span> vertices_tmp;<br>   <span class="keyword" style="color: rgb(255, 128, 0);">EXCEPTION</span><br>

   <span class="keyword" style="color: rgb(255, 128, 0);">WHEN</span> UNDEFINED_TABLE <span class="keyword" style="color: rgb(255, 128, 0);">THEN</span><br>   <span class="keyword" style="color: rgb(255, 128, 0);">END</span>;<br>

<br>   <span class="keyword" style="color: rgb(255, 128, 0);">EXECUTE</span> <span class="literal" style="color: rgb(128, 128, 128);">&#39;CREATE TABLE vertices_tmp (id serial)&#39;</span>;<br><br><span class="comment" style="color: rgb(0, 128, 128);">--    FOR _r IN EXECUTE &#39;SELECT srid FROM geometry_columns WHERE f_table_name=&#39;&#39;&#39;|| quote_ident(geom_table)||&#39;&#39;&#39;;&#39; LOOP<br>

</span><span class="comment" style="color: rgb(0, 128, 128);">--      srid := _r.srid;<br></span><span class="comment" style="color: rgb(0, 128, 128);">--    END LOOP;<br></span><br>   srid := Find_SRID(<span class="literal" style="color: rgb(128, 128, 128);">&#39;public&#39;</span>,quote_ident(geom_table),quote_ident(geo_cname));<br>

<br><br>   <span class="keyword" style="color: rgb(255, 128, 0);">EXECUTE</span> <span class="literal" style="color: rgb(128, 128, 128);">&#39;SELECT addGeometryColumn(&#39;</span><span class="literal" style="color: rgb(128, 128, 128);">&#39;vertices_tmp&#39;</span><span class="literal" style="color: rgb(128, 128, 128);">&#39;, &#39;</span><span class="literal" style="color: rgb(128, 128, 128);">&#39;the_geom&#39;</span><span class="literal" style="color: rgb(128, 128, 128);">&#39;, &#39;</span>||srid||<span class="literal" style="color: rgb(128, 128, 128);">&#39;, &#39;</span><span class="literal" style="color: rgb(128, 128, 128);">&#39;POINT&#39;</span><span class="literal" style="color: rgb(128, 128, 128);">&#39;, 3)&#39;</span>;<br>

   <span class="keyword" style="color: rgb(255, 128, 0);">CREATE</span> <span class="keyword" style="color: rgb(255, 128, 0);">INDEX</span> vertices_tmp_idx <span class="keyword" style="color: rgb(255, 128, 0);">ON</span> vertices_tmp <span class="keyword" style="color: rgb(255, 128, 0);">USING</span> GIST (the_geom);<br>

<br>   <span class="keyword" style="color: rgb(255, 128, 0);">FOR</span> _r <span class="keyword" style="color: rgb(255, 128, 0);">IN</span> <span class="keyword" style="color: rgb(255, 128, 0);">EXECUTE</span> <span class="literal" style="color: rgb(128, 128, 128);">&#39;SELECT &#39;</span> || quote_ident(gid_cname) || <span class="literal" style="color: rgb(128, 128, 128);">&#39; AS id,&#39;</span><br>

           || <span class="literal" style="color: rgb(128, 128, 128);">&#39; ST_MakePoint(ST_X(StartPoint(&#39;</span>|| quote_ident(geo_cname) ||<span class="literal" style="color: rgb(128, 128, 128);">&#39;)), ST_Y(StartPoint(&#39;</span>|| quote_ident(geo_cname) ||<span class="literal" style="color: rgb(128, 128, 128);">&#39;)), &#39;</span>|| quote_ident(source_zlevel_cname) ||<span class="literal" style="color: rgb(128, 128, 128);">&#39;) AS source,&#39;</span><br>

           || <span class="literal" style="color: rgb(128, 128, 128);">&#39; ST_MakePoint(ST_X(EndPoint(&#39;</span>|| quote_ident(geo_cname) ||<span class="literal" style="color: rgb(128, 128, 128);">&#39;)), ST_Y(EndPoint(&#39;</span>|| quote_ident(geo_cname) ||<span class="literal" style="color: rgb(128, 128, 128);">&#39;)), &#39;</span>|| quote_ident(target_zlevel_cname) ||<span class="literal" style="color: rgb(128, 128, 128);">&#39;) AS target&#39;</span><br>

           || <span class="literal" style="color: rgb(128, 128, 128);">&#39; FROM &#39;</span> || quote_ident(geom_table)<br>   LOOP<br><br>       source_id := point_to_id3d(setsrid(_r.<span class="keyword" style="color: rgb(255, 128, 0);">source</span>, srid), tolerance);<br>

       target_id := point_to_id3d(setsrid(_r.target, srid), tolerance);<br><br>       <span class="keyword" style="color: rgb(255, 128, 0);">EXECUTE</span> <span class="literal" style="color: rgb(128, 128, 128);">&#39;update &#39;</span> || quote_ident(geom_table) ||<br>

               <span class="literal" style="color: rgb(128, 128, 128);">&#39; SET source = &#39;</span> || source_id ||<br>               <span class="literal" style="color: rgb(128, 128, 128);">&#39;, target = &#39;</span> || target_id ||<br>

               <span class="literal" style="color: rgb(128, 128, 128);">&#39; WHERE &#39;</span> || quote_ident(gid_cname) || <span class="literal" style="color: rgb(128, 128, 128);">&#39; =  &#39;</span> || _<a href="http://r.id">r.id</a>;<br>

   <span class="keyword" style="color: rgb(255, 128, 0);">END</span> LOOP;<br><br>   <span class="keyword" style="color: rgb(255, 128, 0);">RETURN</span> <span class="literal" style="color: rgb(128, 128, 128);">&#39;OK&#39;</span>;<br>

<br><span class="keyword" style="color: rgb(255, 128, 0);">END</span>;</pre></td></tr></tbody></table></td></tr></tbody></table></span></span><br class="Apple-interchange-newline">- Miroslav<br><br><div class="gmail_quote">

2011/3/25 Stephen Woodbridge <span dir="ltr">&lt;<a href="mailto:woodbri@swoodbridge.com">woodbri@swoodbridge.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">

network is a postgresql type so it must be quoted. So you can try doing:<div class="im"><br>
<br>
SELECT assign_vertex_id3d(’&quot;network&quot;’, 1, ’the_geom’, ’gid’, &#39;F_LEVEL&#39;, &#39;T_LEVEL&#39;);<br>
<br></div>
This might work, but in general you might have other issues with other stored procedures also.<br>
<br>
You could also try changing your table name like:<br>
<br>
alter table &quot;network&quot; rename to &quot;the_network&quot;;<br>
<br>
then reference it by the_network like:<br>
<br>
SELECT assign_vertex_id3d(’the_network’, 1, ’the_geom’, ’gid’, &#39;F_LEVEL&#39;, &#39;T_LEVEL&#39;);<br>
<br>
-Steve<div class="im"><br>
<br>
On 3/24/2011 6:32 PM, Miroslav Novta wrote:<br>
</div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">
Hello Dear,<br>
<br>
I have faced a problem with assign_vertex_id3d. It is a bit strange<br>
error message i have get. I have explored all code i suspect and have no<br>
clue. Error report is network is not a column, it is a table and it<br>
should be a table, i have no idea why it expect it to be a column.<br>
<br>
Here is error i get:<br>
<br>
ERROR:  column &quot;’network’&quot; does not exist<br>
LINE 1: SELECT assign_vertex_id3d(’network’, 1, ’the_geom’, ’gid’, &#39;...<br>
                                  ^<br>
<br>
In statement:<br>
SELECT assign_vertex_id3d(’network’, 1, ’the_geom’, ’gid’, &#39;F_LEVEL&#39;,<br>
&#39;T_LEVEL&#39;);<br>
<br>
To explain more, network is my ways table defined with iGO standard. I<br>
have added source and target columns according to guide<br>
<br>
-- Add &quot;source&quot; and &quot;target&quot; column<br>
ALTER TABLE &quot;network&quot; ADD COLUMN &quot;source&quot; integer;<br>
ALTER TABLE &quot;network&quot; ADD COLUMN &quot;target&quot; integer;<br>
<br>
Do you have any idea what is wrong? What have i missed?<br>
<br>
Regards,<br>
Miroslav<br>
<br>
2011/3/23 Stephen Woodbridge &lt;<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a><br></div><div><div></div><div class="h5">
&lt;mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>&gt;&gt;<br>
 &gt;<br>
 &gt; On 3/23/2011 10:23 AM, Miroslav Novta wrote:<br>
 &gt;&gt;<br>
 &gt;&gt; Steve,<br>
 &gt;&gt;<br>
 &gt;&gt; Thank you, I will follow your Instructions. I don&#39;t expect a lot of<br>
 &gt;&gt; problems with turn restrictions because maneuvers table is still empty<br>
 &gt;&gt; and will be filled after routing become functional.<br>
 &gt;&gt; I still have some baby problems to make pgRouting functional.<br>
 &gt;&gt;<br>
 &gt;&gt; For example what is correct range of tolerance if i use meters not<br>
 &gt;&gt; degrees in assign vertex?<br>
 &gt;<br>
 &gt; This depends on your data for example in degrees if you data has a<br>
resolution of 0.000001 then this is a good value to use.<br>
 &gt;<br>
 &gt; For meters, you might use 0.5 or 0.9, the best way to evaluate this<br>
is to look the the coordinates at the ends of to segments that should be<br>
connected. So:<br>
 &gt;    abs(Xa - Xb) &lt; tolerance<br>
 &gt; to match the two ends to the same node. If you set tolerance too big<br>
then it will merge close by nodes that should not be connected. If you<br>
set the tolerance too small it will not match nodes that should be<br>
connected. We use tolerance to deal with floating point numbers not<br>
being exact like integers and can have rounding errors in the numbers.<br>
 &gt;<br>
 &gt; -Steve<br>
 &gt;<br>
 &gt;&gt; Miroslav<br>
 &gt;&gt;<br>
 &gt;&gt; 2011/3/23 Stephen Woodbridge &lt;<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a><br>
&lt;mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>&gt;<br></div></div><div><div></div><div class="h5">
 &gt;&gt; &lt;mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a> &lt;mailto:<a href="mailto:woodbri@swoodbridge.com" target="_blank">woodbri@swoodbridge.com</a>&gt;&gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt;    Charles,<br>
 &gt;&gt;<br>
 &gt;&gt;    Thank you for posting that. I am glad I read the whole thread<br>
 &gt;&gt;    because I was just about to did up my old code and dust it off to<br>
 &gt;&gt;    post.  There is no need for that as your implementation accurately<br>
 &gt;&gt;    reflects mine.<br>
 &gt;&gt;<br>
 &gt;&gt;    Miroslav,<br>
 &gt;&gt;<br>
 &gt;&gt;    Regarding turn restrictions, you should search the archives for this<br>
 &gt;&gt;    as I have been fairly vocal about the limitations. To summarize:<br>
 &gt;&gt;<br>
 &gt;&gt;    1. turn restrictions only work with shooting star<br>
 &gt;&gt;    2. If you have multiple turn restrictions, I think you have to enter<br>
 &gt;&gt;    the related links multiple times, ie: once for each restriction<br>
 &gt;&gt;    3. IMHO, we need to rework the turn restrictions to make adding them<br>
 &gt;&gt;    more intuitive and easier<br>
 &gt;&gt;    4. before you try to implement a large number of them, I would<br>
 &gt;&gt;    verify that you can in fact add multiple turn restrictions in a<br>
 &gt;&gt;    trivial graph that is easy to verify if it works as expected,<br>
 &gt;&gt;    because it is my sense that this area has not been used to any great<br>
 &gt;&gt;    extent.<br>
 &gt;&gt;<br>
 &gt;&gt;    -Steve<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt;    On 3/23/2011 7:43 AM, Charles Galpin wrote:<br>
 &gt;&gt;<br>
 &gt;&gt;        Hi Miroslav<br>
 &gt;&gt;<br>
 &gt;&gt;        This is an implementation I have been using which I made after a<br>
 &gt;&gt;        discussion with Stephen on this subject. It is essentially an<br>
 &gt;&gt;        implementation of his ideas and works fine for me, but ymmv.<br>
 &gt;&gt;<br>
 &gt;&gt;        Otherwise search the email archives as I believe he posted<br>
his here<br>
 &gt;&gt;        at some point as well.<br>
 &gt;&gt;<br>
 &gt;&gt;        hth charles<br>
 &gt;&gt;<br>
 &gt;&gt;        On Mar 23, 2011, at 6:44 AM, Miroslav Novta wrote:<br>
 &gt;&gt;<br>
 &gt;&gt;            Hello list,<br>
 &gt;&gt;<br>
 &gt;&gt;            I want to use the assign_vertices_3d() function developed by<br>
 &gt;&gt;            Stephen Woodbridge. I want to use it for iGO shp map<br>
format with<br>
 &gt;&gt; &quot;turn restrictions&quot; too.<br>
 &gt;&gt;<br>
 &gt;&gt;            Is there source code and documentation available on any<br>
public<br>
 &gt;&gt;            repository I may access?<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt;        -- Function: assign_vertex_id3d(character varying, double<br>
precision,<br>
 &gt;&gt;        character varying, character varying, character varying,<br>
character<br>
 &gt;&gt;        varying)<br>
 &gt;&gt;<br>
 &gt;&gt;        -- DROP FUNCTION assign_vertex_id3d(character varying, double<br>
 &gt;&gt;        precision, character varying, character varying, character<br>
varying,<br>
 &gt;&gt;        character varying);<br>
 &gt;&gt;<br>
 &gt;&gt;        CREATE OR REPLACE FUNCTION assign_vertex_id3d(geom_table<br>
character<br>
 &gt;&gt;        varying, tolerance double precision, geo_cname character varying,<br>
 &gt;&gt;        gid_cname character varying, source_zlevel_cname character<br>
varying,<br>
 &gt;&gt;        target_zlevel_cname character varying) RETURNS character<br>
varying AS<br>
 &gt;&gt;        $BODY$ DECLARE _r record; source_id int; target_id int; srid<br>
 &gt;&gt;        integer; BEGIN<br>
 &gt;&gt;<br>
 &gt;&gt;        BEGIN DROP TABLE vertices_tmp; EXCEPTION WHEN UNDEFINED_TABLE<br>
THEN<br>
 &gt;&gt;        END;<br>
 &gt;&gt;<br>
 &gt;&gt;        EXECUTE &#39;CREATE TABLE vertices_tmp (id serial)&#39;;<br>
 &gt;&gt;<br>
 &gt;&gt;        --    FOR _r IN EXECUTE &#39;SELECT srid FROM geometry_columns WHERE<br>
 &gt;&gt;        f_table_name=&#39;&#39;&#39;|| quote_ident(geom_table)||&#39;&#39;&#39;;&#39; LOOP --<br>
  srid<br>
 &gt;&gt;        := _r.srid; --    END LOOP;<br>
 &gt;&gt;<br>
 &gt;&gt;        srid :=<br>
 &gt;&gt;<br>
  Find_SRID(&#39;public&#39;,quote_ident(geom_table),quote_ident(geo_cname));<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt;        EXECUTE &#39;SELECT addGeometryColumn(&#39;&#39;vertices_tmp&#39;&#39;, &#39;&#39;the_geom&#39;&#39;,<br>
 &gt;&gt; &#39;||srid||&#39;, &#39;&#39;POINT&#39;&#39;, 3)&#39;; CREATE INDEX vertices_tmp_idx ON<br>
 &gt;&gt;        vertices_tmp USING GIST (the_geom);<br>
 &gt;&gt;<br>
 &gt;&gt;        FOR _r IN EXECUTE &#39;SELECT &#39; || quote_ident(gid_cname) || &#39; AS<br>
 &gt;&gt;        id,&#39; ||<br>
 &gt;&gt; &#39; ST_MakePoint(ST_X(StartPoint(&#39;|| quote_ident(geo_cname) ||&#39;)),<br>
 &gt;&gt;        ST_Y(StartPoint(&#39;|| quote_ident(geo_cname) ||&#39;)), &#39;||<br>
 &gt;&gt;        quote_ident(source_zlevel_cname) ||&#39;) AS source,&#39; || &#39;<br>
 &gt;&gt;        ST_MakePoint(ST_X(EndPoint(&#39;|| quote_ident(geo_cname) ||&#39;)),<br>
 &gt;&gt;        ST_Y(EndPoint(&#39;|| quote_ident(geo_cname) ||&#39;)), &#39;||<br>
 &gt;&gt;        quote_ident(target_zlevel_cname) ||&#39;) AS target&#39; || &#39; FROM &#39; ||<br>
 &gt;&gt;        quote_ident(geom_table) LOOP<br>
 &gt;&gt;<br>
 &gt;&gt;        source_id := point_to_id3d(setsrid(_r.source, srid), tolerance);<br>
 &gt;&gt;        target_id := point_to_id3d(setsrid(_r.target, srid), tolerance);<br>
 &gt;&gt;<br>
 &gt;&gt;        EXECUTE &#39;update &#39; || quote_ident(geom_table) || &#39; SET source<br>
= &#39; ||<br>
 &gt;&gt;        source_id || &#39;, target = &#39; || target_id || &#39; WHERE &#39; ||<br>
 &gt;&gt;        quote_ident(gid_cname) || &#39; = &#39; || _<a href="http://r.id" target="_blank">r.id</a> &lt;<a href="http://r.id" target="_blank">http://r.id</a>&gt;<br>
&lt;<a href="http://r.id" target="_blank">http://r.id</a>&gt;; END LOOP;<br>
 &gt;&gt;<br>
 &gt;&gt;        RETURN &#39;OK&#39;;<br>
 &gt;&gt;<br>
 &gt;&gt;        END; $BODY$ LANGUAGE &#39;plpgsql&#39; VOLATILE STRICT COST 100; ALTER<br>
 &gt;&gt;        FUNCTION assign_vertex_id3d(character varying, double precision,<br>
 &gt;&gt;        character varying, character varying, character varying,<br>
character<br>
 &gt;&gt;        varying) OWNER TO postgres;<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt;        -- Function: point_to_id3d(geometry, double precision)<br>
 &gt;&gt;<br>
 &gt;&gt;        -- DROP FUNCTION point_to_id3d(geometry, double precision);<br>
 &gt;&gt;<br>
 &gt;&gt;        CREATE OR REPLACE FUNCTION point_to_id3d(p geometry, tolerance<br>
 &gt;&gt;        double<br>
 &gt;&gt;        precision) RETURNS bigint AS $BODY$<br>
 &gt;&gt;<br>
 &gt;&gt;        DECLARE _r record; _id bigint; _srid integer;<br>
 &gt;&gt;<br>
 &gt;&gt;        BEGIN<br>
 &gt;&gt;<br>
 &gt;&gt;        _srid := Find_SRID(&#39;public&#39;,&#39;vertices_tmp&#39;,&#39;the_geom&#39;);<br>
 &gt;&gt;<br>
 &gt;&gt;        SELECT ST_Length3D(ST_MakeLine(the_geom,p)) AS d, id<br>
 &gt;&gt;<br>
 &gt;&gt;        INTO _r FROM vertices_tmp WHERE<br>
 &gt;&gt;<br>
 &gt;&gt;        the_geom&amp;&amp;  Expand(p, tolerance) AND<br>
 &gt;&gt;        ST_Length3D(ST_MakeLine(the_geom,p))&lt;  tolerance<br>
 &gt;&gt;<br>
 &gt;&gt;        ORDER BY d LIMIT 1;<br>
 &gt;&gt;<br>
 &gt;&gt;        IF FOUND THEN<br>
 &gt;&gt;<br></div></div>
 &gt;&gt;        _id:= _<a href="http://r.id" target="_blank">r.id</a> &lt;<a href="http://r.id" target="_blank">http://r.id</a>&gt; &lt;<a href="http://r.id" target="_blank">http://r.id</a>&gt;;<div class="im"><br>
 &gt;&gt;<br>
 &gt;&gt;        ELSE<br>
 &gt;&gt;<br>
 &gt;&gt;        INSERT INTO vertices_tmp(the_geom) VALUES (SetSRID(p,_srid));<br>
 &gt;&gt;        _id:=lastval();<br>
 &gt;&gt;<br>
 &gt;&gt;        END IF;<br>
 &gt;&gt;<br>
 &gt;&gt;        RETURN _id;<br>
 &gt;&gt;<br>
 &gt;&gt;        END; $BODY$ LANGUAGE &#39;plpgsql&#39; VOLATILE STRICT COST 100; ALTER<br>
 &gt;&gt;        FUNCTION point_to_id3d(geometry, double precision) OWNER TO<br>
 &gt;&gt;        postgres;<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt;        _______________________________________________ Pgrouting-users<br>
 &gt;&gt;        mailing list <a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
&lt;mailto:<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>&gt;<br>
 &gt;&gt; &lt;mailto:<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
&lt;mailto:<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>&gt;&gt;<br>
 &gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt;    _______________________________________________<br>
 &gt;&gt;    Pgrouting-users mailing list<br>
 &gt;&gt; <a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
&lt;mailto:<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>&gt;<br>
&lt;mailto:<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a><br>
&lt;mailto:<a href="mailto:Pgrouting-users@lists.osgeo.org" target="_blank">Pgrouting-users@lists.osgeo.org</a>&gt;&gt;<br>
 &gt;&gt; <a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt;<br>
 &gt;&gt; --<br>
 &gt;&gt; Miroslav Novta<br>
 &gt;<br>
<br>
<br>
<br>
--<br>
Miroslav Novta<br>
</div></blockquote>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Miroslav Novta<br>
</div>