[GIS] Performing spatial join between lines that travel along each other in ArcGIS Desktop

arcgis-desktopspatial-join

I have 2 layers, one representing streets, and one representing pipes. The pipe layer has a street field that I want it to be automatically filled (I want the pipe to show the street that it's on) I tried performing a spatial join based on 'closest' but I encountered the following problem: many pipes never intersect the center of the streets they're on (they are usually parallel), and, at the spatial join, those respective pipes don't get the needed data from the street they go along but from the ones that are perpendicular (cause they intersect the pipes, so they have one point that is closest).

Best Answer

I've face a similar problem and created a programmatic tool that would:

  1. Shorten my street centerline. Here I would take it from .4 to .6 for example (in this case I would consider only the dashes)

    Street

    ==========

    After shortening

    ====--====

  2. I would buffer it for a small ammout, let's say 10% of the original street lenght. Imagine that you are buffering only the dashes in the schematic "drawing above".

  3. Try to intersect it with pipes.

You can repeat 2 and three until you've found a certain number of pipes. The idea for shortening the center line is to eliminate the cases where you other perpendicular lines that you do not want.

Check a less ugly scheme:

enter image description here

Another approach is to just buffer, intersect and compare the angles. You can safely set a threshold of what "parallel" is. You will never have straight and parallel lines in this cases (some will be parallel, but that depends on digitizing). You take only the pipes that have similar angles to your centerline.

Related Question