Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transformation from ProjString type does not work #102

Open
felixcremer opened this issue Feb 20, 2024 · 2 comments
Open

Transformation from ProjString type does not work #102

felixcremer opened this issue Feb 20, 2024 · 2 comments

Comments

@felixcremer
Copy link
Member

I thought, that ProjString objects should work similar to plain strings with the proj information, but here it works with strings but fails with ProjString:

julia> equi7_eu_projstring = "+proj=aeqd +lat_0=53 +lon_0=24 +x_0=5837287.81977 +y_0=2121415.69617 +datum=WGS84 +units=m +no_defs"
"+proj=aeqd +lat_0=53 +lon_0=24 +x_0=5837287.81977 +y_0=2121415.69617 +datum=WGS84 +units=m +no_defs"

julia> trans = Proj.Transformation(equi7_eu_projstring, "EPSG:3857", always_xy=true)
Transformation pipeline
    description: Inverse of unknown + axis order change (2D) + Popular Visualisation Pseudo-Mercator
    definition: proj=pipeline step inv proj=aeqd lat_0=53 lon_0=24 x_0=5837287.81977 y_0=2121415.69617 ellps=WGS84 step proj=webmerc lat_0=0 lon_0=0 x_0=0 y_0=0 ellps=WGS84
    direction: forward


julia> trans = Proj.Transformation(ProjString(equi7_eu_projstring), EPSG(3857), always_xy=true)
ERROR: PROJError: proj_create_operations: source_crs is not a CRS

Stacktrace:
 [1] log_func(user_data::Ptr{Nothing}, level::Int32, msg::Cstring)
   @ Proj ~/.julia/packages/Proj/YfK57/src/error.jl:19
 [2] proj_create_crs_to_crs_from_pj (repeats 2 times)
   @ ~/.julia/packages/Proj/YfK57/src/libproj.jl:409 [inlined]
 [3] #Transformation#14
   @ ~/.julia/packages/Proj/YfK57/src/coord.jl:130 [inlined]
 [4] Transformation
   @ ~/.julia/packages/Proj/YfK57/src/coord.jl:122 [inlined]
 [5] Proj.Transformation(source_crs::ProjString, target_crs::EPSG{…}; always_xy::Bool, direction::PJ_DIRECTION, area::Ptr{…}, ctx::Ptr{…})
   @ Proj ~/.julia/packages/Proj/YfK57/src/coord.jl:96
 [6] top-level scope
   @ REPL[76]:1
Some type information was truncated. Use `show(err)` to see complete types.
@rafaqz
Copy link
Member

rafaqz commented Feb 20, 2024

Yeah there is no difference. It must be the code path in Proj.jl missing some dispatch

@asinghvi17
Copy link
Member

You need a +type=crs in the proj-string for it to work with Proj.CRS. Perhaps we can catch the error and modify the text a bit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants