Replace thousands of polylines

492
3
06-06-2011 06:30 AM
MatthijsKok
New Contributor
Hello everybody,

I think I have a complex problem. I have two feature polylines files, the first one displays the correct line (red line) and the other one the wrong one (blue line). I need to delete the blue line and replace it by the red line. This shouldn't be problem if you have only one line to be replaced, but I have over almost 3000 lines that needs to be replaced. So I tried to use the model builder and select the line through the 'Select layer by location' and set 'Within a distance' of 0.25 meters and then select and delete these features, but than also other intersecting lines are selected and deleted. Instead, I need only the parallel line to be selected and deleted. So, does anyone know another solution for my problem?

I have added a snapshot of an example of lines.
0 Kudos
3 Replies
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Depending on how similar the blue and red lines are, you can try the following (some tools require ArcInfo Licensing):

1. Run the Feature Vertices To Points tool with MID option to get midpoints of the red lines - midPtsRed.
2. Run Select By Location to select the blue lines by midPtsRed. The selected blue lines would be ones you want to delete.
3. Run the Feature Vertices To Points tool with MID option to get midpoints of the selected blue lines - midPtsSelBlue.
4. Run Delete Features to delete the selected blue lines.
5. Run Select By Location to select the red lines by midPtsSelBlue. The selected red lines would be ones you want to replace the deleted blue lines.
6. Run Append or Merge Tool to combine the selected red lines with the remaining blue lines (if any).

Hope the above give you some leads; you may need to involve additional steps to get it right.

Thanks.
0 Kudos
MatthijsKok
New Contributor
Dan,

Completely forgotten to thank you, this solution worked great for me!


thank you for your help,

Matthijs from the Netherlands
0 Kudos
DanLee
by Esri Regular Contributor
Esri Regular Contributor
Matthijs, you are very welcome! I am glad it worked for you.  🙂

I actually wondered if you have a data conflation or spatial adjustment task to do. I am interested in seeing the two "similar" datasets that you are working with. Do you mind sharing a sample area of the two datasets with me? You can attach a zip file to email:  dlee@esri.com

Thanks!
0 Kudos