UMEP-dev / UMEP

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

Tree Generator - Pixel resolution problem #610

Closed marciaamatias closed 5 months ago

marciaamatias commented 5 months ago

image

I'm using the tree generator but I keep getting back the same error saying that the resolution of the grids I'm using are not the same. Everything is 1,-1 pixel resolution and I get the same error (image above) The parameters I'm using are this (image below)

image

What can I do to make this work?

I have also tried to use a building grid (a raster where everything is 1 and buildings are classified as 0) but I get this error:

{ 'CDSM_GRID_OUT' : 'E:/Doutoramento/TESE DE DOUTORAMENTO/ARTIGOS/Artigo 2/QGIS/CDSM_telheiras.tif', 'DIA' : 'Diametro', 'INPUT_BUILD' : 'E:/Doutoramento/TESE DE DOUTORAMENTO/ARTIGOS/Artigo 2/QGIS/building_grid1.tif', 'INPUT_CDSM' : None, 'INPUT_DEM' : None, 'INPUT_DSM' : None, 'INPUT_POINTLAYER' : 'E:\Doutoramento\TESE DE DOUTORAMENTO\ARTIGOS\Artigo 2\QGIS\arvores_telheiras_2.shp', 'INPUT_TDSM' : None, 'TDSM_GRID_OUT' : 'E:/Doutoramento/TESE DE DOUTORAMENTO/ARTIGOS/Artigo 2/QGIS/TDSM_telheiras.tif', 'TOT_HEIGHT' : 'Altura', 'TREE_TYPE' : 'Tipo', 'TRUNK_HEIGHT' : 'Alt_tronco' }

Traceback (most recent call last): File "C:\Users/marci/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\preprocessor\treegenerator_algorithm.py", line 302, in processAlgorithm cdsm_array, tdsm_array = makevegdems.vegunitsgeneration(build_array, cdsm_array, tdsm_array, ttype, height, File "C:\Users/marci/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\functions\TreeGenerator\makevegdems.py", line 67, in vegunitsgeneration vegdemtemp[int(rowmin):int(rowmin + rowmax), int(colmin):int(colmin + colmax)] = trees ValueError: could not broadcast input array from shape (3,3) into shape (2,3)

Execution failed after 0.09 segundos

biglimp commented 5 months ago

Your raster data need both to be the same regarding pixel size and extent. Please check Extent, Width and Height of your raster data.

marciaamatias commented 5 months ago

Thank you

This made it work.

Now: this generates two outputs: CDSM and TDSM. How are we supposed to incorporate them in the SUEWS simple?

In the prepare window, I used the DSM and the DTM for my area but it gave the same values for the morphology of the buildings. They shouldn't be the same. (see image, please). Are we supposed to use the CDSM and TDSM instead?

image

biglimp commented 5 months ago

You need to calculate morphology for trees as well as buildings using the morphometric calculator. See the tutorial section for more info.

marciaamatias commented 5 months ago

I have done it and it creates several files like this

image

But how am I now able to incorporate this in the suews prepare?

In the tree morphology section we need to input an isotropic file and the morphometric calculator doesn't create that

biglimp commented 5 months ago

Yes it does. Your second to last file.

marciaamatias commented 5 months ago

That is a previous isotropic file I made earlier, it was not generated at the same than the others (see date)

However, I understood it needs to be the morphometric calculator (Point) and not grid.

However, what do I use to make the morphometric calculations regarding the trees? Because on the grid morphometric calculator we can input the CDSM. However in the point morphometric calculator, we don't have that

image

biglimp commented 5 months ago

You input your CDSM as a raster with only 3D-objects.

marciaamatias commented 5 months ago

I've tried, with only input the CDSM on "Raster DSM only 3D objects" but i get back this errors:

Algoritmo 'Urban Morphology: Morphometric Calculator (Point)' terminado Versão do QGIS: 3.34.5-Prizren Código de revisão do QGIS: 4b308492 Versão do Qt: 5.15.3 Versão do Python: 3.9.18 Versão do GDAL: 3.8.4 Versão do GEOS: 3.12.1-CAPI-1.18.1 Versão do PROJ: Rel. 9.3.1, December 1st, 2023 Versão PDAL: 2.6.0 (git-version: 3fced5) Algoritmo iniciado às: 2024-04-30T14:33:57 Algoritmo 'Urban Morphology: Morphometric Calculator (Point)' a iniciar… Parâmetros de entrada: { 'FILE_PREFIX' : 'MCPoint_Trees', 'INPUT_DEM' : 'E:/Doutoramento/TESE DE DOUTORAMENTO/ARTIGOS/Artigo 2/QGIS/DTM_1m_telheiras.tif', 'INPUT_DISTANCE' : 200, 'INPUT_DSM' : None, 'INPUT_DSMBUILD' : 'C:/Users/marci/AppData/Local/Temp/processing_CrcEer/ea90c49177c04b79b29144e620b2a71d/CDSM_GRID_OUT.nc', 'INPUT_INTERVAL' : 5, 'INPUT_POINT' : None, 'INPUT_POINTLAYER' : 'E:/Doutoramento/TESE DE DOUTORAMENTO/ARTIGOS/Artigo 2/QGIS/ponto_interesse.shp', 'OUTPUT_DIR' : 'TEMPORARY_OUTPUT', 'OUTPUT_POINT' : 'TEMPORARY_OUTPUT', 'OUTPUT_POLYGON' : 'TEMPORARY_OUTPUT', 'ROUGH' : 0, 'SAVE_POINT' : False, 'USE_DSM_BUILD' : False }

Point location obtained from point in vector layer x = 484915.72252877906 y = 4290327.304971943 No valid ground and building DSM raster layer is selected Execution failed after 0.03 segundos

A carregar as camadas resultantes Algoritmo 'Urban Morphology: Morphometric Calculator (Point)' terminado Versão do QGIS: 3.34.5-Prizren Código de revisão do QGIS: 4b308492 Versão do Qt: 5.15.3 Versão do Python: 3.9.18 Versão do GDAL: 3.8.4 Versão do GEOS: 3.12.1-CAPI-1.18.1 Versão do PROJ: Rel. 9.3.1, December 1st, 2023 Versão PDAL: 2.6.0 (git-version: 3fced5) Algoritmo iniciado às: 2024-04-30T14:34:04 Algoritmo 'Urban Morphology: Morphometric Calculator (Point)' a iniciar… Parâmetros de entrada: { 'FILE_PREFIX' : 'MCPoint_Trees', 'INPUT_DEM' : 'E:/Doutoramento/TESE DE DOUTORAMENTO/ARTIGOS/Artigo 2/QGIS/DTM_1m_telheiras.tif', 'INPUT_DISTANCE' : 200, 'INPUT_DSM' : None, 'INPUT_DSMBUILD' : 'C:/Users/marci/AppData/Local/Temp/processing_CrcEer/ea90c49177c04b79b29144e620b2a71d/CDSM_GRID_OUT.nc', 'INPUT_INTERVAL' : 5, 'INPUT_POINT' : None, 'INPUT_POINTLAYER' : 'E:/Doutoramento/TESE DE DOUTORAMENTO/ARTIGOS/Artigo 2/QGIS/ponto_interesse.shp', 'OUTPUT_DIR' : 'TEMPORARY_OUTPUT', 'OUTPUT_POINT' : 'TEMPORARY_OUTPUT', 'OUTPUT_POLYGON' : 'TEMPORARY_OUTPUT', 'ROUGH' : 0, 'SAVE_POINT' : False, 'USE_DSM_BUILD' : True }

Point location obtained from point in vector layer x = 484915.72252877906 y = 4290327.304971943 Traceback (most recent call last): File "C:\Users/marci/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\preprocessor\imagemorphparmspoint_algorithm.py", line 247, in processAlgorithm immorphresult = morph.imagemorphparam_v2(dsm, dem, scale, 1, degree, feedback, 1) File "C:\Users/marci/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\processing_umep\util\imageMorphometricParms_v2.py", line 100, in imagemorphparam_v2 lineMid = a[0:imidy,imid] IndexError: only integers, slices (:), ellipsis (...), numpy.newaxis (None) and integer or boolean arrays are valid indices

Execution failed after 0.07 segundos

biglimp commented 5 months ago

Please check that all your data is in same CRS.

marciaamatias commented 5 months ago

Yes, all of the layers have the same CRS

CDSM, DSM, DTM, Point of interest

biglimp commented 5 months ago

Then please attach your data here.

Skickat från Outlook för Androidhttps://aka.ms/AAb9ysg


From: marciaamatias @.> Sent: Tuesday, April 30, 2024 3:50:22 PM To: UMEP-dev/UMEP @.> Cc: Fredrik Lindberg @.>; Comment @.> Subject: Re: [UMEP-dev/UMEP] Tree Generator - Pixel resolution problem (Issue #610)

Yes, all of the layers have the same CRS

CDSM, DSM, DTM, Point of interest

— Reply to this email directly, view it on GitHubhttps://github.com/UMEP-dev/UMEP/issues/610#issuecomment-2085393836, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AC23KBDMP5BTLZVO2VZCBU3Y76OR5AVCNFSM6AAAAABG5GHUPWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAOBVGM4TGOBTGY. You are receiving this because you commented.Message ID: @.***>

marciaamatias commented 5 months ago

files_M.zip

I think that is all you need

biglimp commented 5 months ago

No problem running the tool for me with your data. Maybe it is because your dont tick in the box Raster DSM (only 3d building or vegetation objects) exits.

test_IMPPoint_anisotropic.txt test_IMPPoint_isotropic.txt

marciaamatias commented 5 months ago

I used those files as input and they seem to work.

Ty.