Finding the centroid of a multipart polyline in ArcGIS 9.2, Arcview License

05-31-2010 12:45 PM
New Contributor
Hi folks,

I'm attempting to find the centroid of a multipart polyline while using ArcGIS 9.2, with the ArcView license. I have access to Network Analyst and Spatial Analyst extensions.

I have used Network Analyst on a river network, and used x/y coordinates of existing fish locations with a dispersal estimate to extract the river segments within a 1km network of each of my data points, resulting in several discrete "clouds" of line segments. My goal is to find the total length of the cloud and x/y coordinate for each of the clouds.

When the clouds are close enough together, they merge together. I merged them by creating a buffer around each of the line segments, dissolving the buffers, assigning an ID to each resulting buffer, performing a spatial join of the buffer to the river line segments to assign the segments their ID, and then dissolving by ID to result in multipart polylines. I have been able to calculate length of these polylines, but I have not been able to adequately calculate  centroids. I have used the x/y coordinate code from Ian-ko, and used the "Tools for Graphics and Shapes" by Jenness, to no avail. They calculate the middle of a polyline perfectly for polylines with no branches, but give strange results for when a polyline branches in the manner that rivers typically do. I have attached an example of what I mean, where the dark lines are my overall river network, the lighter lines are the discrete "clouds", and the dots are the currently calculated centroids.

What I am looking for is a way to calculate a weighted centroid, so that the point is in the middle of the multipart polyline with a roughly equal length on both sides, useble with an ArcView license. Does such a method exist?

Josh Mailhiot
Aquatic Science Biologist
Fisheries and Oceans Canada
Tags (2)
0 Kudos
0 Replies