<?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: Euclidean distance between centroids in Spatial Statistics Questions</title>
    <link>https://community.esri.com/t5/spatial-statistics-questions/euclidean-distance-between-centroids/m-p/427800#M1333</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Conrad87, I'm not sure if you are familiar with or able to use ArcObjects, but an adaptation of &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/63925/near-analysis-with-mixed-feature-types-in-arcobjects"&gt;this code&lt;/A&gt;&lt;SPAN&gt; will do it for you. Note that you don't have necessarily have to use GeometryBags like in the example, since you aren't comparing feature classes to themselves. You just need to be able to access and loop over each feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do it like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For every polygon in A:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For every polygon in B:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Calculate distance from A to B (This is done in the linked example using the IProximityOperator.ReturnDistance() method&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Store distance in an array/list&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will want to store your distances in an array/list like in the example, though your data structure may be a bit more complicated because you aren't just looking for the minimum distance like in the example, you need them all to be able to calculate the average.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; A data structure like this might work: &lt;/SPAN&gt;&lt;STRONG&gt;[FeatureIDA, FeatureIDB, distance]&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you simply query all distance from your list that have FeatureIDA in the first element and calculate the average from it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 12 Sep 2013 00:44:05 GMT</pubDate>
    <dc:creator>ConorBarber1</dc:creator>
    <dc:date>2013-09-12T00:44:05Z</dc:date>
    <item>
      <title>Euclidean distance between centroids</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/euclidean-distance-between-centroids/m-p/427798#M1331</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok here is another question for my mapping project:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've got two Layers - &lt;/SPAN&gt;&lt;STRONG&gt;"A"&lt;/STRONG&gt;&lt;SPAN&gt; and &lt;/SPAN&gt;&lt;STRONG&gt;"B"&lt;/STRONG&gt;&lt;SPAN&gt;. Each layer contains one type of polygons.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What I'm trying to do is to calculate the average euclidean distance between &lt;/SPAN&gt;&lt;STRONG&gt;every single polygon&lt;/STRONG&gt;&lt;SPAN&gt; (or centroid of every single polygon) of &lt;/SPAN&gt;&lt;STRONG&gt;"A"&lt;/STRONG&gt;&lt;SPAN&gt; with &lt;/SPAN&gt;&lt;STRONG&gt;every centroid of all polygons&lt;/STRONG&gt;&lt;SPAN&gt; of&lt;/SPAN&gt;&lt;STRONG&gt; "B"&lt;/STRONG&gt;&lt;SPAN&gt; (and note in table). - I've attached a graphic to visualize my task.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I've tried so far the "Calculate Distance Band from Neighbor Count" tool but it's looking randomly at neighbors and its count is limited to 9.999. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What do you think I should do?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;edit: the calculation of the &lt;/SPAN&gt;&lt;STRONG&gt;average&lt;/STRONG&gt;&lt;SPAN&gt; distance is not mandatory.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 24 Aug 2013 12:26:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/euclidean-distance-between-centroids/m-p/427798#M1331</guid>
      <dc:creator>ConradR_</dc:creator>
      <dc:date>2013-08-24T12:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: Euclidean distance between centroids</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/euclidean-distance-between-centroids/m-p/427799#M1332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;In the dinosaur age I would have done something like select out one or a small subset of centroids in A and then calculate distance to all centroids in B. Repeat until have data for all points in A.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am hoping somebody knows a clever modern way to do this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Sep 2013 10:05:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/euclidean-distance-between-centroids/m-p/427799#M1332</guid>
      <dc:creator>JuliiBrainard</dc:creator>
      <dc:date>2013-09-02T10:05:27Z</dc:date>
    </item>
    <item>
      <title>Re: Euclidean distance between centroids</title>
      <link>https://community.esri.com/t5/spatial-statistics-questions/euclidean-distance-between-centroids/m-p/427800#M1333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Conrad87, I'm not sure if you are familiar with or able to use ArcObjects, but an adaptation of &lt;/SPAN&gt;&lt;A href="http://gis.stackexchange.com/questions/63925/near-analysis-with-mixed-feature-types-in-arcobjects"&gt;this code&lt;/A&gt;&lt;SPAN&gt; will do it for you. Note that you don't have necessarily have to use GeometryBags like in the example, since you aren't comparing feature classes to themselves. You just need to be able to access and loop over each feature class.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do it like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;For every polygon in A:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For every polygon in B:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Calculate distance from A to B (This is done in the linked example using the IProximityOperator.ReturnDistance() method&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Store distance in an array/list&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You will want to store your distances in an array/list like in the example, though your data structure may be a bit more complicated because you aren't just looking for the minimum distance like in the example, you need them all to be able to calculate the average.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; A data structure like this might work: &lt;/SPAN&gt;&lt;STRONG&gt;[FeatureIDA, FeatureIDB, distance]&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then you simply query all distance from your list that have FeatureIDA in the first element and calculate the average from it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Sep 2013 00:44:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/spatial-statistics-questions/euclidean-distance-between-centroids/m-p/427800#M1333</guid>
      <dc:creator>ConorBarber1</dc:creator>
      <dc:date>2013-09-12T00:44:05Z</dc:date>
    </item>
  </channel>
</rss>

