Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The problem I'm trying to solve is to find a point on a line given another point on the same line and a distance from the same point. I've been looking on the various RouteTask examples but they mostly tackle the problem of finding a route given two points. Can anyone advise if RouteTask is the right approach for this kind of problem, and how do I do it?


share|improve this question

You can find the second point given a line, starting point, and distance using the GeometryService. The method you use depends on whether you want absolute distance from the starting point (as the crow flies), or traveling distance.

Absolute Distance (as the crow flies)

  1. Create a Buffer around the starting point that's the distance you want.
  2. Convert the edge of the buffer polygon into a polyline
  3. Intersect the line in question with the buffer edge polyline to get the end point

Travelling Distance

  1. Break up a line by its vertices into individual line segments.
  2. Use a Lengths calculator to find the length of each line segment
  3. Starting from the beginning, deduct the length of each line segment from the length you want, until there's more length in a segment than in the remaining total.
  4. Break the last segment into by the fractional distance remaining to make the entire line the length you require.
  5. Find the point on the end of that line. That's your destination.

Here's a link to a jsFiddle I put together for the travelling distance calculator. you draw a line, and it cuts it off at the 5 mile mark. See it here.

share|improve this answer
Thank you, ray. Very helpful approaches. – NeoJigglypuff Nov 21 '13 at 12:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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