# Distance between a line layer and several other line features (arcGIS 9.3 Arcview Licence)

I have a "Drain" line layer (with 150 lines) that I need to calculate the distance from lines to all objects within 120m. I've tried doing a spatial join and its great but I need more than just the closest features. I need all features within the 120 buffer. I believe that the NEAR tool would do this for me but unfortunately I don't have that licence Level.

Any direction you can give me would be a great help to me.

A spatial join in the other direction associates the closest distance of the line layer to each object feature. Querying for distances of 120 m or less solves the problem.

Alternatively, you can compute the Euclidean distance grid for the line layer, compare the grid values to 120 m, and use the result to select objects. Selection can be done by extracting the grid values (for point objects and small linear or polygonal features) or via zonal stats (for larger linear and polygonal features).

• Would this be okay for 296 drains, and 5 other data sets with over a 100 line features in each? Dec 20, 2010 at 16:59
• Yes. The operation is a fast one (in principle): it exploits spatial indexes. It should work correctly and fairly quickly even when millions of objects are involved. The main limitation is that the operation needs to be done separately for each layer of other objects. (For this reason it can be beneficial to design GIS databases accordingly: when you anticipate performing such analyses, put all objects of a given type (which will participate in the same way in the analyses) into a single layer.) Dec 20, 2010 at 18:52

Closest Feature Distance

• or the spider diagram in the same toolbox. you would need to run it for each dataset but it is a great tool. Dec 20, 2010 at 15:53
• Thanks for answer. I have this toolset and this tool would be perfect if it gave all closests features within my 120m buffer. You see, the line can be a 1km long and be 15m from one object in one spot and 30m from an object in another spot. This will only give me the record for the closest when the second closest is also important to me. Im curious as to this spider diagram.. ill will check it out. (err. i have to pay for the whole extension to do that.) Dec 20, 2010 at 16:57

Maybe you can use this method?

If you create Routes from your lines (ArcToolbox - Linear Referencing Tools - Create Routes), you can use the Locate Features Along Routes Tool. In this tool you set the Search Radius to 120 meters and uncheck the "Keep only the closest route location". This will create at table as result with a field with distance info. You have to run the tool once pr. Feature Class.

Good luck.