<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: U-turn policy question in Railways Questions</title>
    <link>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627419#M64</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Thomas!&amp;nbsp; I've been discussing this issue with colleagues.&amp;nbsp; We came up with a solution we think might work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Make all of the junctions you want to ALLOW u-turns as user-defined junctions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can select that set of system junctions, export it as a feature class in the same feature dataset as your network, then add it as a source to your network.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Add a descriptor attribute to your network called something like uturn_restricted_at_junction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a. Set the descriptor to boolean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b. Set the default junction evaluator value to a constant of true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c. Set the source junction evaluator value for your user junctions to a constant of false&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Make a restriction attribute on your network called something like restricted_uturns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a. Set the type to boolean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b. On the default evaluator for turns, set it to script and add this python script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the pre-logic script code, put:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def SetValue():&lt;/P&gt;&lt;P&gt;&amp;nbsp; is_restricted = False&lt;/P&gt;&lt;P&gt;&amp;nbsp; if fromEdge.EID == toEdge.EID:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; is_restricted = atJunction.AttributeValueByName( "uturn_restricted_at_junction" )&lt;/P&gt;&lt;P&gt;&amp;nbsp; return is_restricted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the value = part, put:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SetValue()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Make sure you already have a turn feature class in your network.&amp;nbsp; For my toy network, I added an empty one.&amp;nbsp; Seems like a turn source is required to get this to work, even if there is nothing in the source feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, test that it works!&amp;nbsp; I tried this on a toy network and it worked.&amp;nbsp; Uturns at my user junctions were allowed and uturns at my system junctions were not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can test it by adding a stop near a test junction on the right side on the edge.&amp;nbsp; Set the curbapproach for the stop to right.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, add a second stop farther away from the test junction, so that the route has to leave stop1 towards the junction and the quickest route would be a uturn at the test junction back to stop2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope all of this makes sense.&amp;nbsp; Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 31 Jul 2015 16:09:22 GMT</pubDate>
    <dc:creator>PatrickStevens</dc:creator>
    <dc:date>2015-07-31T16:09:22Z</dc:date>
    <item>
      <title>U-turn policy question</title>
      <link>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627416#M61</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to model u-turns on a railway. I know how to do this by using u-turn restrictions at each node. However, this is going to be a superman type feat and it would be much easier if I could turn off u-turns altogether and model a feature to allow a u-turn instead of restrict it. Is there a way to do this in a network dataset?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 18:40:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627416#M61</guid>
      <dc:creator>thomasbales</dc:creator>
      <dc:date>2015-07-30T18:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: U-turn policy question</title>
      <link>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627417#M62</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can just set the U-Turn policy of your Network Analysis layer to "Not Allowed".&amp;nbsp; This is an NA layer setting rather than something you build into your network dataset.&lt;/P&gt;&lt;P&gt;&lt;A href="http://desktop.arcgis.com/en/desktop/latest/guide-books/extensions/network-analyst/u-turn-policies.htm" title="http://desktop.arcgis.com/en/desktop/latest/guide-books/extensions/network-analyst/u-turn-policies.htm"&gt;U-turn policies—Help | ArcGIS for Desktop&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 19:30:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627417#M62</guid>
      <dc:creator>MelindaMorang</dc:creator>
      <dc:date>2015-07-30T19:30:35Z</dc:date>
    </item>
    <item>
      <title>Re: U-turn policy question</title>
      <link>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627418#M63</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for such a quick response, I may have not been clear. I have thousands of miles of track and a few thousand nodes. Most of these nodes (dead ends and intersections) must not allow u-turns, but I have about a hundred or so that should allow a u-turn. Basically a Y in the rail system. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So if I turn &lt;STRONG&gt;&lt;EM&gt;on&lt;/EM&gt;&lt;/STRONG&gt; the policy I am going to have to model a few thousand U-turn restrictions. Is there a reverse operation where I can turn off the U-turn policy and only model the U-turn exceptions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Again, thanks for your response, I know I am missing something simple.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Jul 2015 19:39:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627418#M63</guid>
      <dc:creator>thomasbales</dc:creator>
      <dc:date>2015-07-30T19:39:06Z</dc:date>
    </item>
    <item>
      <title>Re: U-turn policy question</title>
      <link>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627419#M64</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, Thomas!&amp;nbsp; I've been discussing this issue with colleagues.&amp;nbsp; We came up with a solution we think might work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; Make all of the junctions you want to ALLOW u-turns as user-defined junctions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can select that set of system junctions, export it as a feature class in the same feature dataset as your network, then add it as a source to your network.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Add a descriptor attribute to your network called something like uturn_restricted_at_junction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a. Set the descriptor to boolean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b. Set the default junction evaluator value to a constant of true&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; c. Set the source junction evaluator value for your user junctions to a constant of false&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Make a restriction attribute on your network called something like restricted_uturns&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; a. Set the type to boolean&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b. On the default evaluator for turns, set it to script and add this python script:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the pre-logic script code, put:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;def SetValue():&lt;/P&gt;&lt;P&gt;&amp;nbsp; is_restricted = False&lt;/P&gt;&lt;P&gt;&amp;nbsp; if fromEdge.EID == toEdge.EID:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; is_restricted = atJunction.AttributeValueByName( "uturn_restricted_at_junction" )&lt;/P&gt;&lt;P&gt;&amp;nbsp; return is_restricted&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if the value = part, put:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SetValue()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4. Make sure you already have a turn feature class in your network.&amp;nbsp; For my toy network, I added an empty one.&amp;nbsp; Seems like a turn source is required to get this to work, even if there is nothing in the source feature class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, test that it works!&amp;nbsp; I tried this on a toy network and it worked.&amp;nbsp; Uturns at my user junctions were allowed and uturns at my system junctions were not allowed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can test it by adding a stop near a test junction on the right side on the edge.&amp;nbsp; Set the curbapproach for the stop to right.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then, add a second stop farther away from the test junction, so that the route has to leave stop1 towards the junction and the quickest route would be a uturn at the test junction back to stop2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope all of this makes sense.&amp;nbsp; Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 16:09:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627419#M64</guid>
      <dc:creator>PatrickStevens</dc:creator>
      <dc:date>2015-07-31T16:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: U-turn policy question</title>
      <link>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627420#M65</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your help Patrick,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think I understand how to accomplish this, But it would be easier if I could have look at your test network. Would it be possible for you zip it and ship it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all the time and effort you and your colleagues put into this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 17:52:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627420#M65</guid>
      <dc:creator>thomasbales</dc:creator>
      <dc:date>2015-07-31T17:52:06Z</dc:date>
    </item>
    <item>
      <title>Re: U-turn policy question</title>
      <link>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627421#M66</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sure, I'd be happy to send it along.&amp;nbsp; Unfortunately, I can't figure out how to post a zip or 7z here to the forums.&amp;nbsp; Could you email me and I'll send it?&amp;nbsp; As a 7z, it is only 22 KB.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My email is pstevens at esri.com.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried to use GeoNet's upload file option, but it gives me the less-than-helpful message, "&lt;SPAN style="color: #c20000; font-family: arial, helvetica, 'helvetica neue', verdana, sans-serif; font-weight: bold;"&gt;You are not allowed to create or update this content".&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 18:08:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627421#M66</guid>
      <dc:creator>PatrickStevens</dc:creator>
      <dc:date>2015-07-31T18:08:38Z</dc:date>
    </item>
    <item>
      <title>Re: U-turn policy question</title>
      <link>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627422#M67</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Patrick, my email is thomas.i.bales@loram.com&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thomas Bales&lt;/P&gt;&lt;P&gt;GIS Analyst&lt;/P&gt;&lt;P&gt;Loram Maintenance of Way, Inc.&lt;/P&gt;&lt;P&gt;3900 Arrowhead Drive&lt;/P&gt;&lt;P&gt;Hamel, Minnesota 55340&lt;/P&gt;&lt;P&gt;763-478-5965&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 Jul 2015 22:46:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627422#M67</guid>
      <dc:creator>thomasbales</dc:creator>
      <dc:date>2015-07-31T22:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: U-turn policy question</title>
      <link>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627423#M68</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Worked perfectly, thanks Patrick.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 03 Aug 2015 14:52:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/railways-questions/u-turn-policy-question/m-p/627423#M68</guid>
      <dc:creator>thomasbales</dc:creator>
      <dc:date>2015-08-03T14:52:24Z</dc:date>
    </item>
  </channel>
</rss>

