Skip to content

Commit 426f06c

Browse files
authored
Merge pull request #189 from noaa-ocs-modeling/bugfix/subset_upstream
Fix subsetting upstream detection CRS issue
2 parents 8de5bc4 + f688b5a commit 426f06c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

ocsmesh/cli/subset_n_combine.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,9 @@ def _calculate_clipping_polygon(
167167
base_shape_crs=crs)
168168
clip_poly_draft = geom_cutoff.get_multipolygon()
169169

170+
t = Transformer.from_crs(4326, crs, always_xy=True)
171+
clip_poly_draft = transform(t.transform, clip_poly_draft)
172+
170173
# Add back upstream
171174
poly_upstreams = []
172175
if upstream_poly_list is not None:
@@ -180,9 +183,6 @@ def _calculate_clipping_polygon(
180183
clip_poly = utils.remove_holes(unary_union([
181184
clip_poly_draft, *poly_upstreams]))
182185

183-
t = Transformer.from_crs(4326, crs, always_xy=True)
184-
clip_poly = transform(t.transform, clip_poly)
185-
186186
return clip_poly
187187

188188

0 commit comments

Comments
 (0)