UMEP-dev / UMEP-processing

GNU General Public License v3.0
7 stars 9 forks source link

Error when running TARGET Prepare #90

Closed jixuan-chen closed 2 weeks ago

jixuan-chen commented 2 weeks ago

I was trying out the tutorial and got a bit stuck at this step. Below is the error message.


QGIS version: 3.34.10-Prizren QGIS code revision: 113de9e1 Qt version: 5.15.13 Python version: 3.12.5 GDAL version: 3.9.2 GEOS version: 3.12.2-CAPI-1.18.2 PROJ version: Rel. 9.4.0, March 1st, 2024 PDAL version: 2.6.3 (git-version: b5523a) Algorithm started at: 2024-11-05T15:06:58 Algorithm 'Urban Heat Island: TARGET Prepare' starting… Input parameters: { 'FRAC_CONC' : 0.25, 'FRAC_IRR' : 0.2, 'ID_FIELD' : 'id', 'INPUT_LC' : 'C:\Users\jxche\Downloads\GBG_torgg_3006\temp\torggland_LCFG_isotropic.txt', 'INPUT_MORPH' : 'C:\Users\jxche\Downloads\GBG_torgg_3006\temp\torggbuild_IMPGrid_isotropic.txt', 'INPUT_POLYGONLAYER' : 'C:/Users/jxche/Downloads/GBG_torgg_3006/gbgcity_grid_300m.shp', 'OUTPUT_DIR' : 'C:\Users\jxche\Downloads\GBG_torgg_3006\temp\TARGET', 'SITE_NAME' : 'GBGMay', 'UMEP_LC' : True }

Number of grids to process: 20 Error! Raster projection is not in meters or feet. Please reproject. Execution failed after 0.04 seconds

Loading resulting layers Algorithm 'Urban Heat Island: TARGET Prepare' finished

The project and all the data are in EPSG:3006. I guess there's something wrong with the morphology output but I don't know why, the output looks like:

id pai fai zH zHmax zHstd zd z0 wai 1 0.002 0.000 4.454 4.984 0.548 3.118 0.445 0.001 2 0.009 0.002 6.844 9.333 1.264 4.791 0.684 0.004 3 0.185 0.124 21.599 61.605 8.593 15.119 2.160 0.239 4 0.391 0.275 17.511 98.478 7.830 12.258 1.751 0.412 5 0.096 0.031 19.199 36.544 6.797 13.439 1.920 0.070 6 0.342 0.241 14.460 38.373 5.843 10.122 1.446 0.313 7 0.489 0.339 18.036 35.760 5.314 12.625 1.804 0.494 8 0.440 0.295 16.508 45.007 6.114 11.556 1.651 0.456 9 0.320 0.108 20.109 36.952 6.313 14.076 2.011 0.237 10 0.508 0.276 16.511 53.231 5.576 11.558 1.651 0.419 11 0.685 0.290 15.728 52.401 3.913 11.009 1.573 0.460 12 0.190 0.066 15.616 25.223 4.281 10.932 1.562 0.131 13 0.232 0.054 19.449 37.968 8.804 13.614 1.945 0.127 14 0.585 0.259 16.865 42.623 6.623 11.806 1.687 0.366 15 0.457 0.268 16.226 30.515 3.771 11.358 1.623 0.339 16 0.147 0.073 15.536 28.856 6.387 10.875 1.554 0.136 17 0.054 0.008 8.024 23.748 4.710 5.617 0.802 0.023 18 0.244 0.175 17.622 45.248 9.125 12.335 1.762 0.227 19 0.099 0.047 9.862 37.204 5.099 6.903 0.986 0.084 20 0.119 0.053 15.323 34.240 7.384 10.726 1.532 0.111

biglimp commented 2 weeks ago

Very strange error since no raster data is used in this tool. The morphology data looks good. Can you try to open a new QGIS and only add your vector grid and do the same, i.e. add none of the raster files.

biglimp commented 2 weeks ago

I found where the error occurs. It is your vector file that gives some kind of bad name for units. What language do you have on your computer and what language is set in your QGIS?

On line 210 in targetprepare_algorithm.py (preprocessor folder), add the following code:

feedback.setProgressText("grid_unit: " + str(grid_unit))

Then restart QGIS and run again and you should have an output in your log window.

biglimp commented 2 weeks ago

As this seem to be an actual code bug and not just tutorial text issues, I am moving it.

jixuan-chen commented 2 weeks ago

I just tried again and it worked, with or without the raster files in QGIS. I have everything in English. The output grid unit is "metre". I also tried running the morphology and LC fraction tools before running TARGET prepare, no issues.

No idea what happened yesterday... but am happy it works now so I can continue the tutorial:)

biglimp commented 2 weeks ago

Ok, strange. I will close this issue then. Create a new one if error comes back.