I have a feature class with many scattered points. My goal is if there are two points within 1 meter, to identify the point with the lowest Mean value (it is a quality metric from 0 - 1) and delete it, keeping only the higher one.

I have generated a near table, joined the results, and have also joined another table with intensity values for each relevant point. It looks like this:

Highlighted table

You'll note that there are actually 3 points in the cluster highlighted blue. Of these, I wish to keep the one with the highest Mean value (ID: 2).

The cluster highlighted yellow has two points, and I would keep ID: 5 and delete ID: 6, because ID: 5 has a higher Mean value.

The end result would look like this:

Resultant Table

I would need to iterate through the table (thousands of records), identifying the Near_FID for each record, selecting its record as well, and comparing the Mean value. Then finally, deleting the record with the lowest Mean value.

I'm using ArcMap 10.4. I am not averse to using a Python script or even Access if need be.

closed as off-topic by PolyGeo Mar 13 '18 at 0:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions seeking help to debug/write/improve code must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Providing a clear problem statement and evidence of a code attempt will help others to help you. See: How to create a Minimal, Complete, and Verifiable example." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    Perhaps buffer by 1m, dissolve (no multi-part), spatial join the points with their buffer, with statistic type maximum, then intersect the spatial join with the points and select where attribute < maximum attribute from polygons and delete those. If you're really keen on python you could iterate through the buffers, select layer by location to find the close points, cursor through the records to get the maximum then select from layer selected layer the selection lower than the maximum. – Michael Stimson Mar 12 '18 at 2:51
  • Thanks @MichaelStimson The table I showed was created using the Generate Near Table tool with the Search Radius tool set to 1 meter. This seems more elegant than a buffer to me, but I think forces me to use Python. Would you have any tips on how I might cursor through the records as you suggest? – Joska Mar 12 '18 at 3:01
  • This scenario will cause you to merge points that are not within your tolerance. Imagine a scenario where a string of 200 points are all .5 ft apart along a linear feature. Using your logic this would collapse into a single point. Also, How do you handle ties where the high values are the same? – Ben S Nadler Mar 12 '18 at 3:47
  • That method using a near table wouldn't be my first pick, but for a start I would import the point feature class into a geodatabase so that the OBJECTIDS are static and make any temporary feature classes in the database. Buffer the points without dissolving then use dissolve but uncheck the multipart box then cursor through them obtaining their OBJECTID, select the polygon layer by attribute where "OBJECTID = {}".format(row[0]), select the points using the selected polygon layer.. this would give you a cursor in a cursor which isn't efficient but would, eventually, get the job done. – Michael Stimson Mar 12 '18 at 4:28
  • If you wish to ask about using ArcPy to solve this then we will need to see a code attempt in your question first. I would expect that a starting point for that code would be opening an update cursor. – PolyGeo Mar 12 '18 at 4:51