<?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 How to calculate Automatically Distances to one fixed point in Data Management Questions</title>
    <link>https://community.esri.com/t5/data-management-questions/how-to-calculate-automatically-distances-to-one/m-p/734325#M41565</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I need to calculate the distances of 4500 housing units to a Park. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found this post &lt;/SPAN&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=982&amp;amp;t=86666"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=982&amp;amp;t=86666&lt;/A&gt;&lt;SPAN&gt; (that is now closed) and I could edit the table of attribute of my shape file,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;adidng a new field and using the field calculator with this code suggested by Olivier&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the shapefile, use the field calculator and paste the following pre-logic VBScript code (advanced)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-In the code, change the X and Y constants to the coordinates of the park&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Type 'Distance' in the 'FieldYouCalculate =' text box. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Const X As Double = 100000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Const Y As Double = 50000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim Distance As Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPoint As IPoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pPoint = New esriGeometry.Point&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pPoint.PutCoords X, Y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pProxOp As IProximityOperator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pProxOp = pPoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Distance = pProxOp.ReturnDistance([Shape])&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This procedure create the Field DIST2PARK (this is the way I named the new field)&amp;nbsp; in circa 30 seconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only issue is that the distances calculated are not correct because I get a large number. I have tried as Constant parks X and Y's coordinates both in decimal degrees and meters. What is funny is that If I select the point related to the park and I check the correspondent cell in DIST2PARK this should be zero instead it has a large number.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea and suggestion would be greatly appreciated. I am newbie to GIS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Feb 2012 14:41:04 GMT</pubDate>
    <dc:creator>ErmannoAffuso</dc:creator>
    <dc:date>2012-02-28T14:41:04Z</dc:date>
    <item>
      <title>How to calculate Automatically Distances to one fixed point</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-calculate-automatically-distances-to-one/m-p/734325#M41565</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I need to calculate the distances of 4500 housing units to a Park. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have found this post &lt;/SPAN&gt;&lt;A href="http://forums.esri.com/Thread.asp?c=93&amp;amp;f=982&amp;amp;t=86666"&gt;http://forums.esri.com/Thread.asp?c=93&amp;amp;f=982&amp;amp;t=86666&lt;/A&gt;&lt;SPAN&gt; (that is now closed) and I could edit the table of attribute of my shape file,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;adidng a new field and using the field calculator with this code suggested by Olivier&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In the shapefile, use the field calculator and paste the following pre-logic VBScript code (advanced)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-In the code, change the X and Y constants to the coordinates of the park&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;-Type 'Distance' in the 'FieldYouCalculate =' text box. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Const X As Double = 100000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Const Y As Double = 50000&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim Distance As Double&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPoint As IPoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pPoint = New esriGeometry.Point&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pPoint.PutCoords X, Y&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pProxOp As IProximityOperator&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pProxOp = pPoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Distance = pProxOp.ReturnDistance([Shape])&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This procedure create the Field DIST2PARK (this is the way I named the new field)&amp;nbsp; in circa 30 seconds.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The only issue is that the distances calculated are not correct because I get a large number. I have tried as Constant parks X and Y's coordinates both in decimal degrees and meters. What is funny is that If I select the point related to the park and I check the correspondent cell in DIST2PARK this should be zero instead it has a large number.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any idea and suggestion would be greatly appreciated. I am newbie to GIS.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 14:41:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-calculate-automatically-distances-to-one/m-p/734325#M41565</guid>
      <dc:creator>ErmannoAffuso</dc:creator>
      <dc:date>2012-02-28T14:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate Automatically Distances to one fixed point</title>
      <link>https://community.esri.com/t5/data-management-questions/how-to-calculate-automatically-distances-to-one/m-p/734326#M41566</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can the &lt;/SPAN&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000001q000000.htm"&gt;near command &lt;/A&gt;&lt;SPAN&gt;work for your?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 15:03:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/data-management-questions/how-to-calculate-automatically-distances-to-one/m-p/734326#M41566</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2012-02-28T15:03:12Z</dc:date>
    </item>
  </channel>
</rss>

