<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Thank You for your Reply,<br><br>But I know What is the problem when i had see the<span style="background-color: rgb(255, 255, 255);"> <span style="color: rgb(255, 0, 0);">assign_vertex_id</span></span> function in that there is one for loop for taking <span style="color: rgb(255, 0, 0);">srid </span>value from input <span style="color: rgb(255, 0, 0);">geom_table</span> at that point only Error is occurring so i had statically assign the <span style="color: rgb(255, 0, 0);">srid := 4326</span> (my Spatial table projection) the function works perfectly.<br><br>But you can help to understand what is the problem in that "for loop"<br><br>I am sending the function body to you in that i had highlighted the code where error is occurring (See Below) :- <br><br><br>CREATE OR REPLACE FUNCTION assign_vertex_id(geom_table character varying, tolerance double precision,
geo_cname character varying, gid_cname character varying)<br> RETURNS character varying AS<br>$BODY$<br>DECLARE<br> _r record;<br> source_id int;<br> target_id int;<br> srid integer;<br>BEGIN<br><br> BEGIN<br> DROP TABLE vertices_tmp;<br> EXCEPTION <br> WHEN UNDEFINED_TABLE THEN<br> END;<br><br> EXECUTE 'CREATE TABLE vertices_tmp (id serial)';<br><br> <span style="color: rgb(255, 0, 0);">-- FOR _r IN EXECUTE 'SELECT srid(geometry_columns) from '''|| quote_ident(geom_table)||''';' LOOP</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">-- srid := _r.srid;</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"> --END LOOP;</span><br style="color: rgb(255, 0, 0);"><span
style="color: rgb(255, 0, 0);"> srid := 4326;</span><br><br> EXECUTE 'SELECT addGeometryColumn(''vertices_tmp'', ''the_geom'', '||srid||', ''POINT'', 2)';<br> CREATE INDEX vertices_tmp_idx ON vertices_tmp USING GIST (the_geom);<br> <br> FOR _r IN EXECUTE 'SELECT ' || quote_ident(gid_cname) || ' AS id,'<br> || ' StartPoint('|| quote_ident(geo_cname) ||') AS source,'<br> || ' EndPoint('|| quote_ident(geo_cname) ||') as target'<br> || ' FROM ' || quote_ident(geom_table) <br> LOOP<br> <br> source_id := point_to_id(setsrid(_r.source, srid), tolerance);<br> target_id :=
point_to_id(setsrid(_r.target, srid), tolerance);<br> <br> EXECUTE 'update ' || quote_ident(geom_table) || <br> ' SET source = ' || source_id || <br> ', target = ' || target_id || <br> ' WHERE ' || quote_ident(gid_cname) || ' = ' || _r.id;<br> END LOOP;<br><br> RETURN 'OK';<br><br>END;<br>$BODY$<br> LANGUAGE 'plpgsql' VOLATILE STRICT<br> COST 100;<br>ALTER FUNCTION assign_vertex_id(character varying, double precision, character varying, c<br><br style="color: rgb(255, 0, 0);"><br><div><font color="#7f3f00" face="comic sans ms"><strong><em><u>PIYUSH M SHAH<img
src="http://us.i1.yimg.com/us.yimg.com/i/mesg/tsmileys2/23.gif"></u></em></strong></font></div><br><br>--- On <b>Tue, 15/2/11, Daniel Kastl <i><daniel@georepublic.de></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Daniel Kastl <daniel@georepublic.de><br>Subject: Re: [pgrouting-users] Cannot Create a Network Nodes network nodes<br>To: "pgRouting users mailing list" <pgrouting-users@lists.osgeo.org><br>Date: Tuesday, 15 February, 2011, 3:06 PM<br><br><div id="yiv2005736080">How does your network table look like?<div>Did you make sure that column names match and also the data types?</div><div><br></div><div>Daniel</div><div><br></div><div><br><br><div class="yiv2005736080gmail_quote">2011/2/15 Piyush Shah <span dir="ltr"><<a rel="nofollow" ymailto="mailto:piyush_shah@ymail.com" target="_blank"
href="/mc/compose?to=piyush_shah@ymail.com">piyush_shah@ymail.com</a>></span><br>
<blockquote class="yiv2005736080gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font: inherit;" valign="top">I am new to pgroutine so ineed some help <br>
<br>i am using PostgreSql 8.4 , Postgis 1.5.1, pgRouting-1.03_pg-8.4.2<br><br>But when i trying to create network node through assign_vertex_id<br><br>"SELECT assign_vertex_id ('India_highway', 0.00001, 'the_geom', 'gid');"<br>
<br>it gives following ERROR<br><br><span style="color: rgb(255, 0, 0);">[WARNING ] SELECT assign_vertex_id ('India_highway', 0.00001, 'the_geom', 'gid')</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"> NOTICE: CREATE TABLE will create implicit sequence "vertices_tmp_id_seq" for serial column "<a rel="nofollow" target="_blank" href="http://vertices_tmp.id">vertices_tmp.id</a>"</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);"> CONTEXT: SQL
statement "CREATE TABLE vertices_tmp (id serial)"</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"> PL/pgSQL function "assign_vertex_id" line 14 at EXECUTE statement</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);"> ERROR: query string argument of EXECUTE is null</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"> CONTEXT: PL/pgSQL function "assign_vertex_id" line 20 at EXECUTE statement</span><br>
<br><br>so please help me what is the problem<br><br><div><font color="#7f3f00" face="comic sans ms"><strong><em><u>PIYUSH M SHAH<img></u></em></strong></font></div></td></tr></tbody></table><br><br>_______________________________________________<br>
Pgrouting-users mailing list<br>
<a rel="nofollow" ymailto="mailto:Pgrouting-users@lists.osgeo.org" target="_blank" href="/mc/compose?to=Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br>
<a rel="nofollow" target="_blank" href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br><span style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;">Georepublic UG & Georepublic Japan<br>eMail: <a rel="nofollow" ymailto="mailto:daniel.kastl@georepublic.de" target="_blank" href="/mc/compose?to=daniel.kastl@georepublic.de" style="color: rgb(66, 99, 171);">daniel.kastl@georepublic.de</a><br>
Web: <a rel="nofollow" target="_blank" href="http://georepublic.de/" style="color: rgb(66, 99, 171);">http://georepublic.de</a></span><br>
</div>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>Pgrouting-users mailing list<br><a ymailto="mailto:Pgrouting-users@lists.osgeo.org" href="/mc/compose?to=Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br></div></blockquote></td></tr></table><br>