I have a line feature with elevation value, I need to extract a point along the line where its slope percentage is out of the range (-0.05 to 0.05), what I tried was I created a number of points by featureverticestopoint with all option, I got a big point data, then I tried to compare slope from one point to the other but I could not come up which point are out of the range, to keep their location, I need a python script, that loop each slope from point to point.
I can think of an exploratory tool
Profile graph—Charts | ArcGIS Desktop
and one to extract the data itself from a slope map by densifying a polyline at the point density you want,
and convert it to points, then
Feature To Point—Data Management toolbox | ArcGIS Desktop with the vertices option
or
Generate Points Along Lines—Data Management toolbox | ArcGIS Desktop
then
Thanks Dan Patterson, your input is helpful all the time , but I need to go further, please refer drawing
The intention is to find out which point has slope percentage out of the range (-0.05 to 0.05), if the average slope from p1 to p2 is in the range “pass or ignore”, and compare p1 to p3 if the slope within the range, jump to compare p1 to p4 if the slope is out of the range, record p4 as deflation point, then start compare from p4 to p5, if it is within the range pass, compare p4 to p6 if it is out of the range record p6 and then again start from p6, and compare p6 to p7 so on….the deflation point will be the starting point for comparison with the next point, if we have millions of points how we can automate using python.
Kunom, that is a different beast.
The 'slope' you will be calculating isn't the slope that you would get from performing a slope analysis on a raster.
What you need to do is get the X, Y, and Z (ie elevations) at your points of interest.
You then convert the sequential X, Y values to a distance from the origin, which is P1 in your figure.
P2, etc are some distance from P1 etc etc.
The denser the point network along your line, the finer the gradient you can calculate.
Essentially if your points are sequential in a table, then the calculation can be made as a first pass by calculating the differential slope between points.
ie (Z2-Z1)/d1 where Z is elevation and 'd' is the distance.
so generically, (Zn - Zn-1)/dn
Those are your first order differences. Find the break where the values are out of range, if any.
Do you have the X, Y and Z values in tabular form... or a facsimile of your data that you could post?
I could demonstrate the sequential calculations.
And I presume by millions of points... you mean in one file? or many files? Doesn't really matter except for the number of times that the process needs to be done. (I don't need a million for now, just a reasonable sample)
A simple demo
If this help
OBJECTID | X | Y | Z |
1 | -9912775 | 4941760 | 799.2415 |
2 | -9912775 | 4941761 | 799.2293 |
3 | -9912776 | 4941762 | 799.2181 |
4 | -9912777 | 4941763 | 799.2112 |
5 | -9912778 | 4941764 | 799.209 |
6 | -9912778 | 4941765 | 799.2097 |
7 | -9912779 | 4941766 | 799.2114 |
8 | -9912780 | 4941767 | 799.2168 |
9 | -9912781 | 4941769 | 799.2236 |
10 | -9912781 | 4941770 | 799.2313 |
11 | -9912782 | 4941771 | 799.2404 |
12 | -9912783 | 4941772 | 799.2533 |
13 | -9912783 | 4941773 | 799.2662 |
14 | -9912784 | 4941774 | 799.2735 |
15 | -9912785 | 4941775 | 799.2767 |
16 | -9912785 | 4941776 | 799.2816 |
17 | -9912786 | 4941778 | 799.2919 |
18 | -9912787 | 4941779 | 799.3056 |
19 | -9912787 | 4941780 | 799.3157 |
20 | -9912788 | 4941781 | 799.3154 |
21 | -9912788 | 4941782 | 799.3109 |
22 | -9912789 | 4941782 | 799.3076 |
23 | -9912789 | 4941783 | 799.2908 |
24 | -9912790 | 4941784 | 799.2706 |
25 | -9912790 | 4941786 | 799.2495 |
26 | -9912791 | 4941787 | 799.2285 |
27 | -9912792 | 4941788 | 799.2075 |
28 | -9912792 | 4941789 | 799.1864 |
29 | -9912793 | 4941790 | 799.1654 |
30 | -9912794 | 4941791 | 799.1443 |
31 | -9912794 | 4941793 | 799.1233 |
32 | -9912795 | 4941794 | 799.1023 |
33 | -9912795 | 4941795 | 799.0812 |
34 | -9912796 | 4941796 | 799.0602 |
35 | -9912797 | 4941797 | 799.0404 |
36 | -9912797 | 4941797 | 799.0391 |
37 | -9912797 | 4941798 | 799.0181 |
38 | -9912798 | 4941800 | 798.9971 |
39 | -9912799 | 4941801 | 798.976 |
40 | -9912799 | 4941802 | 798.955 |
41 | -9912800 | 4941803 | 798.9342 |
42 | -9912800 | 4941804 | 798.9146 |
43 | -9912801 | 4941805 | 798.8954 |
44 | -9912802 | 4941807 | 798.8756 |
45 | -9912802 | 4941808 | 798.8538 |
46 | -9912803 | 4941809 | 798.8242 |
47 | -9912804 | 4941810 | 798.7867 |
48 | -9912804 | 4941811 | 798.7425 |
49 | -9912805 | 4941812 | 798.6963 |
50 | -9912805 | 4941813 | 798.683 |
51 | -9912805 | 4941813 | 798.653 |
52 | -9912806 | 4941815 | 798.6123 |
53 | -9912807 | 4941816 | 798.5735 |
54 | -9912807 | 4941817 | 798.5344 |
55 | -9912808 | 4941818 | 798.4982 |
56 | -9912809 | 4941819 | 798.4673 |
57 | -9912809 | 4941820 | 798.4457 |
58 | -9912810 | 4941822 | 798.4284 |
59 | -9912810 | 4941823 | 798.4145 |
60 | -9912811 | 4941824 | 798.4006 |
61 | -9912811 | 4941825 | 798.39 |
62 | -9912812 | 4941825 | 798.3826 |
63 | -9912812 | 4941826 | 798.3574 |
64 | -9912813 | 4941827 | 798.3253 |
65 | -9912814 | 4941829 | 798.2879 |
66 | -9912814 | 4941830 | 798.2465 |
67 | -9912815 | 4941831 | 798.2021 |
68 | -9912815 | 4941832 | 798.1575 |
69 | -9912816 | 4941833 | 798.1141 |
70 | -9912817 | 4941834 | 798.0771 |
71 | -9912817 | 4941835 | 798.0486 |
72 | -9912818 | 4941837 | 798.0263 |
73 | -9912819 | 4941838 | 798.0092 |
74 | -9912819 | 4941839 | 797.9945 |
75 | -9912820 | 4941840 | 797.98 |
76 | -9912821 | 4941841 | 797.9674 |
77 | -9912821 | 4941842 | 797.962 |
78 | -9912822 | 4941843 | 797.9667 |
79 | -9912823 | 4941845 | 797.9784 |
80 | -9912823 | 4941846 | 797.99 |
81 | -9912824 | 4941847 | 797.998 |
82 | -9912825 | 4941848 | 798.0028 |
83 | -9912825 | 4941849 | 798.0045 |
84 | -9912826 | 4941850 | 798.002 |
85 | -9912827 | 4941851 | 797.9969 |
86 | -9912828 | 4941852 | 797.9919 |
87 | -9912828 | 4941854 | 797.9875 |
88 | -9912829 | 4941855 | 797.9814 |
89 | -9912830 | 4941856 | 797.9724 |
90 | -9912830 | 4941857 | 797.9611 |
91 | -9912831 | 4941858 | 797.9479 |
92 | -9912832 | 4941859 | 797.9317 |
93 | -9912833 | 4941860 | 797.9119 |
94 | -9912833 | 4941861 | 797.8921 |
95 | -9912834 | 4941862 | 797.8757 |
96 | -9912835 | 4941863 | 797.8628 |
97 | -9912835 | 4941865 | 797.851 |
98 | -9912836 | 4941866 | 797.8403 |
99 | -9912837 | 4941867 | 797.8343 |
100 | -9912838 | 4941868 | 797.8315 |
101 | -9912838 | 4941869 | 797.8311 |
102 | -9912839 | 4941870 | 797.8284 |
103 | -9912840 | 4941871 | 797.8216 |
104 | -9912841 | 4941872 | 797.8121 |
105 | -9912842 | 4941873 | 797.8044 |
106 | -9912842 | 4941874 | 797.8014 |
107 | -9912843 | 4941875 | 797.8087 |
108 | -9912844 | 4941876 | 797.8206 |
109 | -9912845 | 4941877 | 797.8306 |
110 | -9912845 | 4941878 | 797.8365 |
111 | -9912846 | 4941880 | 797.8416 |
112 | -9912847 | 4941881 | 797.8509 |
113 | -9912848 | 4941882 | 797.8697 |
114 | -9912849 | 4941883 | 797.8926 |
115 | -9912849 | 4941884 | 797.9158 |
116 | -9912850 | 4941885 | 797.9366 |
117 | -9912851 | 4941886 | 797.9515 |
118 | -9912852 | 4941887 | 797.9579 |
119 | -9912852 | 4941888 | 797.9564 |
120 | -9912853 | 4941889 | 797.9519 |
121 | -9912854 | 4941890 | 797.9506 |
122 | -9912855 | 4941891 | 797.9586 |
123 | -9912856 | 4941892 | 797.9795 |
124 | -9912856 | 4941893 | 798.0113 |
125 | -9912857 | 4941894 | 798.0506 |
126 | -9912858 | 4941895 | 798.089 |
127 | -9912859 | 4941896 | 798.1145 |
128 | -9912860 | 4941898 | 798.1302 |
129 | -9912860 | 4941899 | 798.1413 |
130 | -9912861 | 4941900 | 798.1485 |
131 | -9912862 | 4941901 | 798.1525 |
132 | -9912863 | 4941902 | 798.1537 |
133 | -9912863 | 4941903 | 798.154 |
134 | -9912865 | 4941905 | 798.154 |