<?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 Method of moving-window smoothing in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/method-of-moving-window-smoothing/m-p/568951#M44573</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to implement the moving window smoothing. The data I have is GPS points (includes, x, y, direction) stored in a point feature class"Section11_SplitedTrips".&amp;nbsp; Please feel free to comment on my steps. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A 4m circle is placed on each GPS point, whose location will be changed to the average location of all the GPS points covered by the circle after the smoothing process. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if a GPS point does not have any other point within a searchRadius of 4m it will remain. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Plan is : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Step 1: use arcpy.GenerateNearTable_analysis(fc,fc,output,searchRadius,local,angl,closest) to find near pts around every point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Step 2: Modification of the moving-window smoothing by classifying points into two opposite directional groups. In a moving window (creating 4m-radius circle for each point, e.g. si), for example, there are m (6) points within the range of 8m. The pesudocode is: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Count m
Assign num of searching point (n = m-1)
Create two arrays, C1 &amp;amp; C2
Assign P0 in C1
for Pi in range (n):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cos(dirP0 ??? dirPn-i)&amp;gt;0
&amp;nbsp; append Pn-i in C1 
&amp;nbsp; else if cos(dirP0 ??? dirPn-i) &amp;lt; 0
&amp;nbsp; append Pn-i in C2
 else 
&amp;nbsp; cos(dirP0 ??? dirPn-i) = 0
if Si&amp;nbsp; in C1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calculated centroid and average direction of C1 and then assign them to point Si 
else 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calculated centroid and average direction of C2 and then assign them to point Si
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Step3: the location of each GPS point may be changed to the average location of all the GPS points covered by its circle. and its direction also be changed to the average direction.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 07 Mar 2012 17:44:59 GMT</pubDate>
    <dc:creator>zhengniu1</dc:creator>
    <dc:date>2012-03-07T17:44:59Z</dc:date>
    <item>
      <title>Method of moving-window smoothing</title>
      <link>https://community.esri.com/t5/python-questions/method-of-moving-window-smoothing/m-p/568951#M44573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi, all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am trying to implement the moving window smoothing. The data I have is GPS points (includes, x, y, direction) stored in a point feature class"Section11_SplitedTrips".&amp;nbsp; Please feel free to comment on my steps. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I want:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A 4m circle is placed on each GPS point, whose location will be changed to the average location of all the GPS points covered by the circle after the smoothing process. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;if a GPS point does not have any other point within a searchRadius of 4m it will remain. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My Plan is : &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Step 1: use arcpy.GenerateNearTable_analysis(fc,fc,output,searchRadius,local,angl,closest) to find near pts around every point.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Step 2: Modification of the moving-window smoothing by classifying points into two opposite directional groups. In a moving window (creating 4m-radius circle for each point, e.g. si), for example, there are m (6) points within the range of 8m. The pesudocode is: &lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Count m
Assign num of searching point (n = m-1)
Create two arrays, C1 &amp;amp; C2
Assign P0 in C1
for Pi in range (n):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if cos(dirP0 ??? dirPn-i)&amp;gt;0
&amp;nbsp; append Pn-i in C1 
&amp;nbsp; else if cos(dirP0 ??? dirPn-i) &amp;lt; 0
&amp;nbsp; append Pn-i in C2
 else 
&amp;nbsp; cos(dirP0 ??? dirPn-i) = 0
if Si&amp;nbsp; in C1
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calculated centroid and average direction of C1 and then assign them to point Si 
else 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; calculated centroid and average direction of C2 and then assign them to point Si
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Step3: the location of each GPS point may be changed to the average location of all the GPS points covered by its circle. and its direction also be changed to the average direction.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 07 Mar 2012 17:44:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/method-of-moving-window-smoothing/m-p/568951#M44573</guid>
      <dc:creator>zhengniu1</dc:creator>
      <dc:date>2012-03-07T17:44:59Z</dc:date>
    </item>
  </channel>
</rss>

