Advertisement
adrianwii

Untitled

May 23rd, 2023
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. def internalViewshedAlgorithm(self,n,analysis_type,dem,precision,miss_params,item):
  2.  
  3.         # if feedback.isCanceled():  break
  4.  
  5.          
  6.  
  7.         matrix_vis = ws.viewshed_raster (analysis_type, value, dem,
  8.  
  9.                                         interpolate = precision > 0)
  10.  
  11.  
  12.  
  13.  
  14.         # must set the mask before writing the result!
  15.  
  16.         mask = [item[1]["radius"]]
  17.  
  18.  
  19.  
  20.  
  21.         inner_radius_specified = "radius_in" not in miss_params
  22.  
  23.         if inner_radius_specified:
  24.  
  25.             mask += [ item[1]["radius_in"] ]
  26.  
  27.  
  28.  
  29.  
  30.         if  "azim_1" not in miss_params and  "azim_2" not in miss_params:
  31.  
  32.             if not inner_radius_specified:
  33.  
  34.                 mask += [ None ]
  35.  
  36.             mask += [ item[1]["azim_1"], item[1]["azim_2"] ]
  37.  
  38.             print (mask)
  39.  
  40.  
  41.  
  42.  
  43.         dem.set_mask(*mask)
  44.  
  45.  
  46.  
  47.  
  48.         r = dem.add_to_buffer (matrix_vis, n, report = True)
  49.  
  50.        
  51.  
  52.        
  53.  
  54.         report.append([item[1]["id"],*r])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement