# Wetlands buffer.py
# Description: Program that determines if Wetlands are within 0.5 miles of specific point files with the program returning a 'yes' or 'no' if a wetland is within the range or not.

# Import ArcGIS python library
import arcpy

# Define workspace
arcpy.env.workspace = "P:\Python"

# create buffer around single substation
substation_buffer = arcpy.Buffer_analysis("substation.shp", "P:\Python\substation_buffertest", "0.5 Miles", "FULL", "ROUND", "LIST", "", "PLANAR")
print "Made buffer layer"

# turn substation_buffertest into a feature layer for the select by location tool
fl = arcpy.MakeFeatureLayer_management("substation_buffertest.shp", "buffer_layer")
print "Made feature layer"

# select wetlands within buffer
wetland_selection = arcpy.SelectLayerByLocation_management("buffer_layer", "CONTAINS", "Wetlands.shp", "", "NEW_SELECTION", "NOT_INVERT")
print "Selected by location"

I'm trying to write a program for the company I work for that determines if a point file's buffer zone contains wetlands from another feature class. I'm trying to do this through a search cursor but the attribute table that is created only contains the FID, Shape, and Id. I've made it this far but I'm not so sure where to go from here.

  • 2
    Use CopyFeatures_management to export what's been selected. – Emil Brundage May 28 at 20:48
  • 1
    Your code doesn't include a SearchCursor – Vince May 28 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.