I recently started working with ArcMap and Python. I try to delete several objects from my shapefile in ArcMap. I would like to select for example the line which are too close together. I don't want to select each line separately... Is there any chance to do this automatically using the ArcMap and Python tools?

enter image description here

The lines are about 5 meters apart. I would like to get lines 10-11 meters away (so as not to change the overall shape).

closed as off-topic by PolyGeo Sep 13 at 11:50

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

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • You need to keep outermost lines unchanged like in your example? Why do you need to delete the lines, what is your next step? – BERA Sep 13 at 10:51
  • This lines (gray) on a scale of 1:10,000 they are 5 meters away. I would like to show them for a scale of 1:25 000, but they become illegible. I need to get lines spaced about 11 meters apart, but keeping the overall shape. – Risa Sep 13 at 10:57

Try Integrate (backup data first), but that will affect all your lines, not only the ones Close together:

Integrate is used to maintain the integrity of shared feature boundaries by making features coincident if they fall within the specified x,y tolerance. Features that fall within the specified x,y tolerance are considered identical or coincident.

Or try:

  1. Feature to Polygon
  2. Make Feature Layer with a Query "selecting" polygons with low compactness: (4*3.1415* "Shape_area")/( "Shape_length"* "Shape_length") < 0.5, you probably want to adjust 0.5 and maybe add a maximum shape area condition to only select small polygons
  3. Dissolve polygons
  4. Erase lines with dissolved polygons
  5. Convert dissolved polygons to lines
  6. Merge output with erased lines

enter image description here


I have one logic I think will work to solve the problem. First define the distance which you think it is too close.

Distance=too close distance

Then use Spatial Query (Feature Within) give distance and delete the selected data.

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