1

I have a script that takes a point featureclass (FC) through the following workflow:

  1. Select points that lie within individual polygons
  2. From the selected points within each polygon, randomly subset X% of points
  3. Merge the selected points from each polygon feature sub-selection
  4. Erase the original points with the merged subset and write to a new FC

I am using arcpy.Erase_analysis() to do the point deletion.

The subset of data I am testing this script on has ~35000 point features. The point subset that I would like to use as the erase feature has ~3000 point features. It takes approximately 3-5 minutes to complete processing. Seeing that I will be scaling this up to a dataset containing ~30 million points, is there a more efficient method to delete points than by using the arcpy.Erase_analysis() method? Perhaps, programmatically deleting points in an editing session? Or, a method that does not involve writing a new point FC?

  • If you write out the FC from the selected points won't the erase be unnecessary? – mikeLdub Dec 6 '13 at 21:28
  • What type(s) of geodatabase is your feature class stored in? – PolyGeo Dec 6 '13 at 21:31
  • @mikeLdub I need to erase a certain percentage of points within each polygon feature and keep the remaining points that do not intersect with the polygons. – Aaron Dec 6 '13 at 21:38
  • @PolyGeo ESRI FGDB – Aaron Dec 6 '13 at 21:38
  • Is the selection polygon in step 1 the same as the erase polygon in step 4? Also, if you have ArcGIS for Desktop Standard or Advanced licensing level then the Erase Point tool may be worth looking at. – PolyGeo Dec 7 '13 at 0:26
4

You can't efficiently delete large numbers of features from a large table, period.

You'd be much better off just marking them as deleted (available varchar(1), values 'Y' or 'N') and adding an attribute constraint to your selection logic (or using a view). Building a parallel table to house a foreign key and available field is an adequate solution, though the join performance is likely to drag down processing on larger tables.

Be sure to use "Y" and "N" values, rather than nulls, because changing a 1-character value to another 1-character value isn't going to have the same fragmentation impact as changing a null to a string.

0

If you do not NEED to delete the points, then you could just use the Select By Attribute tool, select the points that you don't need, switch selection and create a new feature class. That will help your data maintain its original integrity also.

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.