UMEP-dev / UMEP

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

Point parameter errors both in Morphometric Calculator and Land Cover Fraction (UMEP Pre-processor) #400

Closed CsillaVG closed 2 years ago

CsillaVG commented 2 years ago

Trying to derive land cover and morphometric parameters for a point during pre-processing results in the following errors when pressing the 'Generate study area' button. The error occurs both under Windows and Mac OS.

Error message for Morphometric Calculator (Grid), Windows File "C:\Users/scully/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\ImageMorphParmsPoint\imagemorphparmspoint_v1.py", line 272, in generate_area self.create_poly_layer() File "C:\Users/scully/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\ImageMorphParmsPoint\imagemorphparmspoint_v1.py", line 316, in create_poly_layer QgsGeometry.fromPointXY(QgsPointXY(self.pointx, self.pointy)).buffer(radius, 1000, 1, 1, 1.0)) TypeError: QgsGeometry.buffer(): arguments did not match any overloaded call: overload 1: too many arguments overload 2: argument 3 has unexpected type 'int'

Example error message for Land Cover Fraction (Grid), Windows File "C:\Users/scully/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\LandCoverFractionPoint\landcover_fraction_point.py", line 290, in generate_area self.create_poly_layer() File "C:\Users/scully/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\UMEP\LandCoverFractionPoint\landcover_fraction_point.py", line 332, in create_poly_layer featurepoly.setGeometry(QgsGeometry.fromPointXY(QgsPointXY(self.pointx, self.pointy)).buffer(radius, 1000, 1, 1, 1.0)) TypeError: QgsGeometry.buffer(): arguments did not match any overloaded call: overload 1: too many arguments overload 2: argument 3 has unexpected type 'int'

To reproduce the above error 1a. Go to UMEP/Pre-Processor/Urban Morphology/ UMEPerror_0404_win.txt UMEPerror_0404_osx.txt OR 1b. Go to UMEP/Pre-Processor/Urban Land Cover/Land Cover Fraction (Grid)

  1. Tick 'Use existing (single) point from vector layer'
  2. Select the layer with a single point from the drop-down list.
  3. Click on the 'Generate study area' button.

Desktop (please complete the following information):

Data Attached are the error messages from both windows and mac as text files. UMEPerror_0404_win.txt UMEPerror_0404_osx.txt

Thank you!

biglimp commented 2 years ago

The QGIS people seem to have changed something here. I will try to fix. One work around is to create a buffer yourself and then run the grid version of the tools.

CsillaVG commented 2 years ago

Great idea. Thank you! That will suffice for now.

The only thing is that, when using a circle as a single gird, the charLength is calculated from as the square root of the area. But---according to my understanding by running a few sensitivity analyses in the past---the model is not sensitive to this parameter.

biglimp commented 2 years ago

I have found the issue. I will push some updates to this repo later today, hopefully.

CsillaVG commented 2 years ago

Thank you!