<?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 Intersect feature class one row at a time? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/intersect-feature-class-one-row-at-a-time/m-p/32047#M2530</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to write a script that will take a line feature class (RouteM) and intersect it with a polygon feature class (Parcels), but I only want to do one row from the line feature class at a time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to writing scripts and need really haven't been able to even get a script to run.&amp;nbsp; Here's what I have so far.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#Import modules
import arcgisscripting, sys, os

#Create the geoprocessor object
gp=arcgisscripting.create()

#Set input workspace
gp.workspace = "J:\\Work\\North System"

gp.OverWriteOutput = False

#Set output workspace
outWorkspace = "J:\\Work\\North System\\Output"

#Create search cursor
rows = gp.SearchCursor("'J:\\Work\\North System\\NS_RouteM.shp' #", "","","","")
row = rows.Next()
print row

while row:
 gp.Intersect_analysis("'J:\\Work\\North System\\NS_RouteM.shp' #; 'J:\\Work\\North System\\NS_Parcels_Edited.shp'#", 'J:\\WOrk\\North System\\Output\\NS_RouteM_Intersect_Test.shp', "ALL", "", "LINE")
 row = rows.next()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know this is missing something...any help would be appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Oct 2011 14:12:30 GMT</pubDate>
    <dc:creator>BamJam</dc:creator>
    <dc:date>2011-10-20T14:12:30Z</dc:date>
    <item>
      <title>Intersect feature class one row at a time?</title>
      <link>https://community.esri.com/t5/python-questions/intersect-feature-class-one-row-at-a-time/m-p/32047#M2530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am trying to write a script that will take a line feature class (RouteM) and intersect it with a polygon feature class (Parcels), but I only want to do one row from the line feature class at a time. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am new to writing scripts and need really haven't been able to even get a script to run.&amp;nbsp; Here's what I have so far.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;#Import modules
import arcgisscripting, sys, os

#Create the geoprocessor object
gp=arcgisscripting.create()

#Set input workspace
gp.workspace = "J:\\Work\\North System"

gp.OverWriteOutput = False

#Set output workspace
outWorkspace = "J:\\Work\\North System\\Output"

#Create search cursor
rows = gp.SearchCursor("'J:\\Work\\North System\\NS_RouteM.shp' #", "","","","")
row = rows.Next()
print row

while row:
 gp.Intersect_analysis("'J:\\Work\\North System\\NS_RouteM.shp' #; 'J:\\Work\\North System\\NS_Parcels_Edited.shp'#", 'J:\\WOrk\\North System\\Output\\NS_RouteM_Intersect_Test.shp', "ALL", "", "LINE")
 row = rows.next()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I know this is missing something...any help would be appreciated!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Oct 2011 14:12:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/intersect-feature-class-one-row-at-a-time/m-p/32047#M2530</guid>
      <dc:creator>BamJam</dc:creator>
      <dc:date>2011-10-20T14:12:30Z</dc:date>
    </item>
  </channel>
</rss>

