[GIS] How to find nearest neighbors of polylines

arcgis-desktopspatial-analystvoronoi-thiessen

I have a shapefile containing irregularly placed polylines (i.e., survey routes). Following the general idea of a paper I read, I would like to use tessellation to identify the neighbors for each polyline, but I have no idea how to accomplish that. I see there is a tool to create Thiessen polygons around points which (I think) is similar to what I want to do, but I don't see a similar option for lines. I am using ArcGIS 10.1. Any specific ideas on how to proceed would be much appreciated!


Additional information

1) The paper is here: http://www.esajournals.org/doi/abs/10.1890/03-5247. Their brief description: "We delineated a spatial neighborhood on an irregular lattice by tessellating the sample routes, and from this neighborhood structure derived an adjacency matrix of first-order neighbors."

2) The routes do not overlap.

3) I do have access to Spatial Analyst.

4) The goal is to determine the nearest neighbors of each polyline so we can control for spatial auto-correlation of count data from the routes.

Best Answer

You can do it all with a few simple calculations.

To illustrate, here is a map of non-overlapping polylines (major rivers of the US, Lambert Conformal Conic projection):

Rivers

A Euclidean Allocation assigns to each cell of a grid the identifier (ID) of the nearest river. This is the desired tessellation. For this illustration, which uses color to indicate river name, I chose a crude 3 Km cellsize, yielding rasters of about 1.5 million cells. This operation (and subsequent ones) are so fast, though, that they are feasible with much larger rasters.

Allocation

To find out which polylines abut which others, you need to analyze the boundary cells. A small neighborhood of each boundary cell contains cells with the identifiers of adjacent polylines. We need to pick out at least two distinct such identifiers. One way is to compute the minimum ID and then compute the maximum ID using focal statistics. A 2 by 2 neighborhood will suffice.

The maps of the min and max IDs look almost the same as the proximity map, but they disagree at locations near the boundaries, as shown in this magnified view of the results of a Combine operation applied to the focal min and focal max. This operation creates a grid whose attribute values indicate both the min and max. I have highlighted in yellow any points where the min and max differ.

Boundaries

The selected part of the Combined attribute table is the (formal) adjacency relation: each record gives a pair of river identifiers of neighboring rivers. That's suitable input for follow-on processing. It also contains a useful [Count] field showing in how many cells the two IDs are adjacent. You could use these for filtering out small counts or even weighting the amount of adjacency.

Adjacency table

Related Question