[Manifold-l] Need some help with lines and slopes

JBurn_GIS jburn_gis at cogeco.ca
Tue Oct 3 22:26:06 CDT 2006


Dimitri makes a good point (as usual;-) in that the method I described give the slope between points, and not necessarily of the surface.  Sort of a slope "how the worm digs" so to speak.  Technically, if you added more points, so you have "lots" of points traversing the length of the line, these could then be combined or looked at separately.

For one job, for example, I have a bunch of points that all line up for about 200 meters.  Looking at the slope values though, one can see that the slope actually goes from a 5% grade, to a 10% grade to a 7% grade over the 200m distance.  For that particular task, I grouped the points by rounded grade, and created the line segments appropriately, so instead of one 200m line at an averaged (ok, average isn't the right word) grade, I had three at their individual slopes.

Cheers.

---------------
James Burn BSc, GIS(pg), AScT
  ----- Original Message ----- 
  From: Dimitri Rotow 
  To: 'Manifold List Server' 
  Sent: Tuesday, October 03, 2006 7:41 PM
  Subject: RE: [Manifold-l] Need some help with lines and slopes



  > I have a map with two drawings, a surface where I can run my 
  > mouse cursor over and it will report a z-value, and an empty 
  > drawing.  I would like to draw a segmented line on the empty 
  > drawing layer and get back the length and slope of the line 
  > based on the underlying z-values.  I can seem to figure out 
  > if this is a spatial or topology overlay problem.  The 
  > transfer heights transform only returns the height (sum, 
  > average, ... ) of the centroid of the line.  Any suggestions 
  > on how to approach this problem would be appreciated.

  You'll have to script either of these.  The two tasks are related as they
  are both riffs on computing elementary values of a right triangle.

  First, though, let's consider the "slope" of the line.  A line traversing an
  irregular surface will have no single slope value.  Consider, for example, a
  road that goes up a hill and then down a hill.  There's no one "slope" to
  that road. There may be a slope for any one straight line segment, and you
  might compute an "average" slope by an arithmetic aggregation of slopes for
  individual line segments that comprise the polyline, but if you want to
  attach just one "slope" number to the line you are going to have to decide
  what sort of approximation or aggregation you want that number to be.

  To get the 3D length of a line you first decompose it into individual line
  segments.  You know the height of both ends of each segment, so you know the
  difference in height between the segments.  You know the length of the line
  segment.  Using the Pythagorean formula you can find the length of the
  hypoteneuse given the length of the base of a right-angle triangle (the
  length of the line segment) and the height of the triangle (the difference
  in z of the end points).  Add the hypoteneuse lengths of all the line
  segments for the line to get the length of the line.

  You could use a similar process to compute the slope of each segment.  You
  know the length of the segment and the difference in heights and even (from
  the above) the length of the hypotenuse.  It's therefore a simple
  calculation to get the value of the acute angle between the base and the
  hypoteneuse.  Once you have the slope for each line segment you can decide
  how you want to aggregate them to get some sort of average or combined slope
  for the line.

  You could simplify the script by doing some manual work.  For example,
  create points at each coordinate of a line and then transfer heights from
  the surface to each point. This and suitable "flag" attributes used wisely
  will simplify the scripts. 

  Cheers,

  Dimitri

  _______________________________________________
  Manifold-l mailing list
  Manifold-l at lists.directionsmag.com
  http://www.directionsmag.com/mailman/listinfo/manifold-l
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.directionsmag.com/pipermail/manifold-l/attachments/20061003/b8aee209/attachment.htm


More information about the Manifold-l mailing list