UMEP-dev / UMEP

Urban Multi-scale Environmental Predictor
https://umep-docs.readthedocs.io/
GNU General Public License v3.0
62 stars 15 forks source link

Urban morphology generation in GBGCity tutorial causes crash #667

Open mothlight opened 3 weeks ago

mothlight commented 3 weeks ago

Describe the bug An error on this step and I'm a bit stuck now.

Algorithm 'Urban Heat Island: TARGET Prepare' starting…

Input parameters:

{ 'FRAC_CONC' : 0.25, 'FRAC_IRR' : 0.2, 'ID_FIELD' : 'id', 'INPUT_LC' : '/mnt/New4tb/data/UMEP-TARGET/GBGCity/torggland_LCFG_isotropic.txt', 'INPUT_MORPH' : '/mnt/New4tb/data/UMEP-TARGET/GBGCity/torggbuild_IMPGrid_isotropic.txt', 'INPUT_POLYGONLAYER' : '/mnt/New4tb/data/UMEP-TARGET/gbgcity_grid_300m.shp', 'OUTPUT_DIR' : '/mnt/New4tb/data/UMEP-TARGET/TARGETGBGCity', 'SITE_NAME' : 'GBGMay', 'UMEP_LC' : True }

Number of grids to process: 20

Traceback (most recent call last): File "/home/nice/.local/share/QGIS/QGIS3/profiles/default/python/plugins/processing_umep/preprocessor/targetprepare_algorithm.py", line 186, in processAlgorithm HW = (waipai)/(2pai*(1-pai))


ZeroDivisionError: float division by zero

Execution failed after 0.35 seconds

Loading resulting layers

Algorithm 'Urban Heat Island: TARGET Prepare' finished

The output from the Urban Morphology step seems to be wrong, but I can't see what I have done wrong:

[nice@politemadness PreProcessing]$ cat torggbuild_IMPGrid_isotropic.txt
 id  pai   fai   zH  zHmax   zHstd  zd  z0  wai
  1 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
  2 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
  3 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
  4 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
  5 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
  6 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
  7 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
  8 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
  9 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 10 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 11 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 12 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 13 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 14 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 15 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 16 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 17 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 18 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 19 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000
 20 0.000 0.000 0.000 0.000 0.000 0.100 0.030 0.000

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Desktop (please complete the following information):**
 - OS: Fedora 40
QGIS version 3.34.11-Prizren
QGIS code branch Release 3.34
Compiled against Qt 5.15.14
Running against Qt 5.15.15
Python version 3.12.6
GDAL/OGR version 3.8.5
PROJ version 9.3.1
EPSG Registry database version v10.098 (2023-11-24)
GEOS version 3.12.2-CAPI-1.18.2
SQLite version 3.45.1
PDAL version 2.6.3
PostgreSQL client version 16.4
SpatiaLite version 5.1.0
QWT version 6.2.0
QScintilla2 version 2.13.4
OS version Fedora Linux 40 (MATE-Compiz)

Active Python plugins
slyr_community 5.0.0
UMEP 4.1.1
QuickOSM 2.2.3
processing 2.12.99
MetaSearch 0.3.6
grassprovider 2.12.99
db_manager 0.1.20
processing_umep 2.0.35

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Data**
If applicable, add data files to help us reproduce your problem.

**Additional context**
Add any other context about the problem here.
biglimp commented 2 weeks ago

I suspect gdal to be the problem. QGIS 3.38 make use of gdal 3.9. @nilswallenberg , didnt we have issues with flipped lat/lon (x/y) coordinates with gdal?

Is the isotrophic land cover file also strange, i.e. only zeros?

biglimp commented 2 weeks ago

@mothlight , were you able to identify why you got zeros from your morphology tool?

@matthiasdemuzere , have you experienced this also (as being a linux person)?

biglimp commented 16 hours ago

@mothlight , @matthiasdemurzere what is the status on this? I fired up an ubuntu computer and were able to produce no-zero values:

QGIS version: 3.40.1-Bratislava QGIS code revision: 989853a7a31 Qt version: 5.15.3 Python version: 3.10.12 GDAL version: 3.4.1 GEOS version: 3.10.2-CAPI-1.16.0 PROJ version: Rel. 8.2.1, January 1st, 2022 PDAL version: 2.3.0 (git-version: Release)

Ubuntu version: 22.04

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