aliaksei135 / seedpod_ground_risk

Ground Risk model for UAS flight path analysis and risk-aware path finding
MIT License
6 stars 2 forks source link

Resize NaN issue #24

Closed Zach10a closed 2 years ago

Zach10a commented 3 years ago

Resizing cases the following error message:

File "C:\Users\Zach\PycharmProjects\seedpod_ground_risk\seedpod_ground_risk\core\plot_server.py", line 379, in _get_raster_dimensions
    raster_width = int(abs(max_x - min_x) // raster_resolution_m)
ValueError: cannot convert float NaN to integer

Fixing #20 would solve this

aliaksei135 commented 3 years ago

I cannot seem to recreate this anymore on the latest develop branch code. Is this is still an issue?

Zach10a commented 3 years ago

Managed to recreate this, will be working on it now the new version is out.

Zach10a commented 3 years ago

It appears that the issue is due to the max and min x and y values being shown as infinite when it is resized. Something to do with the bound function.

Zach10a commented 3 years ago

NaN issue only occurs when the user attempts to resize when the image has been zoomed in on for the second time. It comes down to the function in line 34 of utils. The proj.transform appears to be spitting out infinites. image

aliaksei135 commented 3 years ago

Does this actually cause any problems, or is it a spurious console output? If the former is false, then this can be closed.

aliaksei135 commented 2 years ago

So this is caused by bounds_poly being passed in as None to the function. You can add a check for this and just return sensible/default raster dimensions if it is the case otherwise calculate as normal.