<?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: Arcpy update NULL values in point table by copying value from nearest line table in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-update-null-values-in-point-table-by-copying/m-p/1170593#M64484</link>
    <description>&lt;P&gt;Thanks for this.. I think this will give me a good starting point!&lt;/P&gt;</description>
    <pubDate>Wed, 04 May 2022 13:59:41 GMT</pubDate>
    <dc:creator>JohnConnor01</dc:creator>
    <dc:date>2022-05-04T13:59:41Z</dc:date>
    <item>
      <title>Arcpy update NULL values in point table by copying value from nearest line table</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-update-null-values-in-point-table-by-copying/m-p/1170408#M64477</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have a feature class which is represented as lines (power lines). I have another feature class that are points (lights) that are on top of/intersecting with the line.&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The light table has NULL values for year_installed&lt;/LI&gt;&lt;LI&gt;For the light that the power line is on top of/intersecting with, I want to copy the &lt;STRONG&gt;nearest&lt;/STRONG&gt; power lines year_installed value into the lights field where the lights year_installed value is NULL.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to do this in Arcpy. I believe I need to use either a Spatial Join or Transfer Attributes. Can anyone help me get started or advise what Arcpy tool I need to use? I really appreciate the help.&lt;/P&gt;&lt;P&gt;-JC from Boston&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 21:48:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-update-null-values-in-point-table-by-copying/m-p/1170408#M64477</guid>
      <dc:creator>JohnConnor01</dc:creator>
      <dc:date>2022-05-03T21:48:56Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy update NULL values in point table by copying value from nearest line table</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-update-null-values-in-point-table-by-copying/m-p/1170415#M64478</link>
      <description>&lt;P&gt;How do you want it to resolve ties if the point is snapped to the intersection of two different lines?&lt;/P&gt;</description>
      <pubDate>Tue, 03 May 2022 22:42:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-update-null-values-in-point-table-by-copying/m-p/1170415#M64478</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2022-05-03T22:42:38Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy update NULL values in point table by copying value from nearest line table</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-update-null-values-in-point-table-by-copying/m-p/1170515#M64479</link>
      <description>&lt;LI-CODE lang="python"&gt;# load the power lines (geometry and year_installed)
power_lines = [row for row in arcpy.da.SearchCursor("path:/to/powerlines", ["SHAPE@", "year_installed"])]

# open an UpdateCursor on the lights with NULL values
with arcpy.da.UpdateCursor("path:/to/lights", ["SHAPE@", "year_installed"], "year_installed IS NULL") as cursor:
    for shp, year in cursor:
        # sort the power lines by distance to shp
        power_lines.sort(key=lambda pl: pl[0].distanceTo(shp))
        # use the closest power line's year value
        cursor.updateRow([shp, power_lines[0][1]])&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 04 May 2022 06:59:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-update-null-values-in-point-table-by-copying/m-p/1170515#M64479</guid>
      <dc:creator>JohannesLindner</dc:creator>
      <dc:date>2022-05-04T06:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy update NULL values in point table by copying value from nearest line table</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-update-null-values-in-point-table-by-copying/m-p/1170593#M64484</link>
      <description>&lt;P&gt;Thanks for this.. I think this will give me a good starting point!&lt;/P&gt;</description>
      <pubDate>Wed, 04 May 2022 13:59:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-update-null-values-in-point-table-by-copying/m-p/1170593#M64484</guid>
      <dc:creator>JohnConnor01</dc:creator>
      <dc:date>2022-05-04T13:59:41Z</dc:date>
    </item>
  </channel>
</rss>

