I have about 10 polygons, and I have added their centroids to the map. I want to create lines connecting the centroids of each adjacent polygon. If polygon 1 borders polygon 2 and 3, I would like a line going from 1 to 2 and from 1 to 3. Hopefully this makes sense, and someone can help me out. Also, I would like to indicate the distances between the centroids.
I met the same problem, my solution is create one copy of the polygon first, add one field with the same ID with the centroid points(should be there, don't need to create). Then use the C# arcobjects to judge if the polygons are touched, like this:
ISpatialFilter pSpatialFilter = new SpatialFilterClass(); pSpatialFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelTouches;
Then record the touched polygons ID, which will be connected to the centroid, then create fromlist and tolist to record the points, create a new polyline feature class to connect those lines.