khalhoz / geo1101-ahn3-GF-and-Interpolation

GNU Lesser General Public License v3.0
1 stars 1 forks source link

TINinterpolation-CDT has artifacts in the results, and error message. #14

Closed khalhoz closed 4 years ago

khalhoz commented 4 years ago

image

There is a problem in TIN linear interpolation. Also, it gave an error for the last two data samples (no results). The error message is here below. "To run the code, I used BAG-data for whole NL which is now available on Stack"

(virtuenv) PS C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\Vertical_difference> python.exe C:/Users/khale/OneDrive/Desktop/Pdal_with_ip/ip_main.py C:/Users/khale/OneDrive/Desktop/Pdal_with_ip/Data_samples/ False 0.5 CGAL-CDT GeoTIFF C:/Users/khale/OneDrive/Desktop/Pdal_with_ip/BAG_Data/tudcampus.geojson

Starting interpolation pool of processes on the 8 logical cores found in this PC.

PID 16468 starting to interpolate file LAS_Delf.las PID 16232 starting to interpolate file LAS_amsterdam.las PID 18580 starting to interpolate file LAS_biesbosh.las PID 8232 starting to interpolate file LAS_Groningen.las PID 23296 starting to interpolate file LAS_Veluwezoom.las C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\ip_processing.py:106: RuntimeWarning: invalid value encountered in sqrt (sp_pa - side2) (sp_pa - side3)) C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\ip_processing.py:106: RuntimeWarning: invalid value encountered in sqrt (sp_pa - side2) (sp_pa - side3)) C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\ip_processing.py:106: RuntimeWarning: invalid value encountered in sqrt (sp_pa - side2) (sp_pa - side3)) PID 16232 finished interpolation. Time spent interpolating: 281.61 sec. PID 16232 finished exporting. Time spent exporting: 0.43 sec. C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\ip_processing.py:106: RuntimeWarning: invalid value encountered in sqrt (sp_pa - side2) (sp_pa - side3)) PID 23296 finished interpolation. Time spent interpolating: 366.88 sec. PID 23296 finished exporting. Time spent exporting: 0.24 sec. C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\ip_processing.py:106: RuntimeWarning: invalid value encountered in sqrt (sp_pa - side2) (sp_pa - side3)) PID 8232 finished interpolation. Time spent interpolating: 473.36 sec. PID 8232 finished exporting. Time spent exporting: 0.11 sec. multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "C:\Users\khale\nanaco\anaconda3\envs\virtuenv\lib\multiprocessing\pool.py", line 121, in worker result = (True, func(args, *kwds)) File "C:\Users\khale\nanaco\anaconda3\envs\virtuenv\lib\multiprocessing\pool.py", line 44, in mapstar return list(map(args)) File "C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\ip_processing.py", line 334, in ip_worker ras = execute_cgal_CDT(gnd_coords, res, origin, size, idw0_polyfpath) File "C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\ip_processing.py", line 168, in execute_cgal_CDT if (ras[yi + yj - 1, xi + xj - 1] != -9999 and IndexError: index 612 is out of bounds for axis 1 with size 612 """

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

Traceback (most recent call last): File "C:/Users/khale/OneDrive/Desktop/Pdal_with_ip/ip_main.py", line 52, in main() File "C:/Users/khale/OneDrive/Desktop/Pdal_with_ip/ip_main.py", line 48, in main if 3 <= len(argv) <= 13: start_pool(*argv[1:]) File "C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\ip_processing.py", line 412, in start_pool p.map(ip_worker, pre_map) File "C:\Users\khale\nanaco\anaconda3\envs\virtuenv\lib\multiprocessing\pool.py", line 268, in map return self._map_async(func, iterable, mapstar, chunksize).get() File "C:\Users\khale\nanaco\anaconda3\envs\virtuenv\lib\multiprocessing\pool.py", line 657, in get raise self._value IndexError: index 612 is out of bounds for axis 1 with size 612 (virtuenv) PS C:\Users\khale\OneDrive\Desktop\Pdal_with_ip\Vertical_difference>

khalhoz commented 4 years ago

@kriskenesei I am not sure you check all issues on GitHub, just to notify you that I reported this issue.

kriskenesei commented 4 years ago

I don't seem to get notifications for new issues, but now I've seen this. Also, I know what the issue is and there is an easy fix, will release it today!

kriskenesei commented 4 years ago

Some pixels will not be triangulated for unknown reasons, probably due to triangles in the CDT with really weird shapes (sliver polygons, probably?). So I'm going to also integrate Lisa's code with the CDT method so that parts of polygons beyond the tile extents are no longer added as constraints (which I think is causing these issues, as I already described on Discord).

kriskenesei commented 4 years ago

This has been fixed in the latest version.