From ff27c3c6c210f600370ca90db9dd8e8e92cd57a6 Mon Sep 17 00:00:00 2001 From: Soroosh Mani <77082694+SorooshMani-NOAA@users.noreply.github.com> Date: Tue, 13 Jun 2023 13:42:52 -0400 Subject: [PATCH 1/2] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index adbec38e..2bf7c693 100644 --- a/README.md +++ b/README.md @@ -49,7 +49,7 @@ python ./setup.py develop # Run this if you are a developer. ``` #### Requirements -* 3.7 <= Python < 3.10 +* 3.9 <= Python * CMake * C/C++ compilers From 6c83616ebb864ffeb8ccacb59526dc8cef021d02 Mon Sep 17 00:00:00 2001 From: Parallel Works app-run user Date: Fri, 16 Jun 2023 20:18:04 +0000 Subject: [PATCH 2/2] Improve subsetting by removing out-of-buffer zone elements --- ocsmesh/cli/subset_n_combine.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/ocsmesh/cli/subset_n_combine.py b/ocsmesh/cli/subset_n_combine.py index 6f001959..be863e56 100755 --- a/ocsmesh/cli/subset_n_combine.py +++ b/ocsmesh/cli/subset_n_combine.py @@ -316,6 +316,21 @@ def _generate_mesh_for_buffer_region( jig_mesh.value = np.zeros((jig_mesh.vert2.shape[0], 1)) self._transform_mesh(jig_mesh, crs) + # NOTE: Remove out of domain elements (some corner cases!) + elems = jig_mesh.tria3['index'] + coord = jig_mesh.vert2['coord'] + + gdf_elems = gpd.GeoDataFrame( + geometry=[Polygon(tri) for tri in coord[elems]], + crs=jig_mesh.crs + ) + idx = gdf_elems.representative_point().sindex.query( + seam.get_multipolygon(), predicate='intersects' + ) + flag = np.zeros(len(gdf_elems), dtype=bool) + flag[idx] = True + jig_mesh.tria3 = jig_mesh.tria3[flag] + return jig_mesh