From 7f06c04c6e77e42653f56f67addf9dbf66c74fe6 Mon Sep 17 00:00:00 2001 From: Wouter Date: Thu, 15 Feb 2024 08:38:18 +0100 Subject: [PATCH] (re)reverted alway_xy, for output --- src/coordinate_transformation_api/crs_transform.py | 4 +++- tests/test_transform_endpoint.py | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/coordinate_transformation_api/crs_transform.py b/src/coordinate_transformation_api/crs_transform.py index 74d2403..92e6f3d 100644 --- a/src/coordinate_transformation_api/crs_transform.py +++ b/src/coordinate_transformation_api/crs_transform.py @@ -294,7 +294,9 @@ def get_transformer( # Get available transformer through TransformerGroup # TODO check/validate if always_xy=True is correct - tfg = transformer.TransformerGroup(s_crs, t_crs, allow_ballpark=False) + tfg = transformer.TransformerGroup( + s_crs, t_crs, allow_ballpark=False, always_xy=True + ) # If everything is 'right' we should always have a transformer # based on our configured proj.db. Therefor this error. diff --git a/tests/test_transform_endpoint.py b/tests/test_transform_endpoint.py index e28f757..61c238a 100644 --- a/tests/test_transform_endpoint.py +++ b/tests/test_transform_endpoint.py @@ -12,14 +12,14 @@ "128410.0958,445806.4960", { "type": "Point", - "coordinates": [52.0, 5.0], + "coordinates": [5.0, 52.0], }, "EPSG:28992", "EPSG:4326", None, ), ( - "52.0,5.0", + "5.0,52.0", { "type": "Point", "coordinates": [128410.0958, 445806.4960], @@ -29,7 +29,7 @@ None, ), ( - "52.0,5.0,43", + "5.0,52.0,43", { "type": "Point", "coordinates": [128410.0958, 445806.4960, -0.4754], @@ -72,7 +72,7 @@ "78835.84,457831.732,9.724", { "type": "Point", - "coordinates": [52.103482881, 4.275510253, 53.122], + "coordinates": [4.275510253, 52.103482881, 53.122], }, "EPSG:7415", "EPSG:9754", @@ -108,7 +108,7 @@ def test_transform_get(input, expectation, source_crs, target_crs, epoch): }, { "type": "Point", - "coordinates": [47.974858137, 3.313687707], + "coordinates": [3.313687707, 47.974858137], }, "EPSG:28992", "EPSG:4326", @@ -116,7 +116,7 @@ def test_transform_get(input, expectation, source_crs, target_crs, epoch): ( { "type": "Point", - "coordinates": [47.974858137, 3.313687707], + "coordinates": [3.313687707, 47.974858137], }, { "type": "Point", @@ -138,7 +138,7 @@ def test_transform_get(input, expectation, source_crs, target_crs, epoch): "features": [ { "type": "Feature", - "geometry": {"type": "Point", "coordinates": [52, 5, 43]}, + "geometry": {"type": "Point", "coordinates": [5, 52, 43]}, "properties": {"prop0": "value0"}, }, {