Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Land Obstacles #321

Closed
wants to merge 67 commits into from

Conversation

SPDonaghy
Copy link
Contributor

@SPDonaghy SPDonaghy commented Mar 14, 2024

Description

These changes were made to implement a data pipeline for land polygons as well as Land Obstacle class in obstacles.py

TODO:

  • Run ETL script to create complete polygon data set
  • Verify data produced from ETL script
  • Implement Land Obstacle class
  • Unit tests
  • Clip land geometry outside of bounding box
  • Load testing
  • Implement pre-computation of >=12 mile buffer around all land polygons

Verification

  • Run land_polygons_etl.py to generate a land data set shape file
  • Visualize resultant polygon data from the etl script and ensure it looks correct
  • Create and run pytest tests for the Land Obstacle class and its functions

Resources

GEBCO Bathymetric data source
Coastline Polygons data source

@SPDonaghy SPDonaghy added the path Pathfinding team label Mar 14, 2024
@SPDonaghy SPDonaghy requested a review from patrick-5546 March 14, 2024 00:00
@SPDonaghy SPDonaghy self-assigned this Mar 14, 2024
@SPDonaghy SPDonaghy requested a review from jamenkaye as a code owner March 14, 2024 00:00
@SPDonaghy SPDonaghy marked this pull request as draft March 14, 2024 00:00
@SPDonaghy SPDonaghy changed the title User/sp donaghy/implement land obstacles 278 Implement Land Obstacles Mar 14, 2024
Copy link
Member

@patrick-5546 patrick-5546 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran the script to completion with the fixes I made (creating directories when they didn't exist, but feel free to handle it a different way if you had something else in mind)

lmk when you want me to review/test the land class

@SPDonaghy
Copy link
Contributor Author

I ran the script to completion with the fixes I made (creating directories when they didn't exist, but feel free to handle it a different way if you had something else in mind)

Nope thats perfect, didn't spot that issue thanks! Are you able to share the result files please?

lmk when you want me to review/test the land class

Sounds good, about halfway done with the class.

@patrick-5546
Copy link
Member

patrick-5546 commented Mar 19, 2024

Are you able to share the result files please?

I uploaded my results files to our shared drive: https://drive.google.com/drive/folders/1NZZmz8qpIzdPM35E3WHv94unY_nuAt3c?usp=sharing

@SPDonaghy
Copy link
Contributor Author

Are you able to share the result files please?

I uploaded my results files to our shared drive: https://drive.google.com/drive/folders/1NZZmz8qpIzdPM35E3WHv94unY_nuAt3c?usp=sharing

Thanks! Could you also upload the other files with the same name as the shp file but different extensions?

@patrick-5546
Copy link
Member

Done

@patrick-5546
Copy link
Member

I'm getting this error running the script with no arguments

Processing Bathymetric Data Chunks:  20%|██████████████████████                                                                                          | 64839/328768 [02:12<08:59, 488.88it/s]
Bathymetric data processing failed with an unexpected error: QH6154 Qhull precision error: Initial simplex is flat (facet 1 is coplanar with the interior point)

While executing:  | qhull d Qc Qt Q12 Qz Qbb
Options selected for Qhull 2019.1.r 2019/06/21:
  run-id 338317883  delaunay  Qcoplanar-keep  Qtriangulate  Q12-allow-wide
  Qz-infinity-point  Qbbound-last  _pre-merge  _zero-centrum  Qinterior-keep
  Pgood  _max-width 0.019  Error-roundoff 2.3e-13  _one-merge 1.6e-12
  Visible-distance 4.6e-13  U-max-coplanar 4.6e-13  Width-outside 9.2e-13
  _wide-facet 2.8e-12  _maxoutside 1.8e-12

The input to qhull appears to be less than 3 dimensional, or a
computation has overflowed.

Qhull could not construct a clearly convex simplex from points:
- p3(v4):    54 -1.7e+02     0
- p7(v3):    54 -1.7e+02  0.34
- p0(v2):    54 -1.7e+02 0.075
- p15(v1):    54 -1.7e+02 1.7e+02

The center point is coplanar with a facet, or a vertex is coplanar
with a neighboring facet.  The maximum round off error for
computing distances is 2.3e-13.  The center point, facets and distances
to the center point are as follows:

center point    54.06     -166     41.6

facet p7 p0 p15 distance= 4.4e-15
facet p3 p0 p15 distance= 4.4e-15
facet p3 p7 p15 distance= -4.4e-15
facet p3 p7 p0 distance= -7.1e-15

These points either have a maximum or minimum x-coordinate, or
they maximize the determinant for k coordinates.  Trial points
are first selected from points that maximize a coordinate.

The min and max coordinates for each dimension are:
  0:     54.06     54.06  difference= 1.421e-14
  1:      -166  -2.225e-308  difference=  166
  2:         0       166  difference=  166

If the input should be full dimensional, you have several options that
may determine an initial simplex:
  - use 'QJ'  to joggle the input and make it full dimensional
  - use 'QbB' to scale the points to the unit cube
  - use 'QR0' to randomly rotate the input for different maximum points
  - use 'Qs'  to search all points for the initial simplex
  - use 'En'  to specify a maximum roundoff error less than 2.3e-13.
  - trace execution with 'T3' to see the determinant for each point.

If the input is lower dimensional:
  - use 'QJ' to joggle the input and make it full dimensional
  - use 'Qbk:0Bk:0' to delete coordinate k from the input.  You should
    pick the coordinate with the least range.  The hull will have the
    correct topology.
  - determine the flat containing the points, rotate the points
    into a coordinate plane, and delete the other coordinates.
  - add one or more points to make the input full dimensional.

Traceback (most recent call last):
  File "/home/patrick-5546/sailbot_workspace/src/local_pathfinding/land/land_polygon_etl.py", line 814, in <module>
    main()
  File "/home/patrick-5546/sailbot_workspace/src/local_pathfinding/land/land_polygon_etl.py", line 304, in main
    sindex = gdf_combined.sindex
UnboundLocalError: local variable 'gdf_combined' referenced before assignment

@SPDonaghy
Copy link
Contributor Author

SPDonaghy commented Mar 20, 2024

I'm getting this error running the script with no arguments

Ah, okay I will look into this. I have some ideas for what's causing it. I'll let you know once it's ready to try again!

The good news is the internediate results should have been saved so we can jump right to this step on the next run.

@patrick-5546 patrick-5546 requested review from patrick-5546 and removed request for patrick-5546 September 15, 2024 18:23
@SPDonaghy SPDonaghy marked this pull request as ready for review September 16, 2024 04:28
@SPDonaghy
Copy link
Contributor Author

Currently colcon tests is not passing because the following import is failing
from shapely import union_all
image

I cannot figure it why, I was even able to successfully import union_all in a separate workflow step
image

@SPDonaghy SPDonaghy closed this Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
path Pathfinding team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Land Obstacle Class
2 participants