AnsweredAssumed Answered

How to do Eliminate Datamanegement for list of layers?

Question asked by phoukhong on Oct 23, 2015
Latest reply on Oct 26, 2015 by PGvandenBeukelesri-nl-esridist

How to process with a list of files using [arcpy.ListFeatureClasses] with script below? Any help from you all very appreciate!



  fcList = arcpy.ListFeatureClasses("P*","POLYGON")
  print fcList
  fcCount = len(fcList)
  print fcCount
  for fcs in fcList:
      print "Selecting areas < 1ha from file: " + fcs
 eliminate_file = fcs + "_elim"  
 arcpy.SelectLayerByAttribute_management(fcs,"NEW_SELECTION", expres)
      arcpy.Eliminate_management(fcs, eliminate_file, "AREA", "", "" )
  print "Could not create feature layers"


This is from:


# Name:
# Description: Eliminate features based on a selection.

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = "C:/data/Portland.gdb/Census"

# Set local variables
inFeatures = "blockgrp"
tempLayer = "blocklayer"
expression = '"Area_Sq_Miles" < 0.15'
outFeatureClass = "C:/output/output.gdb/eliminate_output"
exclusionExpression = '"OBJECTID" = 9'

# Execute MakeFeatureLayer
arcpy.MakeFeatureLayer_management(inFeatures, tempLayer)

# Execute SelectLayerByAttribute to define features to be eliminated
arcpy.SelectLayerByAttribute_management(tempLayer, "NEW_SELECTION", expression)

# Execute Eliminate
arcpy.Eliminate_management(tempLayer, outFeatureClass, "LENGTH",


Message was edited by: Dan Patterson  I moved this to geoprocessing and used syntax highlighting >> to format the code