[Manifold-l] Need some help with lines and slopes
JBurn_GIS
jburn_gis at cogeco.ca
Tue Oct 3 22:20:32 CDT 2006
A couple of thoughts come to mind involving spatial SQL.
First, the set up:
Don't bother with the actual line at this time, just draw your the individual inflection points in the order of how your line direction will move. So you should have a surface and a point drawing, with the points in a "from-to" order. Now transfer your heights to those points. You should now have points in a proper order that have Z values. Please note that the KEY to this method is that your points are in a good logical order.
Now, assign an ID number in a sequential order to your points. Now for the spatial SQL part. The following is an example of some SQL that I used to perform a similar task:
select
[point drawing].[Geom (I)],
[point drawing].[ID] as [from],
[point drawing].[Z value] as [from z],
[Copy].[ID] as [to],
[Copy].[Z value] as [to z],
(([Copy].[Z value] - [point drawing].[Z value])/(Distance([point drawing].[ID], [Copy].[ID]))) as slope,
([Copy].[Z value] - [point drawing].[Z value]) as [Difference]
into [new table]
from [point drawing], [point drawing] as [Copy]
where ([point drawing].[ID] + 1) = [Copy].[ID]
Ok, running though it. Note that I have used only one table, but selected it twice calling it "copy" the second time. Sort of a "virtual table" if you will. I'm linking the table and its "virtual" self with ID and ID+1. This causes the equasions to happen between a point and the next point in order (hence the importance of getting them ordered correctly at the start). Then I start doing some basic math and SQL selections in terms of selecting the Geom (so I can re-make my points later), my ID, Z value, slope (rise over run), and note that it is using the actual distance between the points. In the end, you should end up with a new table (with a geom field) that contains the "from" ID and Z value, the "to" ID and Z value which is gathered from the next point in the sequence, the difference between the two, and the slope as solved by z"-z'/distance. The results of the above query look something like this in CSV format:
Geom (I), from, from z, to, to z, slope, Difference
<geom, point>, 733419, 754.29, 733420, 754.29, 0.00, 0.00
<geom, point>, 733420, 754.29, 733421, 754.26, -0.00, -0.03
<geom, point>, 733421, 754.26, 733422, 754.18, -0.01, -0.08
<geom, point>, 733422, 754.18, 733423, 754.13, -0.01, -0.05
Since we carried the Geom(I) field, you can now easily conver this to a point drawing where each point will have the slope and difference between "it" and the next point, which could in turn be pushed on to a corresponding line segment via spatial overlay.
Hope that helps a little, or at least gives you some ideas.
Cheers.
---------------
James Burn BSc, GIS(pg), AScT
----- Original Message -----
From: lkong at engenious.com
To: Manifold List Server
Sent: Monday, October 02, 2006 9:30 PM
Subject: [Manifold-l] Need some help with lines and slopes
Hi:
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.
Thanks
Lenny
_______________________________________________
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/883d8bd4/attachment.htm
More information about the Manifold-l
mailing list