AnsweredAssumed Answered

Selective Clip within data set

Question asked by lturley on Oct 15, 2018
Latest reply on Oct 15, 2018 by dkwiens

Hello,

I was wondering if anyone would be able to help me out,  I have one geodatabase with points and polygons containing pairs of attributes having the same prefix with different suffixes. I am trying to clip the matching pair of GPS points to the buffer polygons. I have them separated into two different datasets but have been finding iterating over two lists to be problematic (for loops within for loops).  

import arcpy
import os
arcpy.env.overwriteOutput = True

arcpy.env.workspace = r'E:\\gps_test.gdb'
output = r'E:\\new_gps_test.gdb\dataset'

buffer = arcpy.ListFeatureClasses('','polygon')
pts = arcpy.ListFeatureClasses('','point')
for buff in buffer:
    out_fc = os.path.join(output, name)
    for point in pts:
        point = point[:3]
        try:
            if buff == point:
                name = (buff+('_400Clip'))
                out_fc = os.path.join(output, name)
                arcpy.Clip_analysis(buff, point, out_fc)


when I run the script I continually get the error:

File "<ipython-input-35-63a1110da2d4>", line 11 arcpy.Clip_analysis(buff, point, out_fc) ^ SyntaxError: unexpected EOF while parsing

 

 

I even attempted to use ModelBuilder with no luck:L

 

Any help would be greatly appreciated. 

 

Thank you, 

Liam  

Outcomes