equinor / xtgeo

XTGeo Python class library for subsurface Surfaces, Cubes, Wells, Grids, Points, etc
https://xtgeo.readthedocs.io/en/latest/
GNU Lesser General Public License v3.0
109 stars 57 forks source link

ENH: Use shapely to create boundary polygons #1140

Closed tnatt closed 8 months ago

tnatt commented 8 months ago

PR to change the _create_boundary_polygons() function to use shapely functions to connect points into polygons.

The polygons extracted using shapely have identical geometries as the polygons extracted by the old method.

However the old method was creating duplicate points along the polygons, by using shapely these are now dropped except for the start/end point of the polygon which connects the polygon together.

To account for duplicate points no longer present in the polygons, some adjustments was needed to the tests.

image

codecov-commenter commented 8 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (483b753) 80.29% compared to head (d0dbb32) 80.27%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #1140 +/- ## ========================================== - Coverage 80.29% 80.27% -0.02% ========================================== Files 97 97 Lines 13560 13548 -12 Branches 2174 2172 -2 ========================================== - Hits 10888 10876 -12 Misses 1951 1951 Partials 721 721 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.