UMEP-dev / UMEP-processing

7 stars 9 forks source link

Urban Morphology: Morphometric Calculator (Grid) - Error when running with only 3D Building or vegetation #37

Closed gusbacos closed 10 months ago

gusbacos commented 10 months ago

Umep-processing version: 2.0.9

Urban Morphology: Morphometric Calculator (Grid) gives issue when running with only 3D Building or vegetation

File "C:\Users/xbacos/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\preprocessor\imagemorphparms_algorithm.py", line 365, in processAlgorithm cdsm_array[cdsm_array == ndCDSM] = -9999 UnboundLocalError: local variable 'cdsm_array' referenced before assignment

Workarorund could be to set an if statement at line 365


if cal == 1:
    #set nodata to same
    dsm_array[dsm_array == nd] = -9999
    dem_array[dem_array == ndDEM] = -9999
    if calcSS:
        cdsm_array[cdsm_array == ndCDSM] = -9999

    #calculate morphometric params
biglimp commented 10 months ago

Good idea.