tudelft3d / City4CFD

Reconstruction of LoD2 3D city models for urban flow simulations
GNU Affero General Public License v3.0
91 stars 17 forks source link

HELP???? Output file not showing properly #14

Closed LaiaWilson closed 8 months ago

LaiaWilson commented 9 months ago

This what I get in the Ubuntu terminal. I'm really desperate with the use of this program, can someone help me out?????????

This is what the output file looks like, as you may understand it shouldn't be like this: image

wilai@Laias-Laptop:~$ ~/City4CFD/build/city4cfd /home/wilai/config_bpg.json --output_dir /home/wilai/results

 #==============================================================#
 #                        __                                    #
 #                   __  |''|                                   #
 #                  |""| |''|  _   /|__                         #
 #                __|""| |''|_| | | |""|/\_                     #
 #               |''|""| |''|'| __| |""|'''|  _____             #
 #          _ _  |''|""|^|''|'||""| |""|'''| |"""""|            #
 #         |"|"| |''|""|||''|'||""| |""|'''| |"""""|            #
 #     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~     #
 #    ____   _   _                ___________________________   #
 #   / ___| /_\ | |_   _   _      __  ____/___  ____/___  __ \  #
 #  | |     |"| | __| | | | |     _  /     __  /_    __  / / /  #
 #  | |___  |"| | |_  | |_| |  4  / /___   _  __/    _  /_/ /   #
 #   \____| |"|  \__|  \__, |     \____/   /_/       /_____/    #
 #                     |___/                                    #
 #                                                              #
 #==============================================================#

City4CFD Copyright (C) 2021-2023 3D Geoinformation Research Group, TU Delft

Work directory: "/home/wilai"

Validating JSON configuration file...Configuration file is valid!

INFO: Did not find any ground points! Will calculate ground as a flat surface. WARNING: Ground elevation of buildings can only be approximated. If you are using point cloud to reconstruct buildings, building height estimation can be wrong.

Reading building points Points read: 1691666 Reading polygons Reading polygon file: /home/wilai/files_city4CFD/real_buildings.geojson type: GeoJSON CRS information: EPSG code: 3857 Polygons read: 6436

Creating flat terrain Smoothing terrain Smoothing terrain...done

Attaching point cloud points to buildings

Defining influence region Number of building geometries in the influence region: 62

Removing extra terrain points

Reconstructing buildings Number of successfully reconstructed buildings: 62

INFO: Domain boundaries not defined in config. Calculating with BPG.

Calculating blockage ratio for flow direction (1 1) Blockage ratio is: -nan

Reconstructing terrain Lifting polygon edges to terrain elevation

Number of polygons to constrain: 0

Preparing triangulation
[==================================================] 100%
Triangulating...done

Imprinting polygons
[==================================================] 100%

Creating terrain mesh

Reconstructing boundaries

Outputting surface meshes Folder: "/home/wilai/results"

Creating log file 'logFile.log' Outputting failed building reconstructions to 'failedReconstructions.geojson'

Program executed in 6.11155 s End

ipadjen commented 9 months ago

Just as in https://github.com/tudelft3d/City4CFD/issues/13#issuecomment-1872250931, you have to make sure that the local coordinate system, typically defined by points, is aligned with the local coordinate system of your polygons. You have more information on this alignment in the wiki.

LaiaWilson commented 9 months ago

The link to the files:

https://github.com/LaiaWilson/laia_city4cfd.git

ipadjen commented 9 months ago

The link to the files:

https://github.com/LaiaWilson/laia_city4cfd.git

Hello, I'm missing a point cloud to be able to check the reconstruction.

LaiaWilson commented 9 months ago

I could not get it uploaded.

https://drive.google.com/drive/folders/1JrViFP3ZPVn7vmymEtIdZLFC72R3O9yc?usp=sharing

ipadjen commented 9 months ago

It appears that the point cloud has been shifted to some sort of a local coordinate system and thus is not overlapping with polygons. It would be beneficial to know how that shift happened. Was AHN3 the original input or you obtained the point cloud like that?

LaiaWilson commented 9 months ago

I got it from PDOK and then created the point clouds inputting the data on meshlab.

ipadjen commented 9 months ago

It looks like meshlab shifted coordinates to local values to avoid precision error (coordinates are rather large numbers) and you ended up storing them in those coordinates. You can check the extent of both (polygons in QGIS and point cloud in meshlab) and see that they are vastly different -- point cloud values are around 0 (from -400 to 400).

Something like CloudCompare or lastools (more specifically lasmerge and las2las) are better options for handling a point cloud. Even more so because you can store your manipulation back in .laz, load it directly into QGIS, and check if the point cloud and polygons overlap. Lastools is also great because you can easily thin the point cloud to meet your memory capabilities.

Here, I took the liberty to quickly fetch the point cloud (using coordinates from polygons) and create thinned ground and buildings from it: https://surfdrive.surf.nl/files/index.php/s/ndrwgLt6LbJ20wc

Also, you point of interest had wrong coordinates. I used Value Tool in QGIS (it's a plugin) to define it -- check the lower left corner of the screenshot (135517.421, 452966.668) -- those are the numbers I got once I clicked roughly in the center of your polygons.

Screenshot 2024-01-09 at 16 54 58

You can also see the way my .laz point cloud and your polygons nicely overlap.

ipadjen commented 8 months ago

Any update on this?