I have a point feature class with a count field associated with each of the points.

I would like to create a new feature class where each of the points are duplicated by the value of the count field, so that rather than being an aggregate count, they represent individual events (I need to run a Monte Carlo on them so individual events are required).

Does anyone have any idea how to do this in ArcGIS for Desktop?

  • Easy as! Is the count 1 based i.e. count=1 is 1 point, count=2 is 2 points? What happens to count=0 (or are you positive there are no count=0) Sep 3, 2014 at 0:15
  • Yes - it's all integer based, ranging from 1 to a few hundred! I'm trying to find an easy way to simply explode the points out Sep 3, 2014 at 0:17
  • Thank you, any assistance would be greatly appreciated! I've been puzzling over it for a while now... Sep 3, 2014 at 0:33

1 Answer 1


I'm using the old (not da) cursors. I'm sure there are quicker ways using the arcpy.da cursors but I'm more familiar with the old style..

import sys, arcpy

InFeatClass = sys.argv[1]
OutFeatClass = sys.argv[2]

# overwriting output is ok.
arcpy.env.overwriteOutput = True

# copy the count = 1 features to create a new feature class, saves having to do
# new feature class, copy spatial reference and fields..

arcpy.Select_analysis(InFeatClass,OutFeatClass,"count = 1")

# setup cursor objects - search the source, isert the destination
InsCur = arcpy.InsertCursor(OutFeatClass)
SrchCur = arcpy.SearchCursor(InFeatClass,"Count > 1")

# get the list of fields to copy
FieldList = arcpy.ListFields(InFeatClass,"*")
NoCalcFields = ["FID","OBJECTID","SHAPE"]

for InRow in SrchCur:
    # create a range and then iterate over it
    # inserting a new row for each count
    CountRange = range(InRow.count)
    for indx in CountRange:
        newRow = InsCur.newRow() # create a new (empty) feature

        # copy values from the source to the destination
        for ThisField in FieldList:
            if ThisField.name.upper() not in NoCalcFields:

        # copy the shape

        # Store it

Have a read of http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00150000001r000000.htm if you have trouble making this a tool. I ran it on command line and it worked just fine!

  • You're welcome. Hopefully there are some gems in there that you can refer to later in future scripts. Sep 3, 2014 at 4:28

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.