I am trying to plot the average of several polylines (up to 40). I have several shorelines of a short section of beach plotted from different dates and would like to plot their average position.

Is there a tool that will allow me to do this?


4 Answers 4


I just cooked up some R code that uses a very simple algorithm. Assuming each trace represents a coastline from the same start and end point, parameterise each trace onto (0,1) by length of trace, so that (0) is the start, (1) is the end, and (0.5) is the point half way along the trace, measured from point to point. Then for a set of such parameterised traces, compute the average of the locations of each trace over a sequence of 100 or so parameters from 0 to 1.

Example image shows 8 traces in black and the average in red. If it wasn't Beer O Clock on a Friday I'd package this up on github now, but if there's interest I'll do it sometime later.

enter image description here

The code is here: https://gitlab.com/b-rowlingson/meanline/tree/master - I know you can't run R code easily in ArcGIS but it would not be too hard to convert to Python and run that way.

  • Hi, @spacedman: This seems very interesting. I am wondering where to input the feature layers in your code.
    – user2543
    Apr 9, 2018 at 7:56
  • 1
    @user2543 if you want to run this code you'll need some basic R skills, please file an issue on the issue tracker with details: gitlab.com/b-rowlingson/meanline/issues
    – Spacedman
    Apr 9, 2018 at 14:16
  • Yes, you keep saying that even in main discusssion above. I agree and I understand perfectly. We nee skills. But your code is not simple and I asked for help which forum is all about. So, where do we input the parameters?
    – user2543
    Apr 9, 2018 at 15:16
  • 1
    That was two years ago and nobody has said anything since. Here's what we do: 1. I make the R code better, this can be done if people participate at the github repository by filing issues, comments, etc there. 2. I make the documentation better - again, this process is for github. If you have a question on how to integrate my R code into your GIS of choice then ask a new question on how to run R from [Arc/QGIS/Whatever]
    – Spacedman
    Apr 9, 2018 at 15:48

I needed to produce an average 30-years 200mm Isohyet but only had lines delineating yearly 200mm isohyets. My workflow was as follows:

  1. Creation of a bounding box that is split neatly into two parts by the line features.
  2. Splitting said box with each individual line to create 30 multipolygon features.
  3. Marking all the features of on of the sides (north) with a value 1
  4. Rasterizing all the polygons with an identical extant, cell size and snap.
  5. Summing up all the 30 rasters using Cell Statistics
  6. Conditional statement to identify the median value (15).
  7. polygonizing the end raster and extracting the average isohyet.

Sure, it's cumbersome, but it works, and can be done in 10-15 minutes using a model builder.

In this example, the raster is the sum result with the darkest blue being 30 and darkest red being 0. The black line the resulting average.

enter image description here


DSAS may be incompatible with the users OS or ArcGIS version.
There are a couple of ArcGIS/Python tools out there that may help. Look at the new ArcScripts site or the Geoprocessing tools tool gallery. You may need to do some coding too.

Create perpendicular lines to your shorelines at some appropriate spacing.

Create vertices at the intersections of those perpendicular lines and your many shorelines.

Select all the vertices that intersect perpendicular line 1, and calculate the geometric average of those points. Repeat for perp2.

The geometric average along each perpendicular line is used to construct a new line that represents the average shoreline.


I ended up using DSAS to calculate the average position by using transects that were perpendicular to the shorelines cast from a straight baseline. I then used the linear referencing tool create routes to turn the baseline into a route. As it was needed in that form to allow the use of the make route event layer tool.

The average distances calculated through the transect method were used as the offset values in the linear referencing tool, make route event layer to plot points representing the average position of the shorelines. These points were used to make a new line representing the average shoreline position.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.