<?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: Calculating distance between a table of specific points xy and specific polylines in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763262#M58988</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Neil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will try it again. In previous efforts (see: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/9555-Modifying-Permanent-Sort-script-by-Chris-Snyder?p=30332&amp;amp;viewfull=1#post30332"&gt;http://forums.arcgis.com/threads/9555-Modifying-Permanent-Sort-script-by-Chris-Snyder?p=30332&amp;amp;viewfull=1#post30332&lt;/A&gt;&lt;SPAN&gt;) I found that the geom objects somehow got corrupted and basically became useless... but interestingly... only if the map units were in non-metric units. So for example, UTM meters worked fine... State Plane Feet (like I use) was totally messed up for some reason.&amp;nbsp; I think Kim Olivier did some deeper digging on this as I recall. I'll try again and let you know.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Jan 2014 15:55:21 GMT</pubDate>
    <dc:creator>ChrisSnyder</dc:creator>
    <dc:date>2014-01-21T15:55:21Z</dc:date>
    <item>
      <title>Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763256#M58982</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 a question which I can only solve with a code I guess, so I need your help.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Background is, that in a context of population survey, people where asked to tell their zipcode, later one they set a point on googlemaps which result their adress coordinates and so after geocoding their point of adress (including street, zip code, ...). Unfortunetly the two zip codes (first variable and that from the geocoding) do not coincide in 25% of the data. Now I want to calculate the distance between the geocode point (xy) and the zip code border of the zip code the particular person named at the beginning of the survey.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As I have a huge amout of data my question is now how I can calculate the distance between the geocode point and the zip code border which the person told. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So ich have the attribute table + shapefile with the xy coordinates and one with the zip codes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I thank you for any advice!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 19:36:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763256#M58982</guid>
      <dc:creator>NinaKruse1</dc:creator>
      <dc:date>2014-01-16T19:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763257#M58983</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could write a script to do this, but how about just using the Near tool: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00080000001q000000"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//00080000001q000000&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Jan 2014 20:32:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763257#M58983</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2014-01-16T20:32:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763258#M58984</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;"and the zip code border of the zip code the particular person named at the beginning of the survey"&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Okay, I guess you would have to write a script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Probably a better/faster way to do this (how many people pnts do you have)? I wonder if the geom objectects still get corrupted if they get put into a Python dictionary?? Perfomace trick would be to access the geometry of the zip code polys as quickly as possible...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, some code (UNTESTED!) might look like this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#assumes the pnts and zipcode polys are in the same PRJ, distances are in PRJ's map units...
peoplePntsFC = r"C:\temp\people.shp" #a pnt FC, with a field that has the claimed zip code
zipCodeFC = r"C:\temp\zipcodes.shp" #polygon FC of zipcodes
arcpy.AddField(peoplePntsFC, "DIST_TO_ZIP", "DOUBLE")
updateRows = arcpy.da.UpdateCursor(peoplePntsFC, ["SHAPE@", "ZIP_CODE" "DIST_TO_ZIP"])
for updateRow in updateRows:
&amp;nbsp;&amp;nbsp; pntObj = updateRow[0]
&amp;nbsp;&amp;nbsp; zipCode = updateRow[1]
&amp;nbsp;&amp;nbsp; zipPolyObj = arcpy.da.SearchCursor(zipCodeFC, ["SHAPE@"], "ZIP_CODE = " + str(zipCode)).next()[0]
&amp;nbsp;&amp;nbsp; updateRow[2] = pntObj.distanceTo(zipPolyObj)
&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow)
del updateRow, updateRows&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:26:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763258#M58984</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-12T08:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763259#M58985</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hey, thanks for your answer, but the point is that I am not looking for the shortest distance to the nearest zip code, but for the distance between a SPECIFIC xy point and a SPECIFIC zipcode border one person named...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;You could write a script to do this, but how about just using the Near tool: &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#//00080000001q000000"&gt;http://resources.arcgis.com/en/help/main/10.2/index.html#//00080000001q000000&lt;/A&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 06:25:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763259#M58985</guid>
      <dc:creator>NinaKruse1</dc:creator>
      <dc:date>2014-01-21T06:25:46Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763260#M58986</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello, thanks very much for your time to answer and the code!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have to work with 3100 datasets.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;As I have no experience with pyton yet &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; , I don t know if it can work with the pyton dict.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could you give me more explanations in the code, as you did at the beginning lines of the code? With that I can learn what the commandlines mean exactly and I know what I do ;). Than I will test you code with pleasure.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!!, Nina&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Okay, I guess you would have to write a script.&lt;BR /&gt;&lt;BR /&gt;Probably a better/faster way to do this (how many people pnts do you have)? I wonder if the geom objectects still get corrupted if they get put into a Python dictionary?? Perfomace trick would be to access the geometry of the zip code polys as quickly as possible...&lt;BR /&gt;&lt;BR /&gt;Anyway, some code (UNTESTED!) might look like this:&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#assumes the pnts and zipcode polys are in the same PRJ, distances are in PRJ's map units...
peoplePntsFC = r"C:\temp\people.shp" #a pnt FC, with a field that has the claimed zip code
zipCodeFC = r"C:\temp\zipcodes.shp" #polygon FC of zipcodes
arcpy.AddField(peoplePntsFC, "DIST_TO_ZIP", "DOUBLE")
updateRows = arcpy.da.UpdateCursor(peoplePntsFC, ["SHAPE@", "ZIP_CODE" "DIST_TO_ZIP"])
for updateRow in updateRows:
&amp;nbsp;&amp;nbsp; pntObj = updateRow[0]
&amp;nbsp;&amp;nbsp; zipCode = updateRow[1]
&amp;nbsp;&amp;nbsp; zipPolyObj = arcpy.da.SearchCursor(zipCodeFC, ["SHAPE@"], "ZIP_CODE = " + str(zipCode)).next()[0]
&amp;nbsp;&amp;nbsp; updateRow[2] = pntObj.distanceTo(zipPolyObj)
&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow)
del updateRow, updateRows&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:26:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763260#M58986</guid>
      <dc:creator>NinaKruse1</dc:creator>
      <dc:date>2021-12-12T08:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763261#M58987</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Loading feature data (including the geometry object) into python dictionaries (or lists, whatever) does indeed work and is a great way to do highly flexible geometry manipulation between features classes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My logic would be something like this...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Using da.SearchCursor get the points into a dictionary. Presumably each has some sort of point ID so this can become the key thus :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{PntID : [PntZipCode, PntGeomObject]}&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The zip code polys, the Zip Code itself can be the key pointing to the PolyGeomObject :&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;{ZipCode : PolyGeomObject}&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Then iterate through the PntID's, extract the PntZipCode, use this to find the record in the ZipCode Polys dict, then use the distanceTo geometry method to find the distance between them.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Collect the distances into a list of PntIDs, Distance... Then use this to update the original Fc or a copy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 07:28:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763261#M58987</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2014-01-21T07:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763262#M58988</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Neil,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I will try it again. In previous efforts (see: &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/9555-Modifying-Permanent-Sort-script-by-Chris-Snyder?p=30332&amp;amp;viewfull=1#post30332"&gt;http://forums.arcgis.com/threads/9555-Modifying-Permanent-Sort-script-by-Chris-Snyder?p=30332&amp;amp;viewfull=1#post30332&lt;/A&gt;&lt;SPAN&gt;) I found that the geom objects somehow got corrupted and basically became useless... but interestingly... only if the map units were in non-metric units. So for example, UTM meters worked fine... State Plane Feet (like I use) was totally messed up for some reason.&amp;nbsp; I think Kim Olivier did some deeper digging on this as I recall. I'll try again and let you know.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 15:55:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763262#M58988</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2014-01-21T15:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763263#M58989</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;As I have no experience with pyton yet&amp;nbsp; &lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Nina - The sooner you learn, the better.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If it helps, here's the documentation for:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;search cursor: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000011000000"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#//018w00000011000000&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;update cursor: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/UpdateCursor/018w00000014000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/UpdateCursor/018w00000014000000/&lt;/A&gt;&lt;BR /&gt;&lt;SPAN&gt;geometry objects: &lt;/SPAN&gt;&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#/Geometry/018z00000070000000/"&gt;http://resources.arcgis.com/en/help/main/10.1/index.html#/Geometry/018z00000070000000/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;... which are the "bread and butter" of what you are trying to do.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 16:04:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763263#M58989</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2014-01-21T16:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763264#M58990</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Chris,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;wow, that was a long thread...&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ditto on the "hack-programmer" bit. I go back a long way from aml to avenue and now to python, but learning all the time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I must admit, all my geom manipulation stuff has been based on either GCS (decimal lat/long) or metric UTM, so I cannot comment on the feet story. But it does sound odd if feet or whatever would make a difference to the geom object.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One of the things I have learned is that if you create a geom object from scratch, you must supply the spatial reference with it, otherwise (esp with GCS based coords) you get weird rounding effects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Other than that, I am really enthusiastic about the geometry object methods. And its very fast to do this sort of custom spatial analysis using dictionaries.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Currently on v10.2&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Jan 2014 16:23:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763264#M58990</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2014-01-21T16:23:09Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763265#M58991</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay, so I guess the geom objects seem to be working as they should in the dictionary. I can't find that post from Kim Oliver about her research into the topic, but in this case it seems to be working fine. Anyone from ESRI remember something about this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Anyway, here's the fastest way I could think to do it (took 1.6 seconds to process 1000 pnts). I didn't have any zip code data handy, so I hacked together an example that uses counties instead. My randomly placed points were randomly assigned a county code.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Nina, I added some comments in the code here as you suggested, but without some Python experience they probably won't help much.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;#assumes the pnts and polys are in the same PRJ, distances are in PRJ's map units...
import arcpy, time
#a pnt FC, with a field that has the claimed county code
pntsFC = r"C:\csny490\temp\test.gdb\random_pnts"
#polygon FC of counties (with a field for COUNTY_CD)
polyFC = r"C:\csny490\temp\test.gdb\counties"
#add a field to store the distance
arcpy.AddField_management(pntsFC, "DIST_TO_CNTY", "DOUBLE")
#put the county geometry into a dictionary for faster lookups
polyGeomDict = {r[0]:(r[1]) for r in arcpy.da.SearchCursor(polyFC, ["COUNTY_CD","SHAPE@"])}
#start a timer
time1 = time.clock()
#initialize an update cursor
updateRows = arcpy.da.UpdateCursor(pntsFC, ["SHAPE@","CLAIMED_CD","DIST_TO_CNTY"])
#a for loop to iterate through the points
for updateRow in updateRows:
&amp;nbsp;&amp;nbsp; #get a hook to the 1st two updatecursor field values
&amp;nbsp;&amp;nbsp; pntObj, countyCode = updateRow[0:2]
&amp;nbsp;&amp;nbsp; #set the DIST_TO_CNTY value to be the distanace of the pnt to the specified polygon 
&amp;nbsp;&amp;nbsp; updateRow[2] = pntObj.distanceTo(polyGeomDict[countyCode])
&amp;nbsp;&amp;nbsp; #commit the update to disk
&amp;nbsp;&amp;nbsp; updateRows.updateRow(updateRow) 
#del the update cursor objects
del updateRow, updateRows 
#stop the timer
time2 = time.clock()
#report the time it took to calc the distances
print "Took " + str(time2 - time1) + " seconds!" &lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:26:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763265#M58991</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2021-12-12T08:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763266#M58992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Very cool Chris.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
polyGeomDict = {r[0]:(r[1]) for r in arcpy.da.SearchCursor(polyFC, ["COUNTY_CD","SHAPE@"])}
&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;Those nested thingys still give me the shakes, but I must try to use them more.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;And I presume (can't remember), that if the point is &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;inside&lt;/SPAN&gt;&lt;SPAN&gt; the correct poly, the distance returned = 0.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If not the distance is to the nearest boundary.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So if the purpose is to identify those points mis-coded, then a simple text field with "Inside" or "Outside" could also be added.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Lets hope that Nina gets back to you and gives you a tick!!!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Neil&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 08:26:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763266#M58992</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2021-12-12T08:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating distance between a table of specific points xy and specific polylines</title>
      <link>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763267#M58993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Comprehensions (list and dictionary flavors) are pretty darn cool, but in reality they are just a shortened/efficient form of a for loop. And yes, if the point is inside the poly, it has a distance of 0, otherwise, the closest distance is returned.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Seems like what I recall with geom objects in a dictionary (for me at least a few years back) was that certain reported properties, such as .area or .length were incorrect as compared with the geom object itself (not stored in a dictionary)... basically like the ESRI geom object wasn't 100% (but maybe 80%?) compatible with Python. As I recall Jason Scheirer from ESRI also chimed in with some info on this at the time, but again I can't seem to find the post!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Question for any ESRI people in the know (cough... Jason): Are geometry objects stored in Python dictionaries 100% kosher now? Have they always been or am I getting dementia already?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jan 2014 16:25:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculating-distance-between-a-table-of-specific/m-p/763267#M58993</guid>
      <dc:creator>ChrisSnyder</dc:creator>
      <dc:date>2014-01-24T16:25:15Z</dc:date>
    </item>
  </channel>
</rss>

