Skip to content

Commit 939af36

Browse files
committed
Fix _orthorectify GCP handling
1 parent 6819b89 commit 939af36

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

eoreader/products/optical/vhr_product.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,12 @@ def _get_ortho_path(self, **kwargs) -> AnyPathType:
154154
# TODO: change this when available in rioxarray
155155
# See https://github.com/corteva/rioxarray/issues/837
156156
rpcs = kwargs.pop("rpcs") if "rpcs" in kwargs else ds.rpcs
157-
gcps = kwargs.pop("gcps") if "gcps" in kwargs else ds.gcps[0]
157+
158+
# Only look for GCPs if RPCs are absent
159+
if not rpcs:
160+
gcps = kwargs.pop("gcps") if "gcps" in kwargs else ds.gcps[0]
161+
else:
162+
gcps = None
158163

159164
if not rpcs and not gcps:
160165
raise InvalidProductError(

0 commit comments

Comments
 (0)