From bd701496349c21ff599fe0185414a5809e19f6f6 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Mon, 7 Oct 2024 22:42:51 -0700 Subject: [PATCH 1/3] Allow WellKnownText{CRS} in Transformation constructor --- src/coord.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/coord.jl b/src/coord.jl index 0939ad4..b2e2a91 100644 --- a/src/coord.jl +++ b/src/coord.jl @@ -86,8 +86,8 @@ function Transformation( end function Transformation( - source_crs::GFT.CoordinateReferenceSystemFormat, - target_crs::GFT.CoordinateReferenceSystemFormat; + source_crs::Union{GFT.CoordinateReferenceSystemFormat,GFT.MixedFormat{<:MaybeGFTCRS}}, + target_crs::Union{GFT.CoordinateReferenceSystemFormat,GFT.MixedFormat{<:MaybeGFTCRS}}; always_xy::Bool = false, direction::PJ_DIRECTION = PJ_FWD, area::Ptr{PJ_AREA} = C_NULL, From 49e4df1a583cc193510ab89aac4c179099033c95 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Mon, 7 Oct 2024 22:43:14 -0700 Subject: [PATCH 2/3] Bump version --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 0ca8bd8..e92a547 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "Proj" uuid = "c94c279d-25a6-4763-9509-64d165bea63e" -version = "1.7.1" +version = "1.7.2" [deps] CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82" From f457768d128fbf7a41ef81679f6c897a5639c278 Mon Sep 17 00:00:00 2001 From: Anshul Singhvi Date: Mon, 7 Oct 2024 22:48:06 -0700 Subject: [PATCH 3/3] test --- test/libproj.jl | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/test/libproj.jl b/test/libproj.jl index 04a0f5c..7b5424c 100644 --- a/test/libproj.jl +++ b/test/libproj.jl @@ -203,19 +203,29 @@ end source_crs = GFT.EPSG("EPSG:4326") target_crs = GFT.EPSG("EPSG:32628") - trans = Proj.Transformation(source_crs, target_crs, always_xy = false) + trans = Proj.Transformation(source_crs, target_crs, always_xy = true) info = Proj.proj_pj_info(trans.pj) description1 = unsafe_string(info.definition) + # crs as WellKnownText{CRS} + # verbose to work around the lack of a GFT blessed implementation in Proj + source_crs = GFT.WellKnownText(GFT.CRS(), GFT.val(GFT.ESRIWellKnownText(Proj.CRS("EPSG:4326")))) + target_crs = GFT.WellKnownText(GFT.CRS(), GFT.val(GFT.ESRIWellKnownText(Proj.CRS("EPSG:32628")))) + + trans = Proj.Transformation(source_crs, target_crs, always_xy = true) + info = Proj.proj_pj_info(trans.pj) + description2 = unsafe_string(info.definition) + #crs as txt source_crs = "EPSG:4326" target_crs = "EPSG:32628" - trans = Proj.Transformation(source_crs, target_crs, always_xy = false) + trans = Proj.Transformation(source_crs, target_crs, always_xy = true) info = Proj.proj_pj_info(trans.pj) - description2 = unsafe_string(info.definition) + description_true = unsafe_string(info.definition) - @test description1 == description2 + @test description1 == description_true + @test description2 == description_true end @testset "bounds" begin