Skip to content

Commit

Permalink
Merge branch 'master' into bump-compat
Browse files Browse the repository at this point in the history
  • Loading branch information
visr authored Oct 9, 2024
2 parents ac5d917 + b596c9b commit 557ebfc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/coord.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
18 changes: 14 additions & 4 deletions test/libproj.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 557ebfc

Please sign in to comment.