Skip to content

Commit 659852e

Browse files
authored
BUG: Fix transformer list for 3D transformations in TransformerGroup (#1075)
1 parent f031f5f commit 659852e

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

docs/history.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Change Log
44
Latest
55
-------
66
- DEP: Minimum PROJ version 8.1 (issue #1011)
7+
- BUG: Fix transformer list for 3D transformations in :class:`pyproj.transformer.TransformerGroup` (discussion #1072)
78

89
3.3.1
910
-------

pyproj/_transformer.pyx

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ cdef class _TransformerGroup:
172172
)
173173
pj_operations = proj_create_operations(
174174
self.context,
175-
get_transform_crs(crs_from).projobj,
176-
get_transform_crs(crs_to).projobj,
175+
crs_from.projobj,
176+
crs_to.projobj,
177177
operation_factory_context,
178178
)
179179
num_operations = proj_list_get_count(pj_operations)
@@ -216,16 +216,6 @@ cdef class _TransformerGroup:
216216
ProjError.clear()
217217

218218

219-
cdef _CRS get_transform_crs(_CRS in_crs):
220-
for sub_crs in in_crs.sub_crs_list:
221-
if (
222-
not sub_crs.type_name.startswith("Temporal") and
223-
not sub_crs.type_name.startswith("Temporal")
224-
):
225-
return sub_crs.source_crs if sub_crs.is_bound else sub_crs
226-
return in_crs.source_crs if in_crs.is_bound else in_crs
227-
228-
229219
cdef PJ* proj_create_crs_to_crs(
230220
PJ_CONTEXT *ctx,
231221
const char *source_crs_str,

test/test_transformer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ def test_transformer_group__get_transform_crs():
709709
if not grids_available("nl_nsgi_rdtrans2018.tif"):
710710
assert len(tg.transformers) == 1
711711
else:
712-
assert len(tg.transformers) == 2
712+
assert len(tg.transformers) == 6
713713

714714

715715
@pytest.mark.grid

0 commit comments

Comments
 (0)