In the map below I have 66 (green) points along the midpoint (0.5) for an allele frequency cline across the region (see map). I created the points by placing a point every 25 km along the 0.5 allele frequency contour. The thick red lines represent the 0.22 and 0.78 allele frequency contours. I would like to estimate the width of the cline at each of the 66 points. The "estimated" width should be based on the shortest distance between the two contours when the line runs through the point. This would allow me to compare the cline width at 25 km increments.

enter image description here

The result would look something like the map below. Note that I hand-drew only of 3 of the 66 desired lines and my lines are probably not the shortest distance between the two contours for each of the 3 points. Each of the line must be a straight and unbroken (i.e. no bend at the point). I would also get the total distance of the line, plus the distance for each segment (0.22 to 0.5 and 0.5 to 0.78).

enter image description here

This is a map created using the "Near" function with my points as the "input feature" and contours as the "near feature". I created the map by running the near function for each contour separately. As you can see the map is not quite right. Any other suggestions?

enter image description here

  • 1
    It is hard to understand what is needed here. First, a "point" cannot be "bisected." Second, what is a "trait contour"? (It's probably not the coastal outline or the country boundaries, but is it one of the solid thick gray lines? Or perhaps the sequence of dots?) At the end, to what do you refer where you write "each point"? These ambiguities allow so many different interpretations it's anybody's guess what you want to do. Could you please clarify this? (A simple diagram of what the solution would look like might help immensely.)
    – whuber
    May 4, 2012 at 14:33
  • 1
    Well done--that is a very helpful clarification. May I follow up, though, by asking why you seek the shortest distance along line (segments) through the points? Conceptually, these three curves represent a continuous surface. In many applications it would be natural to measure widths in terms of distances along curves orthogonal to the clines: that is, in directions that are always parallel to the gradient of the surface. Are you using line segments to approximate such curves? Or is it truly important that widths be measured along straight lines only?
    – whuber
    May 4, 2012 at 15:16
  • Another point of clarification: when a "line runs through a point" must it be a straight unbroken line segment, or do you mean "line" in the more general sense of a polyline that could potentially bend at the point?
    – whuber
    May 4, 2012 at 15:19
  • The allele cline is a continuous surface and you are absolutely correct that measuring the widths between curves would be ideal. I had searched the literature and could not find a way to do just what you described, so I thought my alternative method would be the best way to demonstrate the heterogeneity of the cline surface. In hybrid zone theory it is traditional to calculate the wdith of the cline as the distance between to 0.22 and 0.78 frequencies. Yes, I mean a straight unbroken line (i.e. no bend at the point). May 4, 2012 at 15:28
  • Do you perhaps have the data in a fully gridded form (from which these two clines were extracted)?
    – whuber
    May 4, 2012 at 15:30

1 Answer 1


By changing your requirements just a little bit this is easy to do. Instead of defining the width at a central green point be the length of the shortest segment passing through that point and intersecting both contours, let the width be the sum of the distances from that point to the two contours. This is a reasonable definition of width and will qualitatively agree with the first one.

The solution is to extract the values of the sum of the Euclidean distance grids for the two contours. That's just four operations: two Euclidean distance calculations, a sum, and extracting the values at the green points.

I can provide a partial illustration derived from the image. Here is a relief plot of the sum of distances to the red contours (cut off at a sum of about 400 pixels):


Although I don't have a vector layer of the point locations, I can extract the green pixels from the image and plot the widths (i.e., the distance sums) as those pixels are encountered in a vertical sweep from top to bottom:


In the actual application the points would be ordered by their position along the central (green) transect and this would be a profile of the widths at those points.

  • I read your proposal and it seems very practical. How do I learn to do your method? I use ArcGIS 10 with all the plugins and I use R. Feb 16, 2013 at 19:17
  • Hi, Keith: apply Euclidean Distance separately to the two contour boundaries; sum them; and then use any version of Extract values to points (or even zonal statistics) to read off the results.
    – whuber
    Feb 16, 2013 at 19:37

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.