jaiarobotics / jaiabot

Jaiabot source code
Other
20 stars 3 forks source link

feature/color-map-for-contour-layer-jaia-715 #928

Closed edsanville closed 3 months ago

edsanville commented 3 months ago

Use Polygon objects with fill colors in the GeoJSON returned by the contour endpoints.

edsanville commented 3 months ago

Whoops... forgot to document a few functions there! Will come back to this one...

edsanville commented 3 months ago

Ok, function comments in place!

JRoybot commented 3 months ago

This is likely operator error but when trying to test this I got errors when I tried to download all from jcc. WARNING:root:Client rbbVFmHKySLPzVGYT3Le2a has taken control ERROR:app:Exception on /jaia/depth-contours [GET] Traceback (most recent call last): File "/home/jeff/.local/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app response = self.full_dispatch_request() File "/home/jeff/.local/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/jeff/.local/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request rv = self.dispatch_request() File "/home/jeff/.local/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/home/jeff/jaiabot/src/web/server/./app.py", line 258, in get_deth_contours return JSONResponse(jaia_interface.get_depth_contours(start_date, end_date)) File "/home/jeff/jaiabot/src/web/server/jaia_portal.py", line 572, in get_depth_contours return pyjaia.contours.taskPacketsToColorMap(self.get_task_packets(start_date, end_date)) File "/home/jeff/jaiabot/build/web_dev/python/venv/lib/python3.10/site-packages/pyjaia/contours.py", line 257, in taskPacketsToColorMap contourValues = getContourValues(bottomDives) File "/home/jeff/jaiabot/build/web_dev/python/venv/lib/python3.10/site-packages/pyjaia/contours.py", line 162, in getContourValues minValue = min(values) ValueError: min() arg is an empty sequence

JRoybot commented 3 months ago

When testing the branch I was able to move the depth contours and the depth soundings items around on the map using the mouse.

image

JRoybot commented 3 months ago

This is likely operator error but when trying to test this I got errors when I tried to download all from jcc. WARNING:root:Client rbbVFmHKySLPzVGYT3Le2a has taken control ERROR:app:Exception on /jaia/depth-contours [GET] Traceback (most recent call last): File "/home/jeff/.local/lib/python3.10/site-packages/flask/app.py", line 2525, in wsgi_app response = self.full_dispatch_request() File "/home/jeff/.local/lib/python3.10/site-packages/flask/app.py", line 1822, in full_dispatch_request rv = self.handle_user_exception(e) File "/home/jeff/.local/lib/python3.10/site-packages/flask/app.py", line 1820, in full_dispatch_request rv = self.dispatch_request() File "/home/jeff/.local/lib/python3.10/site-packages/flask/app.py", line 1796, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/home/jeff/jaiabot/src/web/server/./app.py", line 258, in get_deth_contours return JSONResponse(jaia_interface.get_depth_contours(start_date, end_date)) File "/home/jeff/jaiabot/src/web/server/jaia_portal.py", line 572, in get_depth_contours return pyjaia.contours.taskPacketsToColorMap(self.get_task_packets(start_date, end_date)) File "/home/jeff/jaiabot/build/web_dev/python/venv/lib/python3.10/site-packages/pyjaia/contours.py", line 257, in taskPacketsToColorMap contourValues = getContourValues(bottomDives) File "/home/jeff/jaiabot/build/web_dev/python/venv/lib/python3.10/site-packages/pyjaia/contours.py", line 162, in getContourValues minValue = min(values) ValueError: min() arg is an empty sequence

I think this was probably due to the bug associated with the bottom dive toggle button in OMP

JRoybot commented 3 months ago

When testing the branch I was able to move the depth contours and the depth soundings items around on the map using the mouse.

This seems to be a pre-existing bug, I was able to reproduce it on 1.y. Will post in Demerits channel

edsanville commented 3 months ago

It turns out that the Translate interaction (for dragging Rally Points?) filtered by the disableDrag property, which made draggability opt-out in JCC.

So, it turns out every feature was draggable, but we didn't notice because most features are being updated by the status polling! It turns out the Rally Points were opting out anyway, so they were the only feature that were NOT draggable.

I converted it to enableDrag to make draggability opt-IN, instead. If we want to make features draggable, we can enable this property, and work on the hooks for the Translate interaction to do the actual work of re-positioning stuff.