<?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: calculate central point feature within each grid cell.? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319130#M24807</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1.) &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Spatial_Join/00080000000q000000/"&gt;Spatial Join&lt;/A&gt;&lt;SPAN&gt; to assign grid ID to points&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//005p00000018000000"&gt;Mean Center&lt;/A&gt;&lt;SPAN&gt; (case = grid ID)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Feb 2014 18:32:25 GMT</pubDate>
    <dc:creator>DarrenWiens2</dc:creator>
    <dc:date>2014-02-06T18:32:25Z</dc:date>
    <item>
      <title>calculate central point feature within each grid cell.?</title>
      <link>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319125#M24802</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have points scattered over grid cell (fishnet), would like to calculate a central point for each cell. How do I do it simpler way in python? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 14:39:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319125#M24802</guid>
      <dc:creator>YamMagar</dc:creator>
      <dc:date>2014-02-06T14:39:53Z</dc:date>
    </item>
    <item>
      <title>Re: calculate central point feature within each grid cell.?</title>
      <link>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319126#M24803</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Milan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What format is your grid (fishnet) in? Polygons? Raster? Polylines?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If your grid is a series of separate polygons you can check out the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00170000003m000000" rel="nofollow noopener noreferrer" target="_blank"&gt;Feature To Point&lt;/A&gt;&lt;SPAN&gt; tool. This tool can be used in python, model builder or run manually.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Python:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
import arcpy
inFC=r"C:\Path\To\Grid.shp"
outFC=r"C:\Path\To\NewPoints.shp"
arcpy.FeatureToPoint_management(inFC,outFC)
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know how it goes!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;~Josh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:10:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319126#M24803</guid>
      <dc:creator>JoshuaChisholm</dc:creator>
      <dc:date>2021-12-11T15:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: calculate central point feature within each grid cell.?</title>
      <link>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319127#M24804</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Josh,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks for your tips. Looks like it creates a centroid, but I am expecting a mean point for each cell out of multiple points within a cell. Fishnet is a polygon (vector). Thanks.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; [ATTACH=CONFIG]31182[/ATTACH]&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 15:30:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319127#M24804</guid>
      <dc:creator>YamMagar</dc:creator>
      <dc:date>2014-02-06T15:30:01Z</dc:date>
    </item>
    <item>
      <title>Re: calculate central point feature within each grid cell.?</title>
      <link>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319128#M24805</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, I think I understand what you're trying to do now. Let me make sure I got it right:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;You want to somehow merge all the points within a given grid to one central point (based on the containing grid).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Next question: how do you want to combine the fields of all those points into one?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;For example, if a grid has three points and those points have the values of 11, 74 and 36; should the central point have a value of 121 (sum), 40.333 (average), 36 (median) or something different? If there are string fields, how do you want to handle those?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;We should be able to do everything with python.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 17:10:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319128#M24805</guid>
      <dc:creator>JoshuaChisholm</dc:creator>
      <dc:date>2014-02-06T17:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: calculate central point feature within each grid cell.?</title>
      <link>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319129#M24806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your follow up, really appreciated !. These points are nothing to do with weight, they are just Lat/Long points feature. I just want to calculate a central point based on their location within a grid. Some grids just have one point which is fine ( I want to leave them as they are), but would like to calculate a central point for those grids that has more then one point.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 17:57:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319129#M24806</guid>
      <dc:creator>YamMagar</dc:creator>
      <dc:date>2014-02-06T17:57:32Z</dc:date>
    </item>
    <item>
      <title>Re: calculate central point feature within each grid cell.?</title>
      <link>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319130#M24807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;1.) &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Spatial_Join/00080000000q000000/"&gt;Spatial Join&lt;/A&gt;&lt;SPAN&gt; to assign grid ID to points&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;2.) &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//005p00000018000000"&gt;Mean Center&lt;/A&gt;&lt;SPAN&gt; (case = grid ID)&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 18:32:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319130#M24807</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2014-02-06T18:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculate central point feature within each grid cell.?</title>
      <link>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319131#M24808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ohhh, now I get it (i think). &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You should be able to do that with two tools. You can do this with or without python.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;OL&gt;&lt;BR /&gt;&lt;LI&gt;First, you want to do a &lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000000q000000" rel="nofollow" target="_blank"&gt;spatial join&lt;/A&gt; to get the polygon grid data to a point level.&lt;/LI&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;Target Features: point data (you can point to either the feature class of the feature layer)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Join Features: grid (fishnet) data (you can point to either the feature class of the feature layer)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Output Feature class: pick a location&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Join Operation: JOIN_ONE_TO_MANY (there can be many points inside each grid)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Uncheck the "Keep All Target Features" (we don't want to calculate the central point for points that don't fall into a grid)&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;/OL&gt;&lt;SPAN&gt;In python you would use this line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;arcpy.SpatialJoin_analysis(r"C:\Path\To\Points.shp",r"C:\Path\To\Grid.shp",r"C:\Path\To\PointsWithGridData.shp","JOIN_ONE_TO_MANY","KEEP_COMMON")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;LI&gt;Secondly, use &lt;A class="jive-link-external-small" href="http://resources.arcgis.com/en/help/main/10.1/index.html#//005p00000018000000" rel="nofollow" target="_blank"&gt;Mean Center&lt;/A&gt; tool to get your central points.&lt;/LI&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;Input Feature Class: The feature class you created above (you can point to either the feature class of the feature layer)&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Output Feature Class: pick a location&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;Case Field: pick a unique field from the grid feature class. If you have a grid name field, choose that one. If you can't find one, you can just choose 'JOIN_FID'. 'JOIN_FID' will work but will mean the resulting points will only have a number to be identified/labeled by.&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;In python you would use this line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;arcpy.MeanCenter_stats(r"C:\Path\To\PointsWithGridData.shp",r"C:\Path\To\CentralPoints.shp","#","JOIN_FID")&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Let me know if it works. Good luck!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 18:38:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319131#M24808</guid>
      <dc:creator>JoshuaChisholm</dc:creator>
      <dc:date>2014-02-06T18:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: calculate central point feature within each grid cell.?</title>
      <link>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319132#M24809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you Darren and Josh ! It worked well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Feb 2014 19:47:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculate-central-point-feature-within-each-grid/m-p/319132#M24809</guid>
      <dc:creator>YamMagar</dc:creator>
      <dc:date>2014-02-06T19:47:54Z</dc:date>
    </item>
  </channel>
</rss>

