Closed ccatter closed 2 months ago
I rerun the algorithm on another computer but didn't solve the problem. I still got the following error message:
QGIS version: 3.36.0-Maidenhead QGIS code revision: 09951dc0 Qt version: 5.15.3 Python version: 3.9.18 GDAL version: 3.8.4 GEOS version: 3.12.1-CAPI-1.18.1 PROJ version: Rel. 9.3.1, December 1st, 2023 PDAL version: 2.6.0 (git-version: 3fced5)
Traceback (most recent call last): File "C:\Users/yehuang/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\preprocessor\uwgprepare_algorithm.py", line 262, in processAlgorithm uwgDict['bldHeight'] = IMP_heights_mean # average building height (m) UnboundLocalError: local variable 'IMP_heights_mean' referenced before assignment
Sorry for late reply. You are supposd to use the file ending with "isotrophic", not anisotrophic.
I supposed it was the meteorological data issue, but it still failed when I tried the tutorial data of Goteborg. I checked the line 1522 of uwg.py and it seems to read latitude and longitude of the meteorological data, which is not in mine nor the tutorial data of Goteborg. Does that mean I need to create these two columns by myself?
Unfortunately we have not been able to write the tutorial for the UWG. The epw-file needs to be in the specific epw-format. I see that you use UMEP-formatted met-files. This cannot be used. Try to locate an epw-file from your area and then combine it with your metdata. We will try to get a working tutorial up for UWG soon.
Many thanks for the explanation. I can run UWG with epw from https://climate.onebuilding.org/ . By the way, I got UMEP-formatted epw from https://www.ladybug.tools/epwmap/ suggested by a Youtube video https://youtu.be/bavT3RFvusE?t=192 . You can close this case now.
I got the following error while using Urban Heat Island: UWGPrepare:
-- QGIS version: 3.34.7-Prizren QGIS code revision: 6f7d735c Qt version: 5.15.13 Python version: 3.12.3 GDAL version: 3.9.0 GEOS version: 3.12.1-CAPI-1.18.1 PROJ version: Rel. 9.4.0, March 1st, 2024 PDAL version: 2.6.3 (git-version: b5523a) Algorithm 'Urban Heat Island: UWG Prepare' starting… Input parameters: { 'CLIMATEZONE' : 6, 'FILE_PREFIX' : 'x', 'ID_FIELD' : 'fid', 'INPUT_LC' : 'C:\Users\uu703\OneDrive - UCL\code\QGIS\LULC_fraction\lulc_LCFG_anisotropic_result_2.txt', 'INPUT_MORPH' : 'C:\Users\uu703\OneDrive - UCL\code\QGIS\morpho\morpho_IMPGrid_anisotropic_2.txt', 'INPUT_POLYGONLAYER' : 'C:/Users/uu703/OneDrive - UCL/code/QGIS/grid.gpkg|layername=grids', 'INPUT_POLYGONLAYERTYPOLOGY' : 'C:/Users/uu703/OneDrive - UCL/code/QGIS/UrbanWindField_URock/building_type.gpkg|layername=building_windfield', 'INPUT_RURAL' : 0.9, 'OUTPUT_DIR' : 'TEMPORARY_OUTPUT' }
Traceback (most recent call last): File "C:\Users/uu703/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\preprocessor\uwgprepare_algorithm.py", line 262, in processAlgorithm uwgDict['bldHeight'] = IMP_heights_mean # average building height (m) ^^^^^^^^^^^^^^^^ UnboundLocalError: cannot access local variable 'IMP_heights_mean' where it is not associated with a value
The issue is related to Urban Morphology, so I also describe it a bit here. I used Urban Morphology: Morphologic Calculator (Grid) with default parameters and input all the DSM/DEM I have (including CDSM) and get the txt results. I don't understand why the average building height was not produced. The files I used listed below: Vector polygon grid: grid.gpkg (ID field: fid) Building type polygon layer: building_type.gpkg Raster DSM (3D objects and ground): building_ground.tif Raster DEM (only ground): ground.tif Raster DSM (only 3D objects ): DSM-DTM_building.tif Raster vegetation DSM (CDSM): vegetation.tif Land Cover: LULC_UMEP_clipped.tif (value 1-7 represent Paved to Water, accordingly) files.zip