JuliaGeo / Proj.jl

Julia wrapper for the PROJ cartographic projections library
MIT License
48 stars 9 forks source link

Add CRS constructor. #74

Closed evetion closed 1 year ago

evetion commented 1 year ago

@rafaqz This PR includes a method to convert between GFT instances, like ArchGDAL.

evetion commented 1 year ago

Not sure why the tests are suddenly failing, like the PROJ version changed in between, but can't replicate it. @visr, any thoughts?

visr commented 1 year ago

That's your own show change from #73 ;)

Fixed in 29e341568db021f7c484ca65830e9fe23f4bc915

The new show is better, it shows explicitly it is a no-op (old then new):

Transformation
    source: WGS 84
    target: WGS 84
    direction: forward

Transformation noop
    description: Null geographic offset from WGS 84 to WGS 84
    definition: proj=noop ellps=GRS80
    direction: forward
evetion commented 1 year ago

LGTM

visr commented 1 year ago

It would be better to directly do this in the style of https://github.com/yeesian/ArchGDAL.jl/pull/349 and https://github.com/JuliaGeo/LibGEOS.jl/pull/149, since this adds a bunch of methods like proj_get_id_code(crs::CRS) = proj_get_id_code(crs.pj) that would soon be removed again.

evetion commented 1 year ago

The style being Base.unsafe_convert(::Type{Ptr{Cvoid}}, x::CRS) = x.ptr ?

visr commented 1 year ago

Yes indeed, then we don't need to take out the pointer ourselves, which is less code and safer for GC.