Finding set of points with given difference in elevation and max distance apart.

491
3
12-04-2018 01:30 PM
LukeHall
New Contributor

Hi all, 

Bit of a noob here so bare with me, love to be pointed to other questions relating to this if they are out there.

I am using a DEM and need to find locations (sets of two points) within the map that have a difference of elevation of >200m and are at maximum 2000m apart in distance on the x-y plane (along the ground). It is a large file with many points and I will need to read all the datapoints to find all the locations where the above conditions are true (i.e. I'm not just running the model for a specific set of pre-defined points in a shape file). I will then need to apply other filters to this data to look for certain locations, but a good start would be to be able to find the points where the elevation and distance conditions are true.

Would appreciate any pointers or help with this one.

0 Kudos
3 Replies
curtvprice
MVP Esteemed Contributor

I don't see how you could choose pairs of points (grid cells) that meet this criterion. For example, using a map algebra expression, one could select all cells within 2000m from a center cell that are 200m different  from center cell, but there are likely to be many more than two!

Could you explain what your use case, maybe that will help the community think about how to solve your spatial problem.

LukeHall
New Contributor

Hi Curtis, so the use of the case is for a pumped hydro project where you will have two dams with an elevation difference of 200m or more within 2km of each other, so we would need to find a location where these two points are valid. 

You will get many 'sets' of two points that would represent appropriate locations for the project. The complication I have here is that we aren't looking for all possible points from 1 centre set point and calculating these, we are looking for all possible points from all possible set points (i.e. creating the pairs)

0 Kudos
DanPatterson_Retired
MVP Emeritus

have you extracted the elevation to the points?

Extract Values to Points—Help | ArcGIS Desktop 

That would give you that data at least.

Is there a chance that you could also add the X, Y coordinates to the table so that you have X, Y and Z

Add XY Coordinates—Data Management toolbox | ArcGIS Desktop 

And I forgot to mention, You need to be using projected coordinates to simplify things (ie UTM or some other suitable planar coordinate system... but not Web Mercator)

I can see how to create a distance matrix that you could query for your threshold distance.  After that is determined, then you need to determine the delta Z for the associated point pairs.

coords  # ---- some random coordinates

array([[278, 236],
       [ 98, 969],
       [807, 380],
       [924, 526],
       [232, 828],
       [816, 918],
       [797, 361],
       [167, 912],
       [112, 804],
       [396, 609]])

# ---- produce an upper matrix of the coordinate distances, each coordinate to the other

m = np.triu(e_dist(coords, coords))  # ---- a function I can provide

w = np.where(m > 700)  # ---- query for the threshold distance that is the minimum separation

f = coords[w[0]]; t= coords[w[1]]  # ---- pull out the row/column pairs

ft = np.hstack((f, t))  # ---- create the coordinate pairs

m
Out[475]: 
array([[  0.  , 754.78, 548.25, 708.11, 593.78, 868.66, 533.84, 685.05, 591.76, 391.22],
       [  0.  ,   0.  , 921.74, 937.3 , 194.52, 719.81, 926.43,  89.5 , 165.59, 467.34],
       [  0.  ,   0.  ,   0.  , 187.1 , 728.92, 538.08,  21.47, 832.24, 814.13, 470.49],
       [  0.  ,   0.  ,   0.  ,   0.  , 755.03, 406.61, 208.22, 849.73, 858.27, 534.48],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  , 590.89, 733.02, 106.21, 122.38, 273.6 ],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  , 557.32, 649.03, 713.17, 521.42],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  , 836.96, 815.77, 471.49],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  , 121.2 , 379.8 ],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  , 344.5 ],
       [  0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ,   0.  ]])

ft  # from x, y and to x, y
array([[278, 236,  98, 969],
       [278, 236, 924, 526],
       [278, 236, 816, 918],
       [ 98, 969, 807, 380],
       [ 98, 969, 924, 526],
       [ 98, 969, 816, 918],
       [ 98, 969, 797, 361],
       [807, 380, 232, 828],
       [807, 380, 167, 912],
       [807, 380, 112, 804],
       [924, 526, 232, 828],
       [924, 526, 167, 912],
       [924, 526, 112, 804],
       [232, 828, 797, 361],
       [816, 918, 112, 804],
       [797, 361, 167, 912],
       [797, 361, 112, 804]])

# ---- all you need is elevation to go with the points.
0 Kudos