<?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 Sort WE_SN Point Feature Class in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531131#M17690</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a point Feature Class I am trying to sort.&amp;nbsp; It contains both a "POINT_X" and a "POINT_Y" field.&amp;nbsp; I wish to start from lower left and sort WE_SN. I have a standard license and am therefore limited to a single sort field (excluding shape) while using sort_mgmt(). I therefore am looking to calculate new sort field using&amp;nbsp; "POINT_X" and "POINT_Y". Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 30 May 2014 15:44:41 GMT</pubDate>
    <dc:creator>NoahHuntington</dc:creator>
    <dc:date>2014-05-30T15:44:41Z</dc:date>
    <item>
      <title>Sort WE_SN Point Feature Class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531131#M17690</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a point Feature Class I am trying to sort.&amp;nbsp; It contains both a "POINT_X" and a "POINT_Y" field.&amp;nbsp; I wish to start from lower left and sort WE_SN. I have a standard license and am therefore limited to a single sort field (excluding shape) while using sort_mgmt(). I therefore am looking to calculate new sort field using&amp;nbsp; "POINT_X" and "POINT_Y". Any suggestions?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 15:44:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531131#M17690</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2014-05-30T15:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Sort WE_SN Point Feature Class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531132#M17691</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I have a point Feature Class I am trying to sort.&amp;nbsp; It contains both a "POINT_X" and a "POINT_Y" field.&amp;nbsp; I wish to start from lower left and sort WE_SN. I have a standard license and am therefore limited to a single sort field (excluding shape) while using sort_mgmt(). I therefore am looking to calculate new sort field using&amp;nbsp; "POINT_X" and "POINT_Y". Any suggestions?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You can concatenate the X and Y coodinates in a text field, but you need to ensure the numbers are a standard length and that the decimals align for both coordinates in the same character position.&amp;nbsp; I use a Python expression like this which assigns leading and trailing zeros to maintain character positions for each coordinate for extracting State Plane Coordinates from the points:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Parser: Python&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Use Codeblock: checked&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Pre-Logic Script Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;def Output(FirstPoint): &amp;nbsp; FPX = round(float(FirstPoint.X), 4) &amp;nbsp; FPY = round(float(FirstPoint.Y), 4) &amp;nbsp; return "{%(FX)012.4f}{%(FY)012.4f}" % {'FX': FPX, 'FY': FPY}&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Expression: Output(!Shape.FirstPoint!)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A sample set of output coordinates in sorted order would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{6708902.3000}{2298340.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{6708902.3000}{2298640.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{6708982.3000}{2298340.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{6708982.3000}{2298440.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{6708982.3000}{2308440.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{6709002.3000}{2298340.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Every east west position coordinate takes sort priority over the north south coordinates.&amp;nbsp; This will not sort diagonally from the SW corner to the NE corner.&amp;nbsp; Instead, for a given east/west position it gets all south to north ordered positions and then moves east to the next east/west position and gets all south to north points in order at that location, etc.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This field can act as a Join field for an attribute Join in place of a Spatial Join.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Reversing the coordinate order would moves slowly from South to North with every west to east position subsorted before moving to the next position proceeding northerly in an ascending sort.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To do a diagonal sort based on closest distance to the SW corner, you would have to get the minimum X and Y coordinate of all your points to act as a corner position and then do a euclidean distance calculation of length as a third concatenated value in front of the X Y coordinate values.&amp;nbsp; The length would also have to be decimal aligned for every value with leading and trailing zeros.&amp;nbsp; This would result in a sort that fans out from the SW corner.&amp;nbsp; So for the sample points this sort order would be:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;{00000.0000}{6708902.3000}{2298340.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{00080.0000}{6708982.3000}{2298340.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{00100.0000}{6709002.3000}{2298340.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{00128.0625}{6708982.3000}{2298440.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{00300.0000}{6708902.3000}{2298640.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{10100.3200}{6708982.3000}{2308440.4500}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A Geographic or Arithmetic angle from the SW corner to each point could be calculated and concatenated at the beginning of the string with decimal alignment.&amp;nbsp; This would cause a radar sweep sort that goes clockwise from northwest to southeast or counterclockwise southwest to northeast from the SW corner.&amp;nbsp; With compliments of the angles or artificial adjustments of the origin axis for the angle of the sweep you could vary the sweep pattern.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 30 May 2014 16:13:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531132#M17691</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2014-05-30T16:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Sort WE_SN Point Feature Class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531133#M17692</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Richard!,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Although I am quite sure you have answered my question already. I am a little unsure about implementing this in a stand alone script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Can you help?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
def Output(FirstPoint):
&amp;nbsp; FPX = round(float(FirstPoint.X), 4)
&amp;nbsp; FPY = round(float(FirstPoint.Y), 4)
&amp;nbsp; return "{%(FX)012.4f}{%(FY)012.4f}" % {'FX': FPX, 'FY': FPY}

def get_LCP(fc):
&amp;nbsp;&amp;nbsp;&amp;nbsp; return os.path.join(results + '\\Simplified_' + fc)

def main():

&amp;nbsp;&amp;nbsp;&amp;nbsp; points = results + '\\pts'
&amp;nbsp;&amp;nbsp;&amp;nbsp; # Process: Find all stream crossings (points)
&amp;nbsp;&amp;nbsp;&amp;nbsp; #arcpy.Intersect_analysis(lines,'G:\Xcel\Route Tool\Southwest\Results.gdb\pts',"ONLY_FID","#","POINT")

&amp;nbsp;&amp;nbsp;&amp;nbsp; in_features = "'" + lines + "'" + " #"

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Intersect_analysis(in_features,\
&amp;nbsp;&amp;nbsp;&amp;nbsp; out_feature_class="G:/Xcel/Route Tool/Southwest/Scratch.gdb/lines_clip_Intersect",\
&amp;nbsp;&amp;nbsp;&amp;nbsp; join_attributes="ONLY_FID",cluster_tolerance="#",output_type="POINT")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Adds x and y field to points
&amp;nbsp;&amp;nbsp;&amp;nbsp; pts_geometry = arcpy.AddXY_management("G:/Xcel/Route Tool/Southwest/Scratch.gdb/lines_clip_Intersect")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # Dissolves duplicate points
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.Dissolve_management(pts_geometry,"pts_dissolve","POINT_X;POINT_Y","#","SINGLE_PART","DISSOLVE_LINES")

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management("pts_dissolve","Sort","TEXT")

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("pts_dissolve","Sort", Output(Shape.FirstPoint),"PYTHON_9.3")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:07:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531133#M17692</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2021-12-11T23:07:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sort WE_SN Point Feature Class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531134#M17693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks Richard!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I got this to work using the first process you described.&amp;nbsp; I would be curoius to see a function used to calculate that euclidean field?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is what worked for me.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management("pts_dissolve","Sort","TEXT", 50)

&amp;nbsp;&amp;nbsp;&amp;nbsp; Expression = "Output(!Shape.FirstPoint!)"
&amp;nbsp;&amp;nbsp;&amp;nbsp; codeblock = """def Output(FirstPoint):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPX = round(float(FirstPoint.X), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPY = round(float(FirstPoint.Y), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "{%(FX)012.4f}{%(FY)012.4f}" % {'FX': FPX, 'FY': FPY}"""

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("pts_dissolve","Sort", Expression,"PYTHON_9.3",codeblock)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:07:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531134#M17693</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2021-12-11T23:07:34Z</dc:date>
    </item>
    <item>
      <title>Re: Sort WE_SN Point Feature Class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531135#M17694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thanks Richard!&lt;BR /&gt;&lt;BR /&gt;I got this to work using the first process you described.&amp;nbsp; I would be curoius to see a function used to calculate that euclidean field?&lt;BR /&gt;&lt;BR /&gt;Here is what worked for me.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management("pts_dissolve","Sort","TEXT", 50)

&amp;nbsp;&amp;nbsp;&amp;nbsp; Expression = "Output(!Shape.FirstPoint!)"
&amp;nbsp;&amp;nbsp;&amp;nbsp; codeblock = """def Output(FirstPoint):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPX = round(float(FirstPoint.X), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPY = round(float(FirstPoint.Y), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "{%(FX)012.4f}{%(FY)012.4f}" % {'FX': FPX, 'FY': FPY}"""

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("pts_dissolve","Sort", Expression,"PYTHON_9.3",codeblock)&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;This should work if you substitute my example hard coded Minimum X and Y coordinates with the hard coded values that make sense for your points (or values gathered from Summary Statistics):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management("pts_dissolve","Sort","TEXT", 50)

&amp;nbsp;&amp;nbsp;&amp;nbsp; Expression = "Output(!Shape.FirstPoint!, 6708902.3000, 2298340.4500)"
&amp;nbsp;&amp;nbsp;&amp;nbsp; codeblock = """def Output(FirstPoint, MinX, MinY):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDif = round(float(FirstPoint.X), 4) - round(float(MinX), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YDif = round(float(FirstPoint.Y), 4) - round(float(MinY), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length = hypot(XDif, YDif)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPX = round(float(FirstPoint.X), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPY = round(float(FirstPoint.Y), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "{%(LEN)012.4f}{%(FX)012.4f}{%(FY)012.4f}" % {'LEN':Length, 'FX': FPX, 'FY': FPY}"""

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("pts_dissolve","Sort", Expression,"PYTHON_9.3",codeblock)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:07:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531135#M17694</guid>
      <dc:creator>RichardFairhurst</dc:creator>
      <dc:date>2021-12-11T23:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: Sort WE_SN Point Feature Class</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531136#M17695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks a million Richard!&amp;nbsp; This did exactly what I'd hoped. I used the distance method to add some error handling for SE/NW lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Expression1 = "Output(!Shape.FirstPoint!, {0},{1})" .format(minX, minY)
&amp;nbsp;&amp;nbsp;&amp;nbsp; Expression2 = "Output(!Shape.FirstPoint!, {0},{1})" .format(maxX, minY)

&amp;nbsp;&amp;nbsp;&amp;nbsp; codeblock1 = """def Output(FirstPoint, MinX, MinY):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDif = round(float(FirstPoint.X), 4) - round(float(MinX), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YDif = round(float(FirstPoint.Y), 4) - round(float(MinY), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length = math.hypot(XDif, YDif)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPX = round(float(FirstPoint.X), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPY = round(float(FirstPoint.Y), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "{%(LEN)012.4f}{%(FX)012.4f}{%(FY)012.4f}" % {'LEN':Length, 'FX': FPX, 'FY': FPY}"""

&amp;nbsp;&amp;nbsp;&amp;nbsp; codeblock2 =&amp;nbsp; """def Output(FirstPoint, MaxX, MinY):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; XDif = round(float(FirstPoint.X), 4) - round(float(MaxX), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; YDif = round(float(FirstPoint.Y), 4) - round(float(MinY), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Length = math.hypot(XDif, YDif)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPX = round(float(FirstPoint.X), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FPY = round(float(FirstPoint.Y), 4)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; return "{%(LEN)012.4f}{%(FX)012.4f}{%(FY)012.4f}" % {'LEN':Length, 'FX': FPX, 'FY': FPY}"""

&amp;nbsp;&amp;nbsp;&amp;nbsp; if bearing &amp;gt; 180 and bearing &amp;lt; 270:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("pts_dissolve","Sort", Expression,"PYTHON_9.3",codeblock)
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif bearing &amp;gt; 0 and bearing &amp;lt; 90:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("pts_dissolve","Sort", Expression,"PYTHON_9.3",codeblock)
&amp;nbsp;&amp;nbsp;&amp;nbsp; elif bearing &amp;gt; 90 and bearing &amp;lt; 180:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("pts_dissolve","Sort", Expression2,"PYTHON_9.3",codeblock2)
&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CalculateField_management("pts_dissolve","Sort", Expression2,"PYTHON_9.3",codeblock2)
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 23:07:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/sort-we-sn-point-feature-class/m-p/531136#M17695</guid>
      <dc:creator>NoahHuntington</dc:creator>
      <dc:date>2021-12-11T23:07:40Z</dc:date>
    </item>
  </channel>
</rss>

