UMEP-dev / UMEP

Urban Multi-scale Environmental Predictor
https://umep-docs.readthedocs.io/
59 stars 15 forks source link

UMEP Tree Generator Error #443

Closed orla46 closed 1 year ago

orla46 commented 2 years ago

Hi there,

I'm trying to run the tree generator in the pre-processor. I either get a blank CDSM with all zeroes or I get the below error:

2022-08-08T13:06:34 WARNING Traceback (most recent call last): File "C:\Users/orlac/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\TreeGenerator\tree_generator.py", line 386, in start_progress cdsm_array, tdsm_array = makevegdems.vegunitsgeneration(build_array, cdsm_array, tdsm_array, ttype, height, File "C:\Users/orlac/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\TreeGenerator\makevegdems.py", line 11, in vegunitsgeneration trees = conifertree(dia) File "C:\Users/orlac/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\TreeGenerator\makevegdems.py", line 108, in conifertree tree = circle/np.max(circle) File "", line 5, in amax File "C:\PROGRA~1\QGIS32~1.1\apps\Python39\lib\site-packages\numpy\core\fromnumeric.py", line 2733, in amax return _wrapreduction(a, np.maximum, 'max', axis, None, out, File "C:\PROGRA~1\QGIS32~1.1\apps\Python39\lib\site-packages\numpy\core\fromnumeric.py", line 87, in _wrapreduction return ufunc.reduce(obj, axis, dtype, out, **passkwargs) ValueError: zero-size array to reduction operation maximum which has no identity

I've looked at #33 and #58 but nothing I do seems to work. I've attached the files I'm using to generate the CDSM and the CDSM itself.

Would really appreciate any insight as this is affecting my master's thesis.

Thanks, Orla

Orla_treedata.zip

nilswallenberg commented 2 years ago

Hi,

The pixel resolution of your raster data is 25 m and you want to add trees that are substantially smaller than this pixel resolution.

My suggestion is that you try to change the pixel resolution to e.g. 1 m, but try this on a smaller part of this area (not the entire Dublin area) or you might run out of memory. Then try to run Tree Generator again on this smaller area with higher pixel resolution and see if it works.

Cheers, Nils

orla46 commented 2 years ago

Hi Nils,

I've done what you suggested but now I'm getting a new error:

2022-08-09T10:06:21 WARNING Traceback (most recent call last): File "C:\Users/orlac/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\TreeGenerator\tree_generator.py", line 386, in start_progress cdsm_array, tdsm_array = makevegdems.vegunitsgeneration(build_array, cdsm_array, tdsm_array, ttype, height, File "C:\Users/orlac/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\TreeGenerator\makevegdems.py", line 60, in vegunitsgeneration trees = trees[int(rowcutmin):int(rowcutmax), int(colcutmin):int(colcutmax)] IndexError: too many indices for array: array is 1-dimensional, but 2 were indexed

nilswallenberg commented 2 years ago

I see that your point shapefile is in WGS84 (deg). It needs to be in the same CRS as the raster data (meters).

I'm also wondering a bit about your trees, the diameter to be specific. Some of them have a tree canopy diameter of only a few centimeters (whereas they look larger on satellite images). I tried to run the tool with a new field where I set the diameter to 3 meters and then it worked, so might have to do with the resolution of the data. But I would check if the tree canopy values are correct.

Cheers, Nils

jkblizzard commented 1 year ago

Hi Nils, sorry for the long silence. I was travelling for a couple of days without access to the web. Thanks again for your support. After your support and your corrections both preprocessor and the main SEBE processor work like a charm. I have attached the results for your interest. Concerning the odd tree files I have corrected the errors, but still don't know how they happened. energYearRoof.zip

For the time I have used the Göteborg data set for applying meteorological values (GBG_TMY_1977.txt). Unfortunately, I was not able to produce my own meteorological year data set with the UMEP preprocessor. I started the preprocessor with the required information to download a data set for the entire year 2018. However, it started processing but never ended. I guess it might be useful to open a new ticket.

I still have to analyse the data in more depth and present them to my colleagues. Since our company is going to do more work in the direction of planning energy-efficient constructions and climate change protection plans for municipalities and district administration, I might be back to you soon, hopefully being able to contribute to your project, if this is desired from your side.

Again thanks a lot for your instant and effective support.

Cheers Jörg