<?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: Generate Near Table in Geoprocessing Questions</title>
    <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182771#M6145</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander, apologies for the late reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I converted the polygon to lines, which was straight forward and then created points along the line using a toolbox called Create Points On Line (&lt;A href="http://ianbroad.com/arcgis-toolbox-create-points-polylines-arcpy/"&gt;http://ianbroad.com/arcgis-toolbox-create-points-polylines-arcpy/&lt;/A&gt;). Thinking about it now it clearly wasn't the right approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 22 Feb 2015 10:37:00 GMT</pubDate>
    <dc:creator>SukhRehal</dc:creator>
    <dc:date>2015-02-22T10:37:00Z</dc:date>
    <item>
      <title>Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182765#M6139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Guys,&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;hope everyone is well?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm hoping someone can help me here, is there a way to generate something like a 'near table' (&lt;A class="jive-link-external-small" href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000001n000000" rel="nofollow" target="_blank"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00080000001n000000&lt;/A&gt;) with a basic level user licence?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are there any work around's you can suggest?&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using ArcGIS 10.2&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2015 16:48:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182765#M6139</guid>
      <dc:creator>SukhRehal</dc:creator>
      <dc:date>2015-02-20T16:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182766#M6140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can probably do something (very) simplified with some Python code, loading the data into a dictionary and analyzing it, but this method should not be executed on larger data sets or multiple data sets. How many featureclasses with how many features and what geometry type do you want to use?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2015 16:56:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182766#M6140</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-20T16:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182767#M6141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have 1000s of points, in this case just under 5000.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Additionally, I wouldnt have a clue where to begin with python &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/sad.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2015 17:00:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182767#M6141</guid>
      <dc:creator>SukhRehal</dc:creator>
      <dc:date>2015-02-20T17:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182768#M6142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are the points in a single featureclass or are they stored in 2 or more featureclasses. I could probably write something, but it depends on what you want to achieve.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What options should be supported:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;search_radius&lt;/LI&gt;&lt;LI&gt;location&lt;/LI&gt;&lt;LI&gt;angle&lt;/LI&gt;&lt;LI&gt;closest&lt;/LI&gt;&lt;LI&gt;closest_count&lt;/LI&gt;&lt;LI&gt;method&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;From all the development languages for ArcGIS, Python is probably the easiest to learn...&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 20 Feb 2015 17:06:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182768#M6142</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-20T17:06:26Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182769#M6143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I did was convert a polygon to a points, what I was hoping to achieve is get the xy of of the closest point on a polygon to the closest point on a polyline (which I also converted to points, so I could get the xy). In the end my aim is to create a line between the 2 XY points, for this I would have used XY to Line tool.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks again,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 11:03:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182769#M6143</guid>
      <dc:creator>SukhRehal</dc:creator>
      <dc:date>2015-02-21T11:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182770#M6144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK, that sounds a little different, but this can be done using some Python code. What I wonder is how the polygon was translated to point. Did you use the label point or true centroid or is it a point on the perimeter of the polygon?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The line does not have to be converted to points. For each point (from the polygon) to nearest point to a line can be determined. This can yield to point on the line too, which subsequently can be used to create the "near" line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 21 Feb 2015 15:14:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182770#M6144</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-21T15:14:27Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182771#M6145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander, apologies for the late reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I converted the polygon to lines, which was straight forward and then created points along the line using a toolbox called Create Points On Line (&lt;A href="http://ianbroad.com/arcgis-toolbox-create-points-polylines-arcpy/"&gt;http://ianbroad.com/arcgis-toolbox-create-points-polylines-arcpy/&lt;/A&gt;). Thinking about it now it clearly wasn't the right approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 22 Feb 2015 10:37:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182771#M6145</guid>
      <dc:creator>SukhRehal</dc:creator>
      <dc:date>2015-02-22T10:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182772#M6146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The idea of converting the polygon and line features to points and perform the analysis with the points is not a strange or bad idea. Just look at this thread: &lt;A href="https://community.esri.com/thread/43500"&gt;Distance between two linear features?&lt;/A&gt;&amp;nbsp; which does the same (yet requires an Advanced/ArcInfo license)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to understand a little more of what you are doing, what do the polygons and lines represent? Can you attach a screendump of your data? This to determine the complexity of your geometries.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What I would be thinking of is using Python to loop through points on the boundary of the polygon (no conversion to lines or points needed) and use the &lt;A href="http://resources.arcgis.com/en/help/main/10.2/index.html#/Polyline/018z00000008000000/"&gt;Polyline::queryPointAndDistance (in_point, {as_percentage})&lt;/A&gt; method to query the nearest point on the line feature.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the Help:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;Finds the point on the polyline nearest to the in_point and the distance between those points. Also returns information about the side of the line the in_point is on as well as the distance along the line where the nearest point occurs.&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If possible you could attach a small sample of the data you have, and I'll write some code which you can use to process your data.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 12:01:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182772#M6146</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2015-02-23T12:01:17Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182773#M6147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Xander, The Polygons represent homes and the polylines are road bounderies. What Im trying to go is show a line from the road boundary to the home boundary but using the shortest line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I haven't attached a screen dump of what I want but I have attached my shapefiles. Hope this helps? Let me know i there is anything additional you may need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Sukh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 12:25:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182773#M6147</guid>
      <dc:creator>SukhRehal</dc:creator>
      <dc:date>2015-02-23T12:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182774#M6148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code below will generate the following result:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="nearLines.png" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/64769_nearLines.png" style="height: auto;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Change the input and output featureclasses on line 5, 6 and 7. The output featureclass (shapefile) will be created.&lt;/P&gt;&lt;P&gt;On line 10 you can play with the precision (stepsize). In this case I specified 1 (m).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy

&amp;nbsp;&amp;nbsp;&amp;nbsp; # inputs and output
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_pol = r"D:\Xander\GeoNet\NearLines\Polygons.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_lin = r"D:\Xander\GeoNet\NearLines\Road_Boundary.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_out = r"D:\Xander\GeoNet\NearLines\lines02.shp"

&amp;nbsp;&amp;nbsp;&amp;nbsp; # precision (m)
&amp;nbsp;&amp;nbsp;&amp;nbsp; stepsize = 1 # extract point on boundary polygon every 1 meter

&amp;nbsp;&amp;nbsp;&amp;nbsp; sr = arcpy.Describe(fc_lin).spatialReference

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create list of line geometries
&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_lines = [r[0] for r in arcpy.da.SearchCursor(fc_lin, ("SHAPE@"))]

&amp;nbsp;&amp;nbsp;&amp;nbsp; # loop through polygons
&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_res = []
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc_pol, ("SHAPE@")) as curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polygon = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boundary = polygon.boundary()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_min = None

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(0, int(boundary.length), stepsize):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point_pol = boundary.positionAlongLine(i, False)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for line in lst_lines:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pntg, val, dist, right_side = line.queryPointAndDistance(point_pol, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dist_min is None:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_min = dist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_lin_found = arcpy.Point(pntg.firstPoint.X, pntg.firstPoint.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_pol_found = arcpy.Point(point_pol.firstPoint.X, point_pol.firstPoint.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dist &amp;lt; dist_min:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_min = dist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_lin_found = arcpy.Point(pntg.firstPoint.X, pntg.firstPoint.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_pol_found = arcpy.Point(point_pol.firstPoint.X, point_pol.firstPoint.Y)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; line_out = arcpy.Polyline(arcpy.Array([pnt_lin_found, pnt_pol_found]), sr)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_res.append(line_out)

&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CopyFeatures_management(lst_res, fc_out)

if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp; main()&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kind regards, Xander&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:18:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182774#M6148</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T09:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182775#M6149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;and in case you want to keep a reference to the input data, you can write the input OID of the polygons and lines to the output featureclass like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def main():
&amp;nbsp;&amp;nbsp;&amp;nbsp; import arcpy
&amp;nbsp;&amp;nbsp;&amp;nbsp; import os

&amp;nbsp;&amp;nbsp;&amp;nbsp; # inputs and output
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_pol = r"D:\Xander\GeoNet\NearLines\Polygons.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_lin = r"D:\Xander\GeoNet\NearLines\Road_Boundary.shp"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_out = r"D:\Xander\GeoNet\NearLines\lines04.shp"

&amp;nbsp;&amp;nbsp;&amp;nbsp; # output fields
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_oid_polygon = "OIDpolygon"
&amp;nbsp;&amp;nbsp;&amp;nbsp; fld_oid_line = "OIDline"
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds_add = [fld_oid_polygon, fld_oid_line]

&amp;nbsp;&amp;nbsp;&amp;nbsp; # precision (m)
&amp;nbsp;&amp;nbsp;&amp;nbsp; stepsize = 1 # extract point on boundary polygon every 1 meter

&amp;nbsp;&amp;nbsp;&amp;nbsp; sr = arcpy.Describe(fc_lin).spatialReference

&lt;SPAN style="line-height: 1.5;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # create empty output fc&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_ws, fc_name = os.path.split(fc_out)
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.CreateFeatureclass_management(fc_ws, fc_name, "POLYLINE", spatial_reference=sr)

&amp;nbsp;&amp;nbsp;&amp;nbsp; # add fields
&amp;nbsp;&amp;nbsp;&amp;nbsp; for fldname in flds_add:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddField_management(fc_out, fldname, "LONG")

&amp;nbsp;&amp;nbsp;&amp;nbsp; # create dict of oid vs line geometries
&amp;nbsp;&amp;nbsp;&amp;nbsp; dct_lines = {r[0]: r[1] for r in arcpy.da.SearchCursor(fc_lin, ("OID@", "SHAPE@"))}

&amp;nbsp;&amp;nbsp;&amp;nbsp; # insert cursor
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds = ["SHAPE@"]
&amp;nbsp;&amp;nbsp;&amp;nbsp; flds.extend(flds_add)
&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.InsertCursor(fc_out, flds) as curs_out:

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; # loop through polygons
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lst_res = []
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; with arcpy.da.SearchCursor(fc_pol, ("SHAPE@", "OID@")) as curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in curs:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polygon = row[0]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oid_polygon = row[1]
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; boundary = polygon.boundary()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_min = None

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for i in range(0, int(boundary.length), stepsize):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; point_pol = boundary.positionAlongLine(i, False)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for oid_line, line in dct_lines.items():
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pntg, val, dist, right_side = line.queryPointAndDistance(point_pol, False)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dist_min is None:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_min = dist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_lin_found = arcpy.Point(pntg.firstPoint.X, pntg.firstPoint.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_pol_found = arcpy.Point(point_pol.firstPoint.X, point_pol.firstPoint.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oid_line_found = oid_line
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if dist &amp;lt; dist_min:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist_min = dist
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_lin_found = arcpy.Point(pntg.firstPoint.X, pntg.firstPoint.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pnt_pol_found = arcpy.Point(point_pol.firstPoint.X, point_pol.firstPoint.Y)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oid_line_found = oid_line

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; polyline = arcpy.Polyline(arcpy.Array([pnt_lin_found, pnt_pol_found]), sr)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row_out = (polyline, oid_polygon, oid_line_found, )
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; curs_out.insertRow(row_out)

if __name__ == '__main__':
&amp;nbsp;&amp;nbsp;&amp;nbsp; main()&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:18:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182775#M6149</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T09:18:52Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182776#M6150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Xander,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your screen shot is exactly what I wanted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do I simply paste this into the code window? I will try to create a toolbox. &lt;IMG src="https://community.esri.com/legacyfs/online/emoticons/happy.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 23 Feb 2015 15:31:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182776#M6150</guid>
      <dc:creator>SukhRehal</dc:creator>
      <dc:date>2015-02-23T15:31:53Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182777#M6151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I normally run the code from a stand alone IDE (I use PyScripter), but you can run the code from the python window (it will not add the result to the TOC, though). Before you run it, make sure you change the paths to your input data and provide a valid output name/path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can also create a toolbox from it. Use the arcpy.GetParameterAsText()&amp;nbsp; to collect the inputs&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_pol = arcpy.GetParameterAsText(0) # featurelayer, filter on polygon, direction is input
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_lin = arcpy.GetParameterAsText(1) # featurelayer, filter on polyline, direction is input
&amp;nbsp;&amp;nbsp;&amp;nbsp; fc_out = arcpy.GetParameterAsText(2) # featureclass, direction is output&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have problems, post them back and I can have a look at it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If it works, please mark the thread as answered (at the post that answered your question). If a post was helpful you can mark the post as such using the links below the post &lt;EM&gt;Helpful Yes | No&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 09:18:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182777#M6151</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2021-12-11T09:18:55Z</dc:date>
    </item>
    <item>
      <title>Re: Generate Near Table</title>
      <link>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182778#M6152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You offer hope for the hobbyist. If python routines can substitute for geoprocesswing nd perhaps more, a $10K professional licene my not be needed.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Apr 2015 18:19:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/geoprocessing-questions/generate-near-table/m-p/182778#M6152</guid>
      <dc:creator>StanaforthHopkins</dc:creator>
      <dc:date>2015-04-21T18:19:03Z</dc:date>
    </item>
  </channel>
</rss>

