@@ -382,11 +382,17 @@ def initAlgorithm(self, config):
382382 def processAlgorithm (self , parameters , context , feedback ):
383383 """
384384 Here is where the processing itself takes place.
385- """
385+ """
386386 bShortterm = self .parameterAsBoolean (parameters , self .SHORT_TERM_SETTLEMENT [0 ], context )
387387 self .logger .info (f"PROCESS - bShortterm value: { bShortterm } " )
388388 bLongterm = self .parameterAsBoolean (parameters , self .LONG_TERM_SETTLEMENT [0 ], context )
389389 self .logger .info (f"PROCESS - bLongterm value: { bLongterm } " )
390+ if not bShortterm and not bLongterm :
391+ error_msg = "Please choose Short term or Long term settlements, or both"
392+ self .logger .error (error_msg )
393+ feedback .reportError (error_msg )
394+ return {}
395+
390396 bVulnerability = self .parameterAsBoolean (parameters , self .VULNERABILITY_ANALYSIS [0 ], context )
391397 self .logger .info (f"PROCESS - bVulnerability value: { bVulnerability } " )
392398 bIntermediate = self .parameterAsBoolean (parameters , self .INTERMEDIATE_LAYERS [0 ], context )
@@ -446,13 +452,6 @@ def processAlgorithm(self, parameters, context, feedback):
446452 self .logger .info (f"PROCESS - JSON structure: { source_tunnel_poly_as_json } " )
447453
448454 feedback .setProgress (30 )
449-
450- if not bShortterm and not bLongterm :
451- error_msg = "Please choose Short term or Long term settlements, or both"
452- self .logger .error (error_msg )
453- feedback .reportError (error_msg )
454- return {}
455-
456455 if bShortterm :
457456 tunnel_depth = self .parameterAsDouble (parameters , self .TUNNEL_DEPTH [0 ], context )
458457 tunnel_diameter = self .parameterAsDouble (parameters , self .TUNNEL_DIAM [0 ], context )
@@ -463,14 +462,14 @@ def processAlgorithm(self, parameters, context, feedback):
463462 tunnel_diameter = None
464463 volume_loss = None
465464 trough_width = None
466-
465+
466+ source_raster_rock_surface = self .parameterAsRasterLayer (parameters , self .RASTER_ROCK_SURFACE [0 ], context )
467+ self .logger .info (f"PROCESS - Rock raster DTM: { source_raster_rock_surface } " )
467468 if bLongterm :
468469 self .logger .info (f"PROCESS - ######## LONGTERM ########" )
469470 self .logger .info (f"PROCESS - Defining long term input" )
470471
471472 ############### HANDELING OF INPUT RASTER ################
472- source_raster_rock_surface = self .parameterAsRasterLayer (parameters , self .RASTER_ROCK_SURFACE [0 ], context )
473- self .logger .info (f"PROCESS - Rock raster DTM: { source_raster_rock_surface } " )
474473 if source_raster_rock_surface is not None :
475474 ############### RASTER REPROJECT ################
476475 if reproject_is_needed (source_raster_rock_surface , output_proj ):
@@ -499,7 +498,7 @@ def processAlgorithm(self, parameters, context, feedback):
499498 porewp_calc_type_english = self .CURVES_enum_porepressure [porepressure_index ]
500499 porewp_calc_type = map_porepressure_curve_names (porewp_calc_type_english )
501500 tunnel_leakage = self .parameterAsDouble (parameters , self .TUNNEL_LEAKAGE [0 ], context )
502- porewp_red_at_site = self .parameterAsDouble (parameters , self .POREPRESSURE_REDUCTION [0 ], context )
501+ porewp_red_at_site = self .parameterAsInt (parameters , self .POREPRESSURE_REDUCTION [0 ], context )
503502 dry_crust_thk = self .parameterAsDouble (parameters , self .DRY_CRUST_THICKNESS [0 ], context )
504503 dep_groundwater = self .parameterAsDouble (parameters , self .DEPTH_GROUNDWATER [0 ], context )
505504 density_sat = self .parameterAsDouble (parameters , self .SOIL_DENSITY [0 ], context )
@@ -543,7 +542,8 @@ def processAlgorithm(self, parameters, context, feedback):
543542 ################# LOG PROJECTIONS #################
544543 feedback .pushInfo (f"PROCESS - CRS BUILDINGS-vector: { source_building_poly .crs ().postgisSrid ()} " )
545544 feedback .pushInfo (f"PROCESS - CRS EXCAVATION-vector: { source_tunnel_poly .crs ().postgisSrid ()} " )
546- feedback .pushInfo (f"PROCESS - CRS DTB-raster: { source_raster_rock_surface .crs ().postgisSrid ()} " )
545+ if source_raster_rock_surface is not None :
546+ feedback .pushInfo (f"PROCESS - CRS DTB-raster: { source_raster_rock_surface .crs ().postgisSrid ()} " )
547547
548548 ###### FEEDBACK ALL PARAMETERS #########
549549 feedback .pushInfo ("PROCESS - Running mainBegrensSkade_Excavation..." )
0 commit comments