Git Product home page Git Product logo

umep-processing's People

Contributors

bbrangeo avatar biglimp avatar gusbacos avatar j3r3m1 avatar jlegewie avatar nilswallenberg avatar robertschweizer avatar sunt05 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

umep-processing's Issues

Test based on Tutorial -- copying or increasing the size of the planting_area.shp -- Attribute Error

Hi Nils,

Now I am experimenting/testing using the Tutorial dataset for TreePlanter.

Keeping everything else the same as in the Tutorial, including the output from SOLWEIG, I tested
(1) exported the planting_area.shp to a new file, planting_area_copy.shp
(2) enlarged the planting_area.shp and saved file as "planting_area2.shp"

As attached in two zip files.

planting_area_copy.zip
planting_area2.zip

In both cases, TreePlanter simulation failed with error: AttributeError: 'NoneType' object has no attribute 'ReadAsArray'

The planting_area.shp is not required in the steps prior to using the TreePlanter function.

What has TreePlanter reacted to in both the exported and enlarged shapefile?

#################################################################################

Failed:
(1) Exported the original shapefile "planting_area.shp" . Exactly same error for enlarging the original shapefile.

Processing algorithm…
Algorithm 'Outdoor Thermal Comfort: TreePlanter' starting…
Input parameters:
{ 'DIA' : 5, 'END_HOUR' : 15, 'GREEDY_ALGORITHM' : False, 'HEIGHT' : 10, 'INCLUDE_OUTSIDE' : True, 'INPUT_POLYGONLAYER' : '/media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/planting_area_copy.shp|layername=planting_area_copy', 'ITERATIONS' : 2000, 'NTREE' : 3, 'OUTPUT_CDSM' : 'TEMPORARY_OUTPUT', 'OUTPUT_POINTFILE' : 'TEMPORARY_OUTPUT', 'RANDOM_STARTING' : False, 'SOLWEIG_DIR' : '/media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3', 'START_HOUR' : 13, 'TRANS_VEG' : 3, 'TRUNK' : 3, 'TTYPE' : 0 }

Initializing and loading layers...
Loading /media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3/Shadow_1983_173_1300D.tif..
Loading /media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3/Tmrt_1983_173_1300D.tif..
Loading /media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3/Shadow_1983_173_1400D.tif..
Loading /media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3/Tmrt_1983_173_1400D.tif..
Traceback (most recent call last):
File "/home/l1nux/.local/share/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/processor/treeplanter_algorithm.py", line 277, in processAlgorithm
tree_input = Inputdata(r_range, sh_fl, tmrt_fl, infolder, inputPolygonlayer, feedback)
File "/home/l1nux/.local/share/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/functions/TreePlanter/TreePlanter/TreePlanterClasses.py", line 95, in init
self.selected_area = dataSetSel.ReadAsArray().astype(np.float)
AttributeError: 'NoneType' object has no attribute 'ReadAsArray'

Execution failed after 0.04 seconds

###########################################################################

Successful
(2) TreePlanter simulation using original shapefile "planting_area.shp"

Loading resulting layers
Algorithm 'Outdoor Thermal Comfort: TreePlanter' finished
QGIS version: 3.16.4-Hannover
Qt version: 5.12.9
GDAL version: 3.2.1
GEOS version: 3.9.0-CAPI-1.14.1
PROJ version: Rel. 7.2.0, November 1st, 2020
Processing algorithm…
Algorithm 'Outdoor Thermal Comfort: TreePlanter' starting…
Input parameters:
{ 'DIA' : 5, 'END_HOUR' : 15, 'GREEDY_ALGORITHM' : False, 'HEIGHT' : 10, 'INCLUDE_OUTSIDE' : True, 'INPUT_POLYGONLAYER' : '/media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/planting_area.shp', 'ITERATIONS' : 2000, 'NTREE' : 3, 'OUTPUT_CDSM' : 'TEMPORARY_OUTPUT', 'OUTPUT_POINTFILE' : 'TEMPORARY_OUTPUT', 'RANDOM_STARTING' : False, 'SOLWEIG_DIR' : '/media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3', 'START_HOUR' : 13, 'TRANS_VEG' : 3, 'TRUNK' : 3, 'TTYPE' : 0 }

Initializing and loading layers...
Loading /media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3/Shadow_1983_173_1300D.tif..
Loading /media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3/Tmrt_1983_173_1300D.tif..
Loading /media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3/Shadow_1983_173_1400D.tif..
Loading /media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT3/Tmrt_1983_173_1400D.tif..
Running hill climbing algorithm with genetic algorithm for starting positions...
1600 possible locations for trees...
10.0 percent of iterations finished...
20.0 percent of iterations finished...
30.0 percent of iterations finished...
40.0 percent of iterations finished...
50.0 percent of iterations finished...
60.0 percent of iterations finished...
70.0 percent of iterations finished...
80.0 percent of iterations finished...
90.0 percent of iterations finished...
TreePlanter: Model calculation finished.
Execution completed in 66.62 seconds
Results:
{'OUTPUT_CDSM': '/tmp/processing_GZvFZC/d8b6b51868bc49aea9de6d1721dabbcd/OUTPUT_CDSM.tif',
'OUTPUT_POINTFILE': '/tmp/processing_GZvFZC/68b56c99ee89410a99f143c17acefb71/OUTPUT_POINTFILE.gpkg'}

Loading resulting layers
Algorithm 'Outdoor Thermal Comfort: TreePlanter' finished

installation error - jaydebeapi module

Hi,

I am getting an error during installation of UMEP for processing on Linux. The error seems to be associated with ' jaydebeapi' module installation. Please find the attached screenshot. Thanks
umep_error

Different limits for clothing parameter in PET and SOLWEIG / SpatialTC functions

Hello,

I noticed a difference in the description of the value range for the clothing parameter for the PET index calculation. In SOLWEIG a range of 0-10 is given.

clo = QgsProcessingParameterNumber(self.CLO, self.tr('Clothing (clo)'),
QgsProcessingParameterNumber.Double,
QVariant(0.9), optional=True, minValue=0, maxValue=10)

And in PET_calculations._PET function we see a range of 0-5 in the description of the input parameter for clothing for the _PET function. However, it is not checked whether the actual given clothing value complies with that described range.

The code of PET differentiates clothing between values of <=0.3<=0.6<2

if icl < 2:
y = (ht-0.2) / ht
if icl <= 0.6:
y = 0.5
if icl <= 0.3:
y = 0.1

I don't know why the limits of clothing are set to 0-5 and 0-10 respectively nor how this affects the results of PET calculations. I could imagine that leads to an overestimation of PET as the clothing values in a range 0-10 are comparatively larger, when considered in a range 0-5, but I haven't looked into the details of PET and parameter coeffects. As the default value of clothing in SOLWEIG is 0.9 and I assume that most users use default values, I don't think this has caused any problems yet.

Note that the recently published SpatialTC tool also uses the SOLWEIG range of 0-10 for clothing. See here:

clo = QgsProcessingParameterNumber(self.CLO, self.tr('Clothing (clo)'),
QgsProcessingParameterNumber.Double,
QVariant(0.9), optional=True, minValue=0, maxValue=10)

Perhaps you can take a look at the files and standardize the limit values to one or the other variant.

TreePlanter Tutorial - Execution Failed (Outdoor Thermal Comfort: TreePlanter)

UMEP Processing installed version: 1.3 (installed from zip file to replace v1.2.1)
QGIS version: 3.18.0-Zürich
Qt version: 5.12.9
GDAL version: 3.2.1
GEOS version: 3.9.1-CAPI-1.14.2
PROJ version: Rel. 7.2.0, November 1st, 2020

OS: Ubuntu 20.04

Using the Tree Planter Tutorial
(https://umep-docs.readthedocs.io/projects/tutorial/en/latest/Tutorials/IntroductionToTreePlanter.html)
and the Test Data set (zip file; link to Zenodo)
http://doi.org/10.5281/zenodo.4616770

Up to Step 5 in the tutorial (SOLWEIG OUT), everything worked OK and output generated.

Execution failed at the Step "run TreePlanter based on the output from the SOLWEIG run in the previous section."
Number of restart iterations:2000
No other Advanced Parameters selected

Save necessary raster(s) for the TreePlanter tool - Yes, and raster outputs generated.

Thanks for any help.

++++++++++++++++++++++++++++++++++++++++++++++++++++++

treeplantersettings.txt:
UTC, posture, onlyglobal, landcover, anisotropic, cylinder, albedo_walls, albedo_ground, emissivity_walls, emissivity_ground, absK, absL, elevation
1 0 1 0 0 1 0.20 0.15 0.90 0.95 0.70 0.95 3.00

++++++++++++++++++++++++++++++++++++++++++++++++++++++

Log output:

Processing algorithm…
Algorithm 'Outdoor Thermal Comfort: TreePlanter' starting…
Input parameters:
{ 'DIA' : 5, 'END_HOUR' : 15, 'GREEDY_ALGORITHM' : False, 'HEIGHT' : 10, 'INCLUDE_OUTSIDE' : False, 'INPUT_POLYGONLAYER' : '/media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/planting_area.shp', 'ITERATIONS' : 2000, 'NTREE' : 3, 'OUTPUT_CDSM' : '/media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/TreePlanter_OUT/TreePlanter_CDSM.tif', 'OUTPUT_POINTFILE' : '/media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/TreePlanter_OUT/TreePlanter_Point.shp', 'RANDOM_STARTING' : False, 'SOLWEIG_DIR' : '/media/l1nux/SAN240/SIM/WIP_UMEP/TreePlantTut/TreePlanterTestData/SOLWEIG_OUT', 'START_HOUR' : 13, 'TRANS_VEG' : 3, 'TRUNK' : 3, 'TTYPE' : 0 }

Initializing and loading layers...
Tree shade ineffective outside planting area...
Running hill climbing algorithm with genetic algorithm for starting positions...
0 possible locations for trees...
Traceback (most recent call last):
File "/home/l1nux/.local/share/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/processor/treeplanter_algorithm.py", line 373, in processAlgorithm
t_y, t_x, tmrt_max = TreePlanterHillClimber.treeoptinit(treerasters, cropped_rasters, positions, treedata,
File "/home/l1nux/.local/share/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/functions/TreePlanter/TreePlanter/TreePlanterHillClimber.py", line 73, in treeoptinit
StartingPositions.genetic_start(tree_pos_x, tree_pos_y, tree_pos_c, positions, trees, tree_pos_all,
File "/home/l1nux/.local/share/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/functions/TreePlanter/TreePlanter/StartingPositions.py", line 35, in genetic_start
tree_pos, tp_c, break_loop = random_start(pos, trees, tree_pos_all, r_iters)
File "/home/l1nux/.local/share/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/functions/TreePlanter/TreePlanter/StartingPositions.py", line 7, in random_start
tree_pos = np.random.choice(pos, trees) # Random positions for trees
File "mtrand.pyx", line 909, in numpy.random.mtrand.RandomState.choice
ValueError: 'a' cannot be empty unless no samples are taken

Execution failed after 0.34 seconds

Optimal approach to optimisation

A suggestion made by Nils during the recent online seminar was to run several tree planter scenarios, each run having a specific tree and canopy dimension. This occurs because Tree Planter cannot automatically change these in the simulation.

What would be an optimal approach to optimisation in circumstances where

  • the planting polygon is large,
  • the site has high paved surfaces & building %, with lower vegetation % and
  • the maximum Tmrt values are very high?

My question relates to the reasoning one should use to efficiently & effectively combine the scenarios described by Nils into a small number of "most probable solution sets" to run in SOLWEIG. Then to compare the magnitude of heat mitigation for each solution set. I am interested in the reasoning towards "efficient & effective", or "optimal approach" to conducting the tree planter optimisation; i.e something to support the choices made.

Has anyone come across literature that describes an optimal approach to designing such scenarios? I would like to avoid a plug and chug approach, manually spinning scenarios and then guessing the best match (aka. trial and error).

Intuitively I could begin by rezoning the planting area into a gradient of Tmrt max values, and then subdivide the scenarios hierarchically, e.g. highest Tmrt max values --> plant larger trees required. Exclusion criteria would be inherent in the planting polygon dimensions, e.g. building distance < largest canopy width of trees.

RuntimeError: WITH FORCING FILE WITH supy

df_forcing= sp.util.read_forcing('C:/Users/User/Desktop/SUEWS_Dublin/prepare/_2018_data_60.txt', tstep_mod=300)

Hello,
After I processed my forcing file with the met processor in Umep and tried to add the forcing met file using the above sp util, I received the following error.

RuntimeError: Loaded forcing files have gaps at: Int64Index([1, 2], dtype='int64').
I tested era5 forcing era 5 data and that was successful. I however checked and compare the files. I found no gap in the data filed.

I have attached the met file

Can anyone kindly assist. Thank you

_2018_data_60.txt

Error when install Python Packages for UMEP

Hej!

When launching UMEP for processing, it requires the download of new Python packages. Once this is completed, the following error message occurs:

AttributeError: module 'numpy' has no attribute 'long'
Traceback (most recent call last):
File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 423, in startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:\Users/beam0/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep_init
.py", line 46, in classFactory
from .processing_umep import ProcessingUMEPPlugin
File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/beam0/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processing_umep.py", line 38, in
from .processing_umep_provider import ProcessingUMEPProvider
File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/beam0/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processing_umep_provider.py", line 54, in
from .processor.urock_processing_algorithm import URockAlgorithm
File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/beam0/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processor\urock_processing_algorithm.py", line 64, in
from ..functions.URock import MainCalculation
File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/beam0/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\MainCalculation.py", line 19, in
from . import WindSolver
File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "C:\Users/beam0/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\WindSolver.py", line 18, in
from numba import jit
File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python39\lib\site-packages\numba_init
.py", line 18, in
from numba.core import types, errors
File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in import
mod = builtin_import(name, globals, locals, fromlist, level)
File "C:\OSGeo4W\apps\Python39\lib\site-packages\numba\core\types_init
.py", line 108, in
long
= make_signed(np.long)
File "C:\OSGeo4W\apps\Python39\lib\site-packages\numpy_init
.py", line 284, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'long'

When I choose to cancel the installation of new Python packages, the same message reappears.

Regards,
Evelina

Loading plugin headless for qgis_process

Hi,

It is possible this issue may lie with qgis instead, but when attempting to install the plugin by extracting the zip file to the plugins directory it is found but not loaded.

[root@c4da1ff0ffde /]# qgis_process plugins
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-root'
<string>:1: DeprecationWarning: setapi() is deprecated
/usr/lib/python3.9/site-packages/qgis/utils.py:792: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  mod = _builtin_import(name, globals, locals, fromlist, level)
Problem with GRASS installation: GRASS was not found or is not correctly installed
Problem with SAGA installation: SAGA was not found or is not correctly installed
Available plugins
(* indicates loaded plugins which implement Processing providers)

  processing_umep
* processing

Has anyone else attempted to install this plugin headless?

FileNotFoundError when using SOLWEIG

First, thank you for your great tool! I am calculating maximum comfortable walking distances for pedestrians and SOLWEIG delivers me the Tmrt needed. I seperated my case city in ca. 9000 microclimatezones and wrote a script to automate the SOLWEIG tool with my inputs with UMEP Processing.

When I now run my script I get the following error, which I cannot explain:

Traceback (most recent call last):
File "C:\OSGEO41\apps\Python37\lib\code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
File "", line 76, in
File "C:/OSGEO4
1/apps/qgis/./python/plugins\processing\tools\general.py", line 108, in run
return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
File "C:/OSGEO41/apps/qgis/./python/plugins\processing\core\Processing.py", line 174, in runAlgorithm
ret, results = execute(alg, parameters, context, feedback, catch_exceptions=False)
File "C:/OSGEO4
1/apps/qgis/./python/plugins\processing\gui\AlgorithmExecutor.py", line 71, in execute
results, ok = alg.run(parameters, context, feedback, {}, False)
_core.QgsProcessingException: Traceback (most recent call last):
File "C:/Users/jonas/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\processor\solweig_algorithm.py", line 831, in processAlgorithm
data = np.load(folderPathPerez)
File "C:\OSGEO4~1\apps\Python37\lib\site-packages\numpy\lib\npyio.py", line 417, in load
fid = stack.enter_context(open(os_fspath(file), "rb"))
FileNotFoundError: [Errno 2] No such file or directory: ''

When using UMEP GUI it works perfectly.
Thanks for your help in advance.

Best
Jonas

Issue with numformat2 variable in imagemorphparms_algorithm for SUEWS spatial tutorial

Hi, I'm new to using QGIS and UMEP, and I'm encountering an error when following the SUEWS spatial tutorial.

I am currently trying to run the building morphology algorithm, but I am receiving the following error message:

Traceback (most recent call last):   
File "C:\Users/USERNAME/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\preprocessor\imagemorphparms_algorithm.py", line 424, in processAlgorithm   fmt=numformat2, delimiter=' ', header=headerIso, comments='')   NameError: name 'numformat2' is not defined

Execution failed after 7.70 segundos

I am using QGIS version 3.30.1 and UMEP for processing version 2.0.1. I have followed the tutorial steps exactly and have not made any modifications.

Upon further investigation, I noticed that the numformat2 variable seems to has been commented out in the imagemorphparms_algorithm.py file. It's not clear to me why this variable was commented out, and I suspect it might be the cause of the error.

Shadow generator - date problem

When using Outdoor thermal comfort: shadow generator, the date is changed to the present date. There is no option to set specific date and save it into model.

Testing: combining UMEP Processing v1.3 (SOLWEIG) with UMEP Processing (Tree Planter) v1.6.1

OS: Ubuntu 20.04
Python: v3.9.10 on conda
QGis: v3.16, v3.18
SOLWEIG Simulation: As recommended, 1 hr time intervals for one day.

This might be already mentioned somewhere else.

An observation having used Tree Planter (UMEP Processing v1.3 and then updated to v1.6.1):
both the SOLWEIG and Tree Planter simulations must be run from the same version of UMEP Processing.

That is,
SOLWEIG (UMEP Processing v1.3) & Tree Planter (UMEP Processing v1.3) - Tree Planter runs OK
SOLWEIG (UMEP Processing v1.3) & Tree Planter (UMEP Processing v1.6.1) - Tree Planter finds no solution or fails with error.

Solution:
You need to re-run your SOLWEIG simulation using UMEP Processing v1.6.1, and then run Tree Planter.

If this observation while testing is true, then an update in the Help documentation is recommended.

Error while importing ProcessingUMEPProvider

I am working in Spyder, Windows 10. Just following the instruction from documentation.

from qgis.core import QgsApplication
import sys

# Initiating a QGIS application
qgishome = 'C:/OSGeo4W64/apps/qgis/'
QgsApplication.setPrefixPath(qgishome, True)
app = QgsApplication([], False)
app.initQgis()

# import third party processing plugins
sys.path.append(r'C:\Users\ **your_username** \AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins')
from processing_umep.processing_umep_provider import ProcessingUMEPProvider


C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\IPython\utils\_process_win32.py:145: ResourceWarning: unclosed file <_io.BufferedWriter name=4>
  return process_handler(cmd, _system_body)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\IPython\utils\_process_win32.py:145: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  return process_handler(cmd, _system_body)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\IPython\utils\_process_win32.py:145: ResourceWarning: unclosed file <_io.BufferedReader name=6>
  return process_handler(cmd, _system_body)
ResourceWarning: Enable tracemalloc to get the object allocation traceback

runfile('C:/Users/XYZ/.spyder-py3/temp.py', wdir='C:/Users/XYZ/.spyder-py3')
Reloaded modules: processing_umep, processing_umep.functions.wallalgorithms, processing_umep.util, processing_umep.util.misc, processing_umep.preprocessor.wall_heightaspect_algorithm, processing_umep.util.shadowingfunctions, processing_umep.functions.svf_functions, processing_umep.preprocessor.skyviewfactor_algorithm
Traceback (most recent call last):

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\internals\construction.py", line 568, in _list_to_arrays
    columns = _validate_or_indexify_columns(content, columns)

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\internals\construction.py", line 692, in _validate_or_indexify_columns
    raise AssertionError(

AssertionError: 3 columns passed, passed data had 4 columns


The above exception was the direct cause of the following exception:

Traceback (most recent call last):

  File "C:\Users\XYZ\.spyder-py3\temp.py", line 11, in <module>
    from processing_umep.processing_umep_provider import ProcessingUMEPProvider

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)

  File "C:\Users\XYZ\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\processing_umep\processing_umep_provider.py", line 38, in <module>
    from .preprocessor.copernicusera5_algorithm import ProcessingCopernicusERA5Algorithm

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)

  File "C:\Users\XYZ\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\processing_umep\preprocessor\copernicusera5_algorithm.py", line 64, in <module>
    import supy as sp

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)

  File "C:\Users\XYZ\AppData\Roaming\Python\Python39\site-packages\supy\__init__.py", line 12, in <module>
    from .supy_module import (init_supy, load_SampleData,

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)

  File "C:\Users\XYZ\AppData\Roaming\Python\Python39\site-packages\supy\supy_module.py", line 39, in <module>
    from .supy_post import pack_df_output, pack_df_output_array, pack_df_state

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)

  File "C:\Users\XYZ\AppData\Roaming\Python\Python39\site-packages\supy\supy_post.py", line 23, in <module>
    var_df = get_output_info_df()

  File "C:\Users\XYZ\AppData\Roaming\Python\Python39\site-packages\supy\supy_post.py", line 14, in get_output_info_df
    df_var_list = pd.DataFrame(var_list_x, columns=['var', 'group', 'aggm'])

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\frame.py", line 570, in __init__
    arrays, columns = to_arrays(data, columns, dtype=dtype)

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\internals\construction.py", line 552, in to_arrays
    return _list_to_arrays(data, columns, coerce_float=coerce_float, dtype=dtype)

  File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\internals\construction.py", line 571, in _list_to_arrays
    raise ValueError(e) from e

ValueError: 3 columns passed, passed data had 4 columns

missing numba is breaking plugin

If numba is not installed the plugin cannot start. We need to find away to fix this, e.g. show a message before error message or something.

Couldn't load plugin 'processing_umep' due to an error when calling its classFactory() method 

NameError: name 'jit' is not defined 
Traceback (most recent call last):
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\__init__.py", line 38, in classFactory
    from .processing_umep import ProcessingUMEPPlugin
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processing_umep.py", line 38, in 
    from .processing_umep_provider import ProcessingUMEPProvider
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processing_umep_provider.py", line 54, in 
    from .processor.urock_processing_algorithm import URockAlgorithm
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processor\urock_processing_algorithm.py", line 63, in 
    from ..functions.URock import MainCalculation
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\MainCalculation.py", line 19, in 
    from . import WindSolver
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\WindSolver.py", line 248, in 
    @jit(nopython=True)
NameError: name 'jit' is not defined

Tree planter tool bug

Hi,

I am trying to use the tree planter tool over Austin, Texas USA. I am using the latest version of UMEP for processing (2.0.13). I could run the SOLWEIG model to generate the mean radiant temperature maps successfully. However, I ran into some issues while using the tree planter tool. Here is the issue:

  1. When greedy algorithm is not used: It says '0 possible locations for trees...' and throws the following error
    Traceback (most recent call last):
    File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\postprocessor\treeplanter_algorithm.py", line 408, in processAlgorithm
    shadow_rg, tmrt_1d, nTree, ITERATIONS, sa, feedback)
    File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\TreePlanter\TreePlanter\TreePlanterHillClimber.py", line 74, in treeoptinit
    r_iters, counter, dia)
    File "C:/Users/userAppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\TreePlanter\TreePlanter\StartingPositions.py", line 35, in genetic_start
    tree_pos, tp_c, break_loop = random_start(pos, trees, tree_pos_all, r_iters)
    File "C:/Users/user/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\TreePlanter\TreePlanter\StartingPositions.py", line 7, in random_start
    tree_pos = np.random.choice(pos, trees) # Random positions for trees
    File "mtrand.pyx", line 915, in numpy.random.mtrand.RandomState.choice
    ValueError: 'a' cannot be empty unless no samples are taken

Execution failed after 1.91 seconds

  1. When the greedy algorithm is used: There is no error but it says the the following
    Running with greedy algorithm...
    0 possible locations for trees...
    Not enough space for all trees! Found locations for 0 out of 3 trees.
    TreePlanter: Model calculation finished.
    Execution completed in 2.06 seconds
    Results:
    {'OUTPUT_DIR': 'C:\Users\user\Desktop\Tree_planter\Tree_planter_output'}
    When greedy algorithm is used, it does create a CDSM.tif and points.shp file but the point.shp does not have any trees and CDSM.tif is the same as input CDSM.

I am facing the same issue on both Windows and Ubuntu systems.
Please find my input files, SOLWEIG output and planting area shape file here:
https://utexas.box.com/s/wcra2gb0voujfrpkcbprdst63f52wq32

All the files can be imported to QGIS using the 'Example.qgz' project file.

Any help will be much appreciated.

Thank you

Urock Analyzer output

Hi,
I get a wierd output when i runt URock. I have a dummy area with a building running N-S and wind coming from SW. The building is 6m high:
MicrosoftTeams-image

I draw a line near the corner and the output shows wierd wind changes far above the building and the building divided in two:
_line1

When I run with vegetation i also dosn't seem to get the vegetation in the vertical wind profile.

Output folder:
Urock.zip

Data used:

URockDataIssue.zip

ImportError: C extension On MacOS Monterey

Hi,

Import error when installing UMEP for Processing on MacOS

Couldn't load plugin 'UMEP' due to an error when calling its classFactory() method
ImportError: C extension: None not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext' to build the C extensions first.
Traceback (most recent call last):
File "/Users/gast/.local/lib/python3.9/site-packages/pandas/init.py", line 23, in
from pandas.compat import (
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/gast/.local/lib/python3.9/site-packages/pandas/compat/init.py", line 26, in
from pandas.compat.numpy import is_numpy_dev
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/gast/.local/lib/python3.9/site-packages/pandas/compat/numpy/init.py", line 17, in
raise ImportError(
ImportError: this version of pandas is incompatible with numpy your numpy version is 1.20.1.
Please upgrade numpy to >= 1.22.4 to use this pandas version

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 423, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Users/gast/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP/init.py", line 34, in classFactory
from .UMEP import UMEP
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/gast/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP/UMEP.py", line 44, in
from .UWGReClassifier.uwg_reclassifier import uwg_reclassifier
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/gast/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP/UWGReClassifier/uwg_reclassifier.py", line 36, in
import pandas as pd
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/gast/.local/lib/python3.9/site-packages/pandas/init.py", line 28, in
raise ImportError(
ImportError: C extension: None not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext' to build the C extensions first.

Python version: 3.9.5 (default, Sep 10 2021, 16:18:19) [Clang 12.0.5 (clang-1205.0.22.11)]
QGIS version: 3.32.3-Lima Lima, 67d46100b5b
Python Path:
• /Applications/QGIS.app/Contents/MacOS/../Resources/python
• /Users/gast/Library/Application Support/QGIS/QGIS3/profiles/default/python
• /Users/gast/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
• /Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/netCDF4-1.5.4-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/Rtree-0.9.7-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python39.zip
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/patsy-0.5.1-py3.9.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/Pillow-7.2.0-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/numba-0.50.1-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/numpy-1.20.1-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/cftime-1.2.1-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/scipy-1.5.1-py3.9-macosx-10.13.0-x86_64.egg
• /Users/gast/.local/lib/python3.9/site-packages
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/GDAL-3.3.2-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/geopandas-0.8.1-py3.9.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/rasterio-1.1.5-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/Fiona-1.8.13.post1-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/pyproj-3.2.0-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/statsmodels-0.11.1-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/lib-dynload
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/opencv_contrib_python-4.3.0.36-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/matplotlib-3.3.0-py3.9-macosx-10.13.0-x86_64.egg
• /Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/pandas-1.3.3-py3.9-macosx-10.13.0-x86_64.egg
• /Users/gast/Library/Application Support/QGIS/QGIS3/profiles/default/python

SOLWEIG SCRIPT

Hello, I wrote the same script provided by SOLWEIG to generate various folders with Tmrt results. I added 2 loops and it works. But at the end, when I open the output folder, I have only the Tmrt average and not the other Trmrt for the ohers hours.
I tried for one raster map named C07 and weather text current.
Let me explain the code :
For each period, I want to calculate all the temperatures (Tmrt) for a day (1AM, 2AM...) and load the results in a folder for each maps (A01,...) by period.
Can you check my script please ? Thank you for your help

liste complète des noms de dalles

tiles_full = ['A01', 'B01', 'C01', 'D01', 'E01', 'F01', 'G01', 'A02', 'B02', 'C02', 'D02', 'E02', 'F02', 'G02', 'A03', 'B03', 'C03', 'D03', 'E03', 'F03', 'G03', 'A04', 'B04', 'C04', 'D04', 'E04', 'F04', 'G04', 'A05', 'B05', 'C05', 'D05', 'E05', 'F05', 'G05', 'A06', 'B06', 'C06', 'D06', 'E06', 'F06', 'G06', 'A07', 'B07', 'C07', 'D07', 'E07', 'F07', 'G07', 'A08', 'B08', 'C08', 'D08', 'E08', 'F08', 'G08', 'A09', 'B09', 'C09', 'D09', 'E09', 'F09', 'G09', 'A10', 'B10', 'C10', 'D10', 'E10', 'F10', 'G10']
periods_full = ['01-CURRENT', '02-MID-CENTURY', '03-END-CENTURY']
tiles = ['C07']# tiles_full
periods = ['01-CURRENT']# periods_full

chemins

root_path = 'C:/Users/name/Desktop/WORK/'
root_folder_dblslash = "C:\Users\name\Desktop\WORK\"

tmr_folder_path = root_folder_dblslash + 'A07-TMR\00-DALLES\'
dsm_path = root_path + 'A01-DSM/DSM_'
cdsm_path = root_path + 'A02-CDSM_TDSM/CDSM_'
tdsm_path = root_path + 'A02-CDSM_TDSM/TDSM_'
dem_path = root_path +'02-DEM/03-DEM_TIFF/DEM_'
svf_folder = root_folder_dblslash + 'A03-SVF\'
lc_path = root_path + '05-LANDCOVER/06-LC/LC_'
wallHeight_path = root_path + 'A04-WALLS/wallHeight_'
wallAspect_path = root_path + 'A04-WALLS/wallAspect_'
met_path = root_path + 'A05-METEO\02-METEO_UMEP_14JUL\'

for period in periods:

met_file = met_path + period + '_14jul.txt'


for tile in tiles:
    
    # fichiers d'entrée sortie
    dsm_file = dsm_path + tile + '.tif'
    cdsm_file = cdsm_path + tile + '.tif'
    tdsm_file = tdsm_path + tile + '.tif'
    dem_file = dem_path + tile +'.tif'
    lc_file = lc_path + tile +'.tif'
    wallHeight_file = wallHeight_path + tile + '.tif'
    wallAspect_file = wallAspect_path + tile + '.tif'
    svf_zip = svf_folder + tile + '\\svfs.zip'
    aniso_file = svf_folder + tile + '\\shadowmats.npz'
    

    #output_dir = test_folder_dblslash + "TRM"
    output_dir = tmr_folder_path + period + '\\' + tile + '\\'
    
    
    print(tile)
    # go!
    processing.run("umep:Outdoor Thermal Comfort: SOLWEIG",
                   {'INPUT_DSM':dsm_file,\
                    'INPUT_SVF':svf_zip,\
                    'INPUT_HEIGHT':wallHeight_file,\
                    'INPUT_ASPECT':wallAspect_file,\
                    'INPUT_CDSM':cdsm_file,\
                    'TRANS_VEG':3,\
                    'INPUT_TDSM':tdsm_file,\
                    'INPUT_THEIGHT':25,\
                    'INPUT_LC':lc_file,\
                    'USE_LC_BUILD':False,\
                    'INPUT_DEM':dem_file,\
                    'SAVE_BUILD':False,\
                    'INPUT_ANISO':aniso_file,\
                    'ALBEDO_WALLS':0.2,\
                    'ALBEDO_GROUND':0.15,\
                    'EMIS_WALLS':0.9,\
                    'EMIS_GROUND':0.95,\
                    'ABS_S':0.7,\
                    'ABS_L':0.95,\
                    'POSTURE':0,\
                    'CYL':True,\
                    'INPUTMET':met_file,\
                    'ONLYGLOBAL':False,\
                    'UTC':1,\
                    'POI_FILE':None,'POI_FIELD':'','AGE':35,'ACTIVITY':80,'CLO':0.9,'WEIGHT':75,'HEIGHT':180,'SEX':0,'SENSOR_HEIGHT':10,\
                    'OUTPUT_TMRT':False,\
                    'OUTPUT_KDOWN':False,'OUTPUT_KUP':False,'OUTPUT_LDOWN':False,'OUTPUT_LUP':False,\
                    'OUTPUT_SH':False,\
                    'OUTPUT_TREEPLANTER':False,\
                    'OUTPUT_DIR':output_dir})

URock can't find Java path

Hi,
I have problem finding my Java path when running URock and get this error:

Traceback (most recent call last):
File "C:\Users/xlojes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\H2gisConnection.py", line 327, in getJavaHome
java_key = winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\JavaSoft\Java Runtime Environment")
FileNotFoundError: [WinError 2] Det går inte att hitta filen

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users/xlojes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processor\urock_processing_algorithm.py", line 323, in processAlgorithm
javaDirDefault = getJavaDir(plugin_directory)
File "C:\Users/xlojes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\H2gisConnection.py", line 212, in getJavaDir
javaPath = getJavaHome(os_type)
File "C:\Users/xlojes/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\H2gisConnection.py", line 330, in getJavaHome
exit()
File "C:\OSGeo4W\apps\Python39\lib_sitebuiltins.py", line 26, in call
raise SystemExit(code)
SystemExit: None

Any idea what the problem is?
I have following version:
openjdk version "17.0.7" 2023-04-18
OpenJDK Runtime Environment Temurin-17.0.7+7 (build 17.0.7+7)
OpenJDK 64-Bit Server VM Temurin-17.0.7+7 (build 17.0.7+7, mixed mode, sharing)

URock analyzer problem

I just removed my java and installer openjdk version 21 instead as my Uni does not allow us to use commercial java. I was able to run URock prepare and Urock v2023a but the analyzer fails. I worked before. I use the new line with only two vertices.

QGIS version: 3.32.3-Lima
QGIS code revision: 67d46100b5
Qt version: 5.15.3
Python version: 3.9.5
GDAL version: 3.7.2
GEOS version: 3.12.0-CAPI-1.18.0
PROJ version: Rel. 9.3.0, September 1st, 2023
PDAL version: 2.5.5 (git-version: 24f78d)
Algorithm started at: 2023-09-25T14:18:27
Algorithm 'Urban Wind Field: URock AnalyZer' starting…
Input parameters:
{ 'ID_FIELD_LINES' : 'fid', 'ID_FIELD_POLYGONS' : '', 'INPUT_LINES' : 'C:/temp/URockTutorial/Annedal_EPSG3006/line.shp', 'INPUT_POLYGONS' : None, 'INPUT_WIND_FILE' : 'C:\\temp\\URockTutorial\\urock_out\\urock_output.nc', 'IS_STREAM' : True, 'OUTPUT_DIRECTORY' : 'C:\\temp\\URockTutorial\\urock_out', 'SIMULATION_NAME' : 'test' }

Load NetCDF file in Python and save as csv file...
Load csv file into H2GIS Database...
Calculates vertical sectional plot (along lines)...
Traceback (most recent call last):
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\postprocessor\urock_analyser_algorithm.py", line 251, in processAlgorithm
plotSectionalViews(pluginDirectory = plugin_directory,
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\urock_analyser_functions.py", line 285, in plotSectionalViews
ax[line].streamplot(D, z, wind_d, wind_z, density = STREAM_DENSITY,
File "C:\OSGeo4W\apps\Python39\lib\site-packages\matplotlib\__init__.py", line 1412, in inner
return func(ax, *map(sanitize_sequence, args), **kwargs)
File "C:\OSGeo4W\apps\Python39\lib\site-packages\matplotlib\streamplot.py", line 89, in streamplot
grid = Grid(x, y)
File "C:\OSGeo4W\apps\Python39\lib\site-packages\matplotlib\streamplot.py", line 343, in __init__
raise ValueError("'y' must be strictly increasing")
ValueError: 'y' must be strictly increasing

Execution failed after 232.53 seconds (3 minutes 53 seconds)

Loading resulting layers
Algorithm 'Urban Wind Field: URock AnalyZer' finished

processing_umep installation error

I am getting following error when installing processing_umep

Windows 10 64bit

Couldn't load plugin 'processing_umep' due to an error when calling its classFactory() method 

ImportError: DLL load failed while importing _ufuncs: The specified module could not be found. 
Traceback (most recent call last):
  File "C:/PROGRA~1/QGIS31~1.5/apps/qgis-ltr/./python\qgis\utils.py", line 334, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\__init__.py", line 38, in classFactory
    from .processing_umep import ProcessingUMEPPlugin
  File "C:/PROGRA~1/QGIS31~1.5/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processing_umep.py", line 38, in 
    from .processing_umep_provider import ProcessingUMEPProvider
  File "C:/PROGRA~1/QGIS31~1.5/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processing_umep_provider.py", line 36, in 
    from .preprocessor.wall_heightaspect_algorithm import ProcessingWallHeightAscpetAlgorithm
  File "C:/PROGRA~1/QGIS31~1.5/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\preprocessor\wall_heightaspect_algorithm.py", line 52, in 
    from ..functions import wallalgorithms as wa
  File "C:/PROGRA~1/QGIS31~1.5/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:/Users/User/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\wallalgorithms.py", line 8, in 
    import scipy.ndimage.interpolation as sc
  File "C:/PROGRA~1/QGIS31~1.5/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\QGIS31~1.5\apps\Python39\lib\site-packages\scipy\ndimage\__init__.py", line 153, in 
    from .interpolation import *
  File "C:/PROGRA~1/QGIS31~1.5/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\QGIS31~1.5\apps\Python39\lib\site-packages\scipy\ndimage\interpolation.py", line 37, in 
    from scipy import special
  File "C:/PROGRA~1/QGIS31~1.5/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\PROGRA~1\QGIS31~1.5\apps\Python39\lib\site-packages\scipy\special\__init__.py", line 633, in 
    from . import _ufuncs
  File "C:/PROGRA~1/QGIS31~1.5/apps/qgis-ltr/./python\qgis\utils.py", line 792, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ImportError: DLL load failed while importing _ufuncs: The specified module could not be found.


Python version: 3.9.0 (tags/v3.9.0:9cf6752, Oct  5 2020, 15:34:40) [MSC v.1927 64 bit (AMD64)] 
QGIS version: 3.16.5-Hannover Hannover, 58ba7c1e 

Request for Adding Functionality: Export Occurrence Map of TreePlanter

Dear Developers,

I would like to propose an enhancement for TreePlanter to include a new feature that allows users to export the occurrence maps for the random starting option by Hill-Climbing Algorithm. This feature would greatly benefit the analysis by sharing different data generated by the plugin.

Looking forward to it!

Best.
X

Outdoor TC: AttributeError

Hey!

When running Outdoor Thermal Comfort: Spatial Thermal Comfort (from the post processor) to calculate PET, it returns the error message below. From the spatialtc algorithm.py it seems to attempt to extract a building raster from the SOLWEIG output, which does not exist.

Regards, Emil

QGIS version: 3.28.0-Firenze
QGIS code revision: ed3ad0430f3
Qt version: 5.15.3
Python version: 3.9.5
GDAL version: 3.5.3
GEOS version: 3.10.3-CAPI-1.16.1
PROJ version: Rel. 9.1.0, September 1st, 2022
PDAL version: 2.4.3 (git-version: 434757)
Algorithm started at: 2023-05-03T11:30:12
Algorithm 'Outdoor Thermal Comfort: Spatial Thermal Comfort' starting…
Input parameters:
{ 'ACTIVITY' : 80, 'AGE' : 35, 'CLO' : 0.9, 'COMFA' : False, 'HEIGHT' : 180, 'SEX' : 0, 'TC_OUT' : 'C:/Users/Emil Severiens/Desktop/GU/Sustainable Development Case Study/Data/PET/PET.tif', 'TC_TYPE' : 0, 'TMRT_MAP' : 'C:/Users/Emil Severiens/Desktop/GU/Sustainable Development Case Study/Data/Tmrt_average1.tif', 'UROCK_MAP' : 'C:/Users/Emil Severiens/Desktop/GU/Sustainable Development Case Study/Data/URock output/ClippedWS6.tif', 'WEIGHT' : 75 }

Initializing...
Traceback (most recent call last):
File "C:\Users/Emil Severiens/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\postprocessor\spatialtc_algorithm.py", line 240, in processAlgorithm
build = gdal_buildings.ReadAsArray().astype(float)
AttributeError: 'NoneType' object has no attribute 'ReadAsArray'

Execution failed after 0.13 seconds

Loading resulting layers
Algorithm 'Outdoor Thermal Comfort: Spatial Thermal Comfort' finished

Error in URock Analyzer part2

Model runs successfully but the Analyzer complains. I ran at 1 meter resolution.

Modeloutput.zip

QGIS version: 3.32.3-Lima
QGIS code revision: 67d46100b5
Qt version: 5.15.3
Python version: 3.9.5
GDAL version: 3.7.2
GEOS version: 3.12.0-CAPI-1.18.0

PROJ version: Rel. 9.3.0, September 1st, 2023
PDAL version: 2.5.5 (git-version: 24f78d)
Algorithm started at: 2023-10-12T13:58:36
Algorithm 'Urban Wind Field: URock AnalyZer' starting…
Input parameters:
{ 'ID_FIELD_LINES' : 'id', 'ID_FIELD_POLYGONS' : '', 'INPUT_LINES' : 'C:/Users/xlinfr/Downloads/dataWindExerciseTEst/lineprofile.shp', 'INPUT_POLYGONS' : None, 'INPUT_WIND_FILE' : 'C:\\Users\\xlinfr\\Downloads\\dataWindExerciseTEst\\out270_1m_1mout\\urock_output.nc', 'IS_STREAM' : False, 'OUTPUT_DIRECTORY' : 'C:\\Users\\xlinfr\\Downloads\\dataWindExerciseTEst\\out270_1m_1mout', 'SIMULATION_NAME' : '' }

Load NetCDF file in Python and save as csv file...
Load csv file into H2GIS Database...
Calculates vertical sectional plot (along lines)...
java.lang.java.lang.IllegalStateException: java.lang.IllegalStateException: Chunk 1120 not found [1.4.200/9]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "JdbcPreparedStatement.java", line 237, in org.h2.jdbc.JdbcPreparedStatement.execute
java.lang.java.lang.IllegalStateException: java.lang.IllegalStateException: Unable to read the page at position 307863261765461 [1.4.200/6]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "JdbcPreparedStatement.java", line 237, in org.h2.jdbc.JdbcPreparedStatement.execute
Exception: Java Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\xlinfr\AppData\Roaming\Python\Python39\site-packages\jaydebeapi\__init__.py", line 534, in execute
is_rs = self._prep.execute()
org.h2.jdbc.org.h2.jdbc.JdbcSQLNonTransientException: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.IllegalStateException: Unable to read the page at position 307863261765461 [1.4.200/6]"; SQL statement:

CREATE SPATIAL INDEX IF NOT EXISTS id_THE_GEOM_ALL_POINTS_20231012135836 ON ALL_POINTS_20231012135836(THE_GEOM); [50000-200]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\postprocessor\urock_analyser_algorithm.py", line 275, in processAlgorithm
plotSectionalViews(pluginDirectory = plugin_directory,
File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\urock_analyser_functions.py", line 208, in plotSectionalViews
cursor.execute("""
File "C:\Users\xlinfr\AppData\Roaming\Python\Python39\site-packages\jaydebeapi\__init__.py", line 536, in execute
_handle_sql_exception()
File "C:\Users\xlinfr\AppData\Roaming\Python\Python39\site-packages\jaydebeapi\__init__.py", line 165, in _handle_sql_exception_jpype
reraise(exc_type, exc_info[1], exc_info[2])
File "C:\Users\xlinfr\AppData\Roaming\Python\Python39\site-packages\jaydebeapi\__init__.py", line 57, in reraise
raise value.with_traceback(tb)
File "C:\Users\xlinfr\AppData\Roaming\Python\Python39\site-packages\jaydebeapi\__init__.py", line 534, in execute
is_rs = self._prep.execute()
jaydebeapi.DatabaseError: org.h2.jdbc.JdbcSQLNonTransientException: General error: "java.lang.IllegalStateException: Unable to read the page at position 307863261765461 [1.4.200/6]"; SQL statement:

CREATE SPATIAL INDEX IF NOT EXISTS id_THE_GEOM_ALL_POINTS_20231012135836 ON ALL_POINTS_20231012135836(THE_GEOM); [50000-200]

Execution failed after 796.75 seconds (13 minutes 17 seconds)

Loading resulting layers
Algorithm 'Urban Wind Field: URock AnalyZer' finished

URock street canyon scheme update

When using the street canyon scheme, two problems have been raised:

  1. The initial wind speed within the canyon is not a function of the aspect ratio while a deep canyon should have wind speed close to 0.
  2. The wind speed in the canyon might be affected by the size of the height of the downwind building. If the downstream building is higher than the upwind one, the wind speed in the canyon should be slightly increased while slightly decreased if it is lower.

For 1, I propose to multiply the current wind factors by $\frac{\frac{1}{H/W}^2}{1+\frac{1}{H/W}^2}$ and for 2 to multiply by $(1+\frac{0.6 dH}{H+|0.6 dH|})$ where H/W the aspect ratio of the canyon, H the height of the canyon and dH = Hdownstream-Hupstream.

I have the code for this version. I propose I push on my repo and you have a try with the zip file to see how it affect the results in your area ?

@biglimp

local variable 'leafon' referenced before assignment when running SOLWEIG without CDSM

When running SOLWEIG without any CDSM 'INPUT_CDSM': None, in the algs, following error message is shown:


Traceback (most recent call last):
  File "c:\JankaSolweig\runsolweig_notree.py", line 164, in <module>
    processing.run("umep:Outdoor Thermal Comfort: SOLWEIG", solweig_algs )
  File "C:\OSGeo4W\apps\qgis\python\plugins\processing\tools\general.py", line 108, in run
    return Processing.runAlgorithm(algOrName, parameters, onFinish, feedback, context)
  File "C:\OSGeo4W\apps\qgis\python\plugins\processing\core\Processing.py", line 187, in runAlgorithm
    ret, results = execute(alg, parameters, context, feedback, catch_exceptions=False)
  File "C:\OSGeo4W\apps\qgis\python\plugins\processing\gui\AlgorithmExecutor.py", line 72, in execute
    results, ok = alg.run(parameters, context, feedback, {}, False)
_core.QgsProcessingException: Traceback (most recent call last):
  File "C:\Users\xbacos\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\processing_umep\processor\solweig_algorithm.py", line 799, in processAlgorithm
    psi = leafon * 0. + 1.
UnboundLocalError: local variable 'leafon' referenced before assignment

Desktop (please complete the following information):
OS: Windows
QGIS Version: 3.26.0
UMEP Version: 1.7.6
SuPy Version: 2022.4.7

Urock issue: simplifed vs generalised vectors

When using building and vegetation vectors that have been simplified using the QGIS Simplify tool (Douglas-Peucker at 1.5m as recommended), the model fails to run, due to

org.locationtech.jts.geom.org.locationtech.jts.geom.TopologyException: org.locationtech.jts.geom.TopologyException: found non-noded intersection between LINESTRING ( 527356.9999999991 5252488.000000001, 527356.0637653562 5252487.063765359 ) and LINESTRING ( 527356.0659019575 5252487.06590196, 527355.9999999991 5252487.050577191 ) [ (527356.0659019573, 5252487.06590196, NaN) ]

However, when the vectors are generalised (GRASS generalize tool, douglas, 1.5 max tolerance value), the model runs well. I'm using vertical and horizontal resolutions of 2m.

error_log_simp_vs_gen.txt

urock_vectors_simplified_1.5m.zip
urock_vectors_generalised_1.5m.zip

Treeplanter 0 possible location for trees

Hi, when trying to use Treeplanter with a shapefile containing a single polygon, Treeplanter runs but says there are 0 possible locations. it then proceeds to place all three tree on top of each other in the upper left corner of the layer.

QGIS version: 3.32.0-Lima
QGIS code revision: b9862de816
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.3.2
GEOS version: 3.9.1-CAPI-1.14.2
PROJ version: Rel. 8.1.1, September 1st, 2021
PDAL version: 2.3.0 (git-version: Release)
Algorithm started at: 2023-07-21T18:53:03
Algorithm 'Outdoor Thermal Comfort: TreePlanter v1.0.1' starting…
Input parameters:
{ 'DIA' : 5, 'END_HOUR' : 15, 'GREEDY_ALGORITHM' : False, 'HEIGHT' : 10, 'INCLUDE_OUTSIDE' : True, 'INPUT_POLYGONLAYER' : '/Users/USERNAME/Desktop/Uni_2/Bachelor/GIS_Daten/BA/platz_shp.shp', 'ITERATIONS' : 2000, 'NTREE' : 3, 'OUTPUT_CDSM' : 'TEMPORARY_OUTPUT', 'OUTPUT_POINTFILE' : 'TEMPORARY_OUTPUT', 'RANDOM_STARTING' : False, 'SOLWEIG_DIR' : '/Users/USERNAME/Desktop/Uni_2/Bachelor/GIS_Daten/BA/solweig_test', 'START_HOUR' : 13, 'TRANS_VEG' : 3, 'TRUNK' : 3, 'TTYPE' : 0 }

Starting model at 2023-07-21 18:53:03.554962...
Initializing and loading layers...
Loading /Users/USERNAME/Desktop/Uni_2/Bachelor/GIS_Daten/BA/solweig_test/Shadow_2022_200_1300D.tif..
Loading /Users/USERNAME/Desktop/Uni_2/Bachelor/GIS_Daten/BA/solweig_test/Tmrt_2022_200_1300D.tif..
Loading /Users/USERNAME/Desktop/Uni_2/Bachelor/GIS_Daten/BA/solweig_test/Shadow_2022_200_1400D.tif..
Loading /Users/USERNAME/Desktop/Uni_2/Bachelor/GIS_Daten/BA/solweig_test/Tmrt_2022_200_1400D.tif..
Running hill climbing algorithm with genetic algorithm for starting positions...
0 possible locations for trees...
10.0 percent of iterations finished...
20.0 percent of iterations finished...
30.0 percent of iterations finished...
40.0 percent of iterations finished...
50.0 percent of iterations finished...
60.0 percent of iterations finished...
70.0 percent of iterations finished...
80.0 percent of iterations finished...
90.0 percent of iterations finished...
TreePlanter: Model calculation finished.
Execution completed in 12.57 seconds
Results:
{'OUTPUT_CDSM': '/private/var/folders/pj/9cktp88d6n5d6n8rld_4bksh0000gn/T/processing_hqHHbR/7b15650a72d045cabaec9ddb7d6b95c6/OUTPUT_CDSM.tif',
'OUTPUT_POINTFILE': '/private/var/folders/pj/9cktp88d6n5d6n8rld_4bksh0000gn/T/processing_hqHHbR/22f1edc808af4e11a96e1c599368544f/OUTPUT_POINTFILE.gpkg'}

Loading resulting layers
Algorithm 'Outdoor Thermal Comfort: TreePlanter v1.0.1' finished

The output looks like this:

Bildschirmfoto 2023-07-21 um 19 01 49

The Version of UMEP-processing used was cloned from this repo today
Also when trying to use vector on .gpkg format it doesn´t work at all...
The SOLWEIG output was generated with "save files for treeplanter" checked

Error running Spatial Thermal Comfort

Hi,

I got errors when running the TC tool, first:

QGIS version: 3.22.4-Białowieża
QGIS code revision: ce8e65e9
Qt version: 5.15.2
Python version: 3.9.5
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: 9f35b7)
Algorithm started at: 2023-06-26T11:31:11
Algorithm 'Outdoor Thermal Comfort: Spatial Thermal Comfort' starting…
Input parameters:
{ 'ACTIVITY' : 80, 'AGE' : 35, 'CLO' : 0.9, 'COMFA' : False, 'HEIGHT' : 180, 'SEX' : 0, 'TC_OUT' : 'C:/Users/BNHG/COWI/A133863 - FoU UEQ-projektet - Documents/4-Projektering/03-Beräkningar/Komfortindex/Test/Outputs/PET_Vind05_Klovervallen.tif', 'TC_TYPE' : 0, 'TMRT_MAP' : 'C:/Users/BNHG/COWI/A133863 - FoU UEQ-projektet - Documents/4-Projektering/03-Beräkningar/Komfortindex/Test/Outputs/Tmrt/Tmrt_2018_206_1500D.tif', 'UROCK_MAP' : 'C:/Users/BNHG/COWI/A133863 - FoU UEQ-projektet - Documents/4-Projektering/03-Beräkningar/Komfortindex/Test/Outputs/Tmrt/Klovervallen_Vind_0_5_ms.tif', 'WEIGHT' : 75 }

Initializing...
Traceback (most recent call last):
File "C:\Users/BNHG/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\postprocessor\spatialtc_algorithm.py", line 240, in processAlgorithm
build = gdal_buildings.ReadAsArray().astype(float)
AttributeError: 'NoneType' object has no attribute 'ReadAsArray'
Execution failed after 0.04 seconds

Which I got help with by changing my output SOLWEIG directory from Tmrt to whatever else.

Second issue regarded the met file:

Error: Make sure format of meteorological file is correct. You canprepare your data by using 'Prepare Existing Data' in the Pre-processor
Execution failed after 0.02 seconds

It seemed to work if I moved my SOLWEIG met file to the ouput folder and renamed it metforcing.txt

Error while importing ProcessingUMEPProvider

I am working in Spyder, Windows 10. Just following the instruction from documentation.

`import sys

Initiating a QGIS application

qgishome = 'C:/OSGeo4W64/apps/qgis/'
QgsApplication.setPrefixPath(qgishome, True)
app = QgsApplication([], False)
app.initQgis()

import third party processing plugins

sys.path.append(r'C:\Users\ your_username \AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins')
from processing_umep.processing_umep_provider import ProcessingUMEPProvider`

`C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\IPython\utils_process_win32.py:145: ResourceWarning: unclosed file <_io.BufferedWriter name=4>
return process_handler(cmd, _system_body)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\IPython\utils_process_win32.py:145: ResourceWarning: unclosed file <_io.BufferedReader name=5>
return process_handler(cmd, _system_body)
ResourceWarning: Enable tracemalloc to get the object allocation traceback
C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\IPython\utils_process_win32.py:145: ResourceWarning: unclosed file <_io.BufferedReader name=6>
return process_handler(cmd, _system_body)
ResourceWarning: Enable tracemalloc to get the object allocation traceback

runfile('C:/Users/XYZ/.spyder-py3/temp.py', wdir='C:/Users/XYZ/.spyder-py3')
Reloaded modules: processing_umep, processing_umep.functions.wallalgorithms, processing_umep.util, processing_umep.util.misc, processing_umep.preprocessor.wall_heightaspect_algorithm, processing_umep.util.shadowingfunctions, processing_umep.functions.svf_functions, processing_umep.preprocessor.skyviewfactor_algorithm
Traceback (most recent call last):

File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\internals\construction.py", line 568, in _list_to_arrays
columns = _validate_or_indexify_columns(content, columns)

File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\internals\construction.py", line 692, in _validate_or_indexify_columns
raise AssertionError(

AssertionError: 3 columns passed, passed data had 4 columns

The above exception was the direct cause of the following exception:

Traceback (most recent call last):

File "C:\Users\XYZ.spyder-py3\temp.py", line 11, in
from processing_umep.processing_umep_provider import ProcessingUMEPProvider

File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)

File "C:\Users\XYZ\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\processing_umep\processing_umep_provider.py", line 38, in
from .preprocessor.copernicusera5_algorithm import ProcessingCopernicusERA5Algorithm

File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)

File "C:\Users\XYZ\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\processing_umep\preprocessor\copernicusera5_algorithm.py", line 64, in
import supy as sp

File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)

File "C:\Users\XYZ\AppData\Roaming\Python\Python39\site-packages\supy_init_.py", line 12, in
from .supy_module import (init_supy, load_SampleData,

File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)

File "C:\Users\XYZ\AppData\Roaming\Python\Python39\site-packages\supy\supy_module.py", line 39, in
from .supy_post import pack_df_output, pack_df_output_array, pack_df_state

File "C:\Users\XYZ\anaconda3\envs\qgis_env\Library\python\qgis\utils.py", line 799, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)

File "C:\Users\XYZ\AppData\Roaming\Python\Python39\site-packages\supy\supy_post.py", line 23, in
var_df = get_output_info_df()

File "C:\Users\XYZ\AppData\Roaming\Python\Python39\site-packages\supy\supy_post.py", line 14, in get_output_info_df
df_var_list = pd.DataFrame(var_list_x, columns=['var', 'group', 'aggm'])

File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\frame.py", line 570, in init
arrays, columns = to_arrays(data, columns, dtype=dtype)

File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\internals\construction.py", line 552, in to_arrays
return _list_to_arrays(data, columns, coerce_float=coerce_float, dtype=dtype)

File "C:\Users\XYZ\anaconda3\envs\qgis_env\lib\site-packages\pandas\core\internals\construction.py", line 571, in _list_to_arrays
raise ValueError(e) from e

ValueError: 3 columns passed, passed data had 4 columns`

Treeplanter Attribute Error "NoneType" when trying to use selected feature

After trying and failing to use a shapefile with one polygon (#34 ) , i tried selecting the polygon and to check "Selected features only"
This produces

QGIS version: 3.32.0-Lima
QGIS code revision: b9862de816
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.3.2
GEOS version: 3.9.1-CAPI-1.14.2
PROJ version: Rel. 8.1.1, September 1st, 2021
PDAL version: 2.3.0 (git-version: Release)
Algorithm started at: 2023-07-21T19:07:45
Algorithm 'Outdoor Thermal Comfort: TreePlanter v1.0.1' starting…
Input parameters:
{ 'DIA' : 5, 'END_HOUR' : 15, 'GREEDY_ALGORITHM' : False, 'HEIGHT' : 10, 'INCLUDE_OUTSIDE' : True, 'INPUT_POLYGONLAYER' : QgsProcessingFeatureSourceDefinition('/Users/USERNAME/Desktop/Uni_2/Bachelor/GIS_Daten/BA/platz_shp.shp', selectedFeaturesOnly=True, featureLimit=-1, geometryCheck=QgsFeatureRequest.GeometryAbortOnInvalid), 'ITERATIONS' : 2000, 'NTREE' : 3, 'OUTPUT_CDSM' : 'TEMPORARY_OUTPUT', 'OUTPUT_POINTFILE' : 'TEMPORARY_OUTPUT', 'RANDOM_STARTING' : False, 'SOLWEIG_DIR' : '/Users/USERNAME/Desktop/Uni_2/Bachelor/GIS_Daten/BA/solweig_test', 'START_HOUR' : 13, 'TRANS_VEG' : 3, 'TRUNK' : 3, 'TTYPE' : 0 }

Traceback (most recent call last):
File "/Users/USERNAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/postprocessor/treeplanter_algorithm.py", line 242, in processAlgorithm
inputPolygonlayer = self.parameterAsVectorLayer(parameters, self.INPUT_POLYGONLAYER, context).dataProvider().dataSourceUri()
AttributeError: 'NoneType' object has no attribute 'dataProvider'

Execution failed after 0.03 seconds

Loading resulting layers
Algorithm 'Outdoor Thermal Comfort: TreePlanter v1.0.1' finished

Spatial thermal comfort error

Discussed in UMEP-dev/UMEP#574

Originally posted by sanwitiab November 22, 2023
Hi, I tried to do a post-processor with Spatial Thermal Comfort tools. However, after I set every input parameter and press run.
I got this error message.

241, in processAlgorithm
build = gdal_buildings.ReadAsArray().astype(float)
AttributeError: 'NoneType' object has no attribute 'ReadAsArray'

Error with numba in URock

Error when starting QGIS 3.30.2 & 3.28.6

Couldn't load plugin 'processing_umep' due to an error when calling its classFactory() method 

SystemError: initialization of _internal failed without raising an exception 
Traceback (most recent call last):
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:\Users/xbacos/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\__init__.py", line 38, in classFactory
    from .processing_umep import ProcessingUMEPPlugin
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xbacos/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processing_umep.py", line 38, in 
    from .processing_umep_provider import ProcessingUMEPProvider
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xbacos/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processing_umep_provider.py", line 54, in 
    from .processor.urock_processing_algorithm import URockAlgorithm
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xbacos/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\processor\urock_processing_algorithm.py", line 63, in 
    from ..functions.URock import MainCalculation
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xbacos/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\MainCalculation.py", line 19, in 
    from . import WindSolver
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xbacos/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\URock\WindSolver.py", line 18, in 
    from numba import jit
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users\xbacos\AppData\Roaming\Python\Python39\site-packages\numba\__init__.py", line 42, in 
    from numba.np.ufunc import (vectorize, guvectorize, threading_layer,
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users\xbacos\AppData\Roaming\Python\Python39\site-packages\numba\np\ufunc\__init__.py", line 3, in 
    from numba.np.ufunc.decorators import Vectorize, GUVectorize, vectorize, guvectorize
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users\xbacos\AppData\Roaming\Python\Python39\site-packages\numba\np\ufunc\decorators.py", line 3, in 
    from numba.np.ufunc import _internal
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
SystemError: initialization of _internal failed without raising an exception

Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
QGIS version: 3.30.2-'s-Hertogenbosch 's-Hertogenbosch, 0992b533

running
import numba in python console generate similar error

`Traceback (most recent call last):
  File "C:\OSGeo4W\apps\Python39\lib\code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users\xbacos\AppData\Roaming\Python\Python39\site-packages\numba\__init__.py", line 42, in <module>
    from numba.np.ufunc import (vectorize, guvectorize, threading_layer,
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users\xbacos\AppData\Roaming\Python\Python39\site-packages\numba\np\ufunc\__init__.py", line 3, in <module>
    from numba.np.ufunc.decorators import Vectorize, GUVectorize, vectorize, guvectorize
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users\xbacos\AppData\Roaming\Python\Python39\site-packages\numba\np\ufunc\decorators.py", line 3, in <module>
    from numba.np.ufunc import _internal
  File "C:\OSGeo4W/apps/qgis-ltr/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
SystemError: initialization of _internal failed without raising an exception


Urock: intermittant NumberFormatException

When running URock in a loop, I occasionally get a NumberFormatException error, causing the code to fail. When I rerun the individual combination of speed and direction, the error doesn't occur.

The loop I use is below. I have included some example errors in a txt file.
NumberFormatException errors.txt

df = pd.concat([pd.read_csv(i, sep=' ') for i in glob.glob("/mnt/bweeding_workspace/phd_jupyter/paper3_workflows/p3_metfiles/*.txt", recursive=True)])

data = {'wdir': 5 * round(df['wdir']/5).values,
        'U': 0.5 * round(df['U']/0.5).values}

wind_frame = pd.DataFrame(data)

cur_df = np.array_split(wind_frame.drop_duplicates(),6)[0].reset_index()

current_folder = '/mnt/bweeding_workspace/phd_jupyter/paper3_workflows/p3_digital_models/'

for idx in range(0,len(cur_df)):
    
        try:
            
            print(str(idx)+ ' of '+str(len(cur_df)))
        
            processing.run("umep:Urban Wind Field: URock", 
            {'BUILDINGS':current_folder+'build_height_gen15.shp',
            'HEIGHT_FIELD_BUILD':'ROOF_HEIGH',
            'VEGETATION':current_folder+'veg_height_gen15.shp',
            'VEGETATION_CROWN_TOP_HEIGHT':'VEG_HEIGHT',
            'VEGETATION_CROWN_BASE_HEIGHT':'',
            'ATTENUATION_FIELD':'',
            'INPUT_PROFILE_FILE':'',
            'INPUT_PROFILE_TYPE':0,
            'INPUT_WIND_HEIGHT':10,
            'INPUT_WIND_SPEED':str(cur_df['U'][idx]),
            'INPUT_WIND_DIRECTION':str(cur_df['wdir'][idx]),
            'RASTER_OUTPUT':current_folder+'mp_dsm_50mb_modified_final.tif',
            'HORIZONTAL_RESOLUTION':2,
            'VERTICAL_RESOLUTION':2,
            'WIND_HEIGHT':'1.5',
            'UROCK_OUTPUT':'/scratch/bweeding/p3_outputs/p3_urock_outputs_2m/CNRM-CERFACS-CNRM-CM5'+'_uwind_'+str(cur_df['U'][idx])+'_wdir'+str(cur_df['wdir'][idx])+'/',
            'OUTPUT_FILENAME':'CNRM-CERFACS-CNRM-CM5_uwind_'+str(cur_df['U'][idx])+'_wdir'+str(cur_df['wdir'][idx]),
            'SAVE_RASTER':True,
            'SAVE_VECTOR':False,
            'SAVE_NETCDF':False,
            'LOAD_OUTPUT':False})
            
            rast = rx.open_rasterio('/scratch/bweeding/p3_outputs/p3_urock_outputs_2m/CNRM-CERFACS-CNRM-CM5_uwind_'+str(cur_df['U'][idx])+'_wdir'+str(cur_df['wdir'][idx])+'/z1_5/CNRM-CERFACS-CNRM-CM5_uwind_'+str(cur_df['U'][idx])+'_wdir'+str(cur_df['wdir'][idx])+'WS.Gtiff')

            print('rast opened')

            rast = rast.reindex(y=list(reversed(rast.y)))

            rast['x'] = rast.x-0.5

            rast['y'] = rast.y-0.5

            rast = rast[0,:,:]
                                    
            rast.transpose().to_zarr('/scratch/bweeding/p3_outputs/p3_urock_outputs_2m/uwind_'+str(cur_df['U'][idx])+'_wdir'+str(cur_df['wdir'][idx])+'.zarr')                        
                                    
            rast.close()
                                    
            os.system('rm -r /scratch/bweeding/p3_outputs/p3_urock_outputs_2m/CNRM-CERFACS-CNRM-CM5'+'_uwind_'+str(cur_df['U'][idx])+'_wdir'+str(cur_df['wdir'][idx]))

        except:
            
            print('Failed')
            print('INPUT_WIND_SPEED:'+str(cur_df['U'][idx]))
            print('INPUT_WIND_DIRECTION:'+str(cur_df['wdir'][idx]))
            

SpatialTC ERROR

Discussed in UMEP-dev/UMEP#570

Originally posted by VladimirSobral November 18, 2023
Hi,

I´m using spatial thermal comfort to generate a PET map but I had this message:

Traceback (most recent call last):
File "C:\Users/VLADIMIR/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\postprocessor\spatialtc_algorithm.py", line 274, in processAlgorithm
yyyyTmrt = int(filepath_tmrt[-18:-14])
ValueError: invalid literal for int() with base 10: '_202'

Could anyone help me please?

Thanks
pet

Error when first installation of UMEP

This pops up when Installing UMEP for the first time. After restarting QGIS this error message goes away.

Is there anyway of including a try statement to get rid of this?

Couldn't load plugin 'UMEP-processing-main' due to an error when calling its classFactory() method 

SystemExit: 'jaydebeapi' Python package is missing 
Traceback (most recent call last):
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\functions\URock\H2gisConnection.py", line 23, in 
    import jaydebeapi
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
ModuleNotFoundError: No module named 'jaydebeapi'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 423, in _startPlugin
    plugins[packageName] = package.classFactory(iface)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\__init__.py", line 38, in classFactory
    from .processing_umep import ProcessingUMEPPlugin
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\processing_umep.py", line 38, in 
    from .processing_umep_provider import ProcessingUMEPProvider
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\processing_umep_provider.py", line 54, in 
    from .processor.urock_processing_algorithm import URockAlgorithm
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\processor\urock_processing_algorithm.py", line 63, in 
    from ..functions.URock import MainCalculation
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\functions\URock\MainCalculation.py", line 11, in 
    from . import H2gisConnection
  File "C:\OSGeo4W/apps/qgis/./python\qgis\utils.py", line 888, in _import
    mod = _builtin_import(name, globals, locals, fromlist, level)
  File "C:\Users/xlinfr/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP-processing-main\functions\URock\H2gisConnection.py", line 27, in 
    exit("'jaydebeapi' Python package is missing")
  File "C:\OSGeo4W\apps\Python39\lib\_sitebuiltins.py", line 26, in __call__
    raise SystemExit(code)
SystemExit: 'jaydebeapi' Python package is missing

Numpy error on startup

Hi,
in order to run UMEP i had to upgrade my numpy. Now the conflicting versions error has gone and another error has appeared.
MacOS 12.5
QGIS: 3.30.3
Numpy: 1.25.0

I first tried the latest version of the plugin from the qgis plugin-repo; after that didnt work i got the zip of this repo and installed it manually.
Is there some way in which i can use UMEP-processing? i need it because the pre-processors "Tree Generator" & "Sky View Factor" are only available in the processing version.

Error:
"Couldn't load plugin 'UMEP-processing-main' due to an error when calling its classFactory() method

AttributeError: module 'numpy' has no attribute 'long'
Traceback (most recent call last):
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 423, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/init.py", line 38, in classFactory
from .processing_umep import ProcessingUMEPPlugin
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/processing_umep.py", line 38, in
from .processing_umep_provider import ProcessingUMEPProvider
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/processing_umep_provider.py", line 54, in
from .processor.urock_processing_algorithm import URockAlgorithm
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/processor/urock_processing_algorithm.py", line 63, in
from ..functions.URock import MainCalculation
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/functions/URock/MainCalculation.py", line 19, in
from . import WindSolver
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP-processing-main/functions/URock/WindSolver.py", line 18, in
from numba import jit
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/numba-0.50.1-py3.9-macosx-10.13.0-x86_64.egg/numba/init.py", line 16, in
from numba.core import types, errors
File "/Applications/QGIS.app/Contents/MacOS/../Resources/python/qgis/utils.py", line 888, in _import
mod = builtin_import(name, globals, locals, fromlist, level)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/numba-0.50.1-py3.9-macosx-10.13.0-x86_64.egg/numba/core/types/init.py", line 108, in
long
= _make_signed(np.long)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/numpy/init.py", line 322, in getattr
raise AttributeError("module {!r} has no attribute "
AttributeError: module 'numpy' has no attribute 'long'

Python version: 3.9.5 (default, Sep 10 2021, 16:18:19) [Clang 12.0.5 (clang-1205.0.22.11)]
QGIS version: 3.30.3-'s-Hertogenbosch 's-Hertogenbosch, 2411cec112

Python Path:
/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/UMEP/SUEWSPrepare/Modules
/Applications/QGIS.app/Contents/MacOS/../Resources/python
/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python
/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins
/Applications/QGIS.app/Contents/MacOS/../Resources/python/plugins
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/statsmodels-0.11.1-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/Rtree-0.9.7-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/cftime-1.2.1-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/GDAL-3.3.2-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/pandas-1.3.3-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/lib-dynload
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/opencv_contrib_python-4.3.0.36-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/netCDF4-1.5.4-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/Pillow-7.2.0-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/scipy-1.5.1-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/patsy-0.5.1-py3.9.egg
/Users/USR-NAME/.local/lib/python3.9/site-packages
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/matplotlib-3.3.0-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python39.zip
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/numba-0.50.1-py3.9-macosx-10.13.0-x86_64.egg
/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/pyproj-3.2.0-py3.9-macosx-10.13.0-x86_64.egg
/Users/USR-NAME/Library/Application Support/QGIS/QGIS3/profiles/default/python"

SpatialTC not calculating UTCI due to Attribute Error

The SpatialTC Component is not able to call the utci function as there is an attribute error. Its probably a typo as its trying to call utci.utci_calculator_grid, while the only function present in UTCI_calculations is utci_calculator. I know that in the docs it is stated that there is only PET available, but the page has last been changed on March 23rd whilst there has been a commit by Nils Wallenberg with the title "Updated Spatial TC. COMFA and UTCI now available." on April 24th and the feature is in the official changelog under 2.0.2.

Also the first part of the utci_calculator function throws an error due to an ambiguous array.
I patched it for my personal use as I know that my grids are complete and thus i do not need to check if theres a -999 value.

Im sorry that this issue is not as detailed as it could be but I am in a rush right now and thought its better to submit what i found out than not submit it 😅

UMEP Processing is producing several errors with the Tree Planter tutorial data set

OS: Ubuntu 20.04
QGis: 3.18

UMEP Processing plugin, v1.6.1
Pre-processing with SVF, height and aspect.
Processing with SOLWEIG, Tree Planter

I have been testing the Tree Planter tutorial, as the Tree Planter genetic algorithm is generally failing for almost all 'small polygon' scenarios with that I test it with. Generally the greedy algorithm ('GA') is OK.

For this issue: UMEP Processing is producing several errors with the Tree Planter tutorial data set.

(1) SOLWEIG: shadow generation errors for hours 2200, 2300, 0000, 0100, 0200, 0300.
Raster Min: 1.79769e+308, Max: -1.79769e+308
All other shadow and Tmrt rasters OK.
No Errors for the shadow rasters if I run the metfile between 0400 - 2100 (i.e. exclude the hours above).

Same shadow errors if I use the "Solar Radiation: Shadow Generator" tool.

(2) Tree Planter: genetic algorithm in all its permutations fails. Also for runs from 0400 - 2100. The greedy algorithm generally works.

There was no difference if I used the UMEP plugin to run SVF, height, aspect and SOLWEIG.

What is the GA traceback indicating?
TreePlanter/TreePlanter/TreePlanterTreeshade.py", line 88, in tsh_gen_mt2 tsh_bool_pad[yslice2, xslice2, :] += treerasters.treeshade_bool[yslice1, xslice2, :] ValueError: operands could not be broadcast together with shapes (11,7,2) (11,0,2) (11,7,2)

Log files attached for SVF, SOLWEIG, Tree Planter.
LOG_SVF_SOLW_TPL.zip

Urock prepare: fails when including DEM

When preparing the building and vegetation files using Urock prepare, the inclusion of a DEM file causes the following error:
image
This error doesn't occur when just using the DSM and CDSM, and doesn't occur on my linux based server, only my windows laptop. I'm using the latest zipped version of Urock.

urock_source_files_issue.zip

URock Error: Trying to call NONE SQL-Function

Hi,
Whilst trying to run URock with data prepared with the Component "URock Prepare" I am running into the following issue:

QGIS version: 3.30.3-'s-Hertogenbosch
QGIS code revision: 2411cec112
Qt version: 5.15.2
Python version: 3.9.5
GDAL version: 3.3.2
GEOS version: 3.9.1-CAPI-1.14.2
PROJ version: Rel. 8.1.1, September 1st, 2021
PDAL version: 2.3.0 (git-version: Release)
Algorithm started at: 2023-07-05T17:21:23
Algorithm 'Urban Wind Field: URock v2023a' starting…
Input parameters:
{ 'ATTENUATION_FIELD' : '', 'BUILDINGS' : '/Users/USER1/Desktop/Uni_2/Bachelor/GIS_Daten/clipped_data/URock/building_vector.gpkg', 'HEIGHT_FIELD_BUILD' : 'ROOF_HEIGHT', 'HORIZONTAL_RESOLUTION' : 2, 'INPUT_PROFILE_FILE' : '', 'INPUT_PROFILE_TYPE' : 0, 'INPUT_WIND_DIRECTION' : 45, 'INPUT_WIND_HEIGHT' : 10, 'INPUT_WIND_SPEED' : 2, 'LOAD_OUTPUT' : True, 'OUTPUT_FILENAME' : 'urock_output', 'RASTER_OUTPUT' : None, 'SAVE_NETCDF' : True, 'SAVE_RASTER' : True, 'SAVE_VECTOR' : True, 'UROCK_OUTPUT' : 'TEMPORARY_OUTPUT', 'VEGETATION' : None, 'VEGETATION_CROWN_BASE_HEIGHT' : '', 'VEGETATION_CROWN_TOP_HEIGHT' : '', 'VERTICAL_RESOLUTION' : 2, 'WIND_HEIGHT' : '1.5' }

Writing settings for this model run to specified output folder (Filename: RunInfoURock_YYYY_DOY_HHMM.txt)
Initiating algorithm
Creates an H2GIS Instance and load data
Traceback (most recent call last):
File "JdbcPreparedStatement.java", line 237, in org.h2.jdbc.JdbcPreparedStatement.execute
Exception: Java Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 534, in execute
is_rs = self._prep.execute()
org.h2.jdbc.org.h2.jdbc.JdbcSQLSyntaxErrorException: org.h2.jdbc.JdbcSQLSyntaxErrorException: Funktion "NONE" nicht gefunden
Function "NONE" not found; SQL statement:

CALL None('/Users/USER1/Desktop/Uni_2/Bachelor/GIS_Daten/clipped_data/URock/building_vector.gpkg','TEMPO');
CREATE TABLE build_pre_srid_20230705172123
AS SELECT *
FROM TEMPO;
[90022-200]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/Users/USER1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/processing_umep/processor/urock_processing_algorithm.py", line 433, in processAlgorithm
MainCalculation.main(javaEnvironmentPath = javaEnvVar,
File "/Users/USER1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/processing_umep/functions/URock/MainCalculation.py", line 133, in main
loadData.loadData(fromCad = False,
File "/Users/USER1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/processing_umep/functions/URock/loadData.py", line 120, in loadData
loadFile(cursor = cursor,
File "/Users/USER1/Library/Application Support/QGIS/QGIS3/profiles/default/python/plugins/processing_umep/functions/URock/loadData.py", line 318, in loadFile
cursor.execute("""
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 536, in execute
_handle_sql_exception()
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 165, in _handle_sql_exception_jpype
reraise(exc_type, exc_info[1], exc_info[2])
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 57, in reraise
raise value.with_traceback(tb)
File "/Applications/QGIS.app/Contents/MacOS/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 534, in execute
is_rs = self._prep.execute()
jaydebeapi.DatabaseError: org.h2.jdbc.JdbcSQLSyntaxErrorException: Funktion "NONE" nicht gefunden
Function "NONE" not found; SQL statement:

CALL None('/Users/USER1/Desktop/Uni_2/Bachelor/GIS_Daten/clipped_data/URock/building_vector.gpkg','TEMPO');
CREATE TABLE build_pre_srid_20230705172123
AS SELECT *
FROM TEMPO;
[90022-200]

Execution failed after 0.07 seconds

I have tried using the "QGIS-Store" version of the plugin as well as cloning and installing the repo as .zip
I have tried searching for the table "Tempo" in the referenced gpkg but i could not find it; i have tried manually creating a table named "TEMPO" in the gpkg but it did not help.
Openjdk is on the latest version
JayDeBeAPI is on the latest version
jpype is on the latest version
Official Oracle Java is used (/usr/libexec/java_home points to /Library/Java/JavaVirtualMachines/jdk-18.0.1.1.jdk/Contents/Home)

this happens if i use just building polygons, if i just use vegetation polygons and if i use both it just throws the error for the building gpkg

Is SOLWEIG updated to version v2022a?

Hi!

When I run SOLWEIG from "UMEP for processing" the log file indicates that version 2021a is used:
"This file provides run settings for the SOLWEIG run initiated at: Thu, 01 Dec 2022 12:08:26
Version: SOLWEIG v2021a"

Also, I get a small discrepancy in the output compared to when I run the "ordinary" UMEP SOLWEIG plugin, which in the log file says SOLWEIG v2022a. But I guess that is expected if it's different versions?

I tested with the Gothenburg sample data, which is attached (with output for each case).
Goteborg_SWEREF99_1200.zip

Thanks!

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

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.