Marchowes / pyProm

Surface Network Analyzer.
BSD 3-Clause "New" or "Revised" License
6 stars 2 forks source link

0.7.0 overhaul #143

Open Marchowes opened 5 years ago

Marchowes commented 5 years ago

Critical flaws have been found when recalculating saddles (From large multipoints). As well as walks from both multipoint and single point saddles.

Walk Issue: From single points, we need to walk from all high edges, not just the highest point of the high edge. LiDAR data analysis has exposed this as a critical flaw in the current algorithm.

Recalculated Multipoint Saddles: The critical flaw here is that recalculating relies on finding the closest point across the Multipoint -- which in effect tosses out all other high edges. Because we need to walk up from all high shores this problem cannot be reconciled.


(Partial) Solution:

Discovery logic will continue to look for Saddles, and Summits. When a Saddle is found an uphill walk will be initiated from ALL high shores. Saddle discovery logic can thus be preserved. This in effect eliminates a certain amount of points available to feature scanning

(what if walk goes through saddle? is this possible?) (what if walk goes through unexplored high shore?)

(what about edge features?)

Marchowes commented 4 years ago

WIP

Objects: Transitory_Multipoint() { -Points -HighShores(points) -EntryPoints findClosestHighEdge()

Functions:

Climb(gridpoint) return Summit_Domain

gridpoint = (x, y, ele) tuple

climbedPoints = list(gridpoint) current_point = gridpoint LOOP run steepestneighbor finder. If steepestneighbor.elevation == current_point.elevation { -check multipoint_transient hash --If its there, run "findclosest" from Transitory_Multipoint and return the result. -Run Climb_points(entryPoint=current_point) -Add points to returned Summit_Domain -Return Summit_Domain } If steepestneighbor in explored { -Add points to Summit_Domain in explored -Summit_Domain should have an append fn() that accepts an explored[x][y] and adds to it. return Summit_Domain } if steepestneighbor.elevation > current_point.elevation { climbedPoints.append(steepestneighbor) }

Climb_points(points, entryPoint=None) multipoint = None summit_domains = set() if entryPoint { -run equalHeightAlgorithm -Result will be MultiPoint. -run the findHighEdges() on Perimeter object. -populate multipoint = result -populate points = multipoint.points.

assert we only have one highshore. } LOOP through points run climb() on all points add returned summit_domain to summit_domains add point to exploredPoints with Summit_Domain (Or not, Climb() should do that for us) END LOOP

if entryPoint != None { if len(summit_domains > 1) { -Produce Transitory_Multipoint() object with points and hs points, and The entrypoint -populate multipoint_transient hash with multipoint points. and Transitory_Multipoint() -calculate path through multipoint and add to equalheight (How? maybe do this when post processing the Transitory_Multipoints? Yeah, probably) --populate exploredPoints with Summit_Domain (if we do that thing) -return the summit_domain of the closest hs to the entryPoint } if len(summit_domains == 1) { -No need to save a Transitory_Multipoint() -populate exploredPoints with all multipoint points & Summit_Domain -return Summit_Domain } } if entryPoint == None { return summit_domains }

Caller:

WalkFromSaddle()

exploredPoints[x][y]=Summit_Domain() -populate with all runoff/summits member points.

multipoint_transient[x][y]=Transitory_Multipoint()

LOOP over Saddles saddle_domains=set() LOOP over hs saddle_domains.append(Climb_points(hs)) END LOOP over hs

WRITE THIS PART

END LOOP over Saddles