<div dir="ltr"><div dir="ltr">It will be nice to know how to skip when error, and carry on.<div><br></div><div>Python can do this.   <a href="https://stackoverflow.com/questions/47035878/python-try-except-multiple-values-in-loop-and-skip-current-iteration-if-any-exce?msclkid=45dbd97ccee111ecacdcfd81b359a361">Python try-except multiple values in loop and skip current iteration if any exceptions raised - Stack Overflow</a></div><div><br></div><div>At the moment, I have to do </div><div><br></div><div>if (c !~ '^28$') then<br></div><div><br></div><div>just to skip over 1 iteration.</div><div><br></div><div>Regards,</div><div><br></div><div>David</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 8 May 2022 at 03:19, Imre Samu <<a href="mailto:pella.samu@gmail.com">pella.samu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">> I am thinking of generating startnode and endnode values by using St_startpoint(geom) and ST_endpoint(geom),<br>> Is this feasible?<div><br>if your input data is “noded” correctly - then YES ...<br></div><div>“noded” network =  at every intersection in your road/water network all the edges will be broken into separate road/water segments.<br></div><div>And you have to assign the same "node id" for the same physical points.  ( ST_DWithin magic )<br><br></div><div>be careful:  The "Network Walking" example was a nodded network ( without an intersection! )</div><div>maybe you can test the <a href="https://postgis.net/docs/CreateTopology.html" target="_blank">https://postgis.net/docs/CreateTopology.html</a> function also; <br></div><div><br></div><div>Imre</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Shaozhong SHI <<a href="mailto:shishaozhong@gmail.com" target="_blank">shishaozhong@gmail.com</a>> ezt írta (időpont: 2022. máj. 8., V, 3:38):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Testing shows that using startnode and endnode of id values of a line does lead to a fast completion of processing.<div>However, at the moment, I am not sure whether these startnode (id values) and endnode (id values) are correct.</div><div><br></div><div>I am thinking of generating startnode and endnode values by using St_startpoint(geom) and ST_endpoint(geom),</div><div><br></div><div>And then try out your alternative method for recursive query to see whether walk the network works.</div><div><br></div><div>Is this feasible?</div><div><br></div><div>Regards,</div><div><br></div><div>David</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, 8 May 2022 at 00:59, Imre Samu <<a href="mailto:pella.samu@gmail.com" target="_blank">pella.samu@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi David,</div><div>> There is a loop of recursive query.  It runs at a point where it stops.</div><div>>Can anyone provide pointers how to solve this problem or work around?<br></div><div><br></div><div>Please share "this" recursive query;</div><div><br></div><div>My guess:  Probably you have a "forever/endless loop" in your data; <b><font color="#0000ff">so you have to LIMIT the recursive part ;</font></b></div><div><br></div><div>related links :</div><div>1.)  with limiting "<span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit">depth</span><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">"   ( </span><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">where</span><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit"> depth </span><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit"><</span><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant-ligatures:inherit;font-variant-caps:inherit;font-weight:inherit;white-space:inherit"> </span><span style="background-color:transparent;font-family:inherit;font-style:inherit;font-variant:inherit;font-weight:inherit;white-space:inherit;margin:0px;padding:0px;border:0px;font-stretch:inherit;line-height:inherit;font-size:13px;vertical-align:baseline;box-sizing:inherit">1000 )</span></div><div>"Prevent infinite loop in recursive query in Postgresql"</div><div><a href="https://stackoverflow.com/questions/51025607/prevent-infinite-loop-in-recursive-query-in-postgresql" target="_blank">https://stackoverflow.com/questions/51025607/prevent-infinite-loop-in-recursive-query-in-postgresql</a><br></div><div>2.)  with LIMITING clause</div><div><a href="https://www.cybertec-postgresql.com/en/recursive-queries-postgresql/" target="_blank">https://www.cybertec-postgresql.com/en/recursive-queries-postgresql/</a> <br></div><i>"This example also demonstrates how <font color="#0000ff">an endless loop can be avoided with a LIMIT clause </font>on the parent query."</i><div><br></div><div>Regards,</div><div>  Imre</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Shaozhong SHI <<a href="mailto:shishaozhong@gmail.com" target="_blank">shishaozhong@gmail.com</a>> ezt írta (időpont: 2022. máj. 7., Szo, 15:23):<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr">There is a loop of recursive query.  It runs at a point where it stops.<div><br></div><div>This error turned up.- ERROR:  invalid memory alloc request size 1073741824</div><div><br></div><div>Can anyone provide pointers how to solve this problem or work around?</div><div><br></div><div>Regards,</div><div><br></div><div>David</div></div></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div>
_______________________________________________<br>
postgis-users mailing list<br>
<a href="mailto:postgis-users@lists.osgeo.org" target="_blank">postgis-users@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/postgis-users" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/postgis-users</a><br>
</blockquote></div>