Geodesy.jl icon indicating copy to clipboard operation
Geodesy.jl copied to clipboard

Problem with EPSG:32633 to GPS/WGS84 conversion

Open stephanadelsb opened this issue 1 year ago • 5 comments

Can I do the conversion from EPSG:32633 to EPSG:4326 [GPS/WGS84] with Geodesy.jl? I read the documentation and I'm still puzzled on how to do this.

Here is the code using PyCall to pyproj transformations:

using PyCall
py"""
import pyproj

print(pyproj.Transformer.from_crs("EPSG:32633", "EPSG:4326").transform(599445.75,5347365.45))
print(pyproj.Transformer.from_crs("EPSG:4326", "EPSG:32633").transform(48.27168293014, 16.34019877249))

# 1st result: (48.27168293014006, 16.340198772490897)
# 2nd result: (599445.7499999339, 5347365.449999993)
"""

Can I do this with Geodesy?

stephanadelsb avatar Jul 04 '24 21:07 stephanadelsb

The definition of your EPSG is UTM zone 33N, so you can adapt the line from the README:

points_lla::Vector{LLA{Float64}}
utm_from_lla = UTMfromLLA(33, true, wgs84) # Zone 33N
points_utm = map(utm_from_lla, points_lla)

asinghvi17 avatar Jul 05 '24 04:07 asinghvi17

If you want general transformations to and from arbitrary EPSG then look up Proj.jl.

asinghvi17 avatar Jul 05 '24 05:07 asinghvi17

@stephanadelsb if you want to benefit from a native Julia implementation, take a look into CoordRefSystems.jl. It has your conversion covered, and should be ~75x faster than the Proj.jl wrapper (which is equivalent to the pyproj wrapper):

julia> using CoordRefSystems

julia> CRS1 = CoordRefSystems.get(EPSG{4326})
GeodeticLatLon{WGS84Latest}

julia> CRS2 = CoordRefSystems.get(EPSG{32633})
UTMNorth{33, WGS84Latest} (alias for UTM{North, 33, WGS84{1762}})

julia> convert(CRS2, CRS1(48.27168293014, 16.34019877249))
UTMNorth{WGS84Latest} coordinates
├─ x: 599445.7499999327 m
└─ y: 5.347365449999993e6 m

julia> convert(CRS1, CRS2(599445.75, 5347365.45))
GeodeticLatLon{WGS84Latest} coordinates
├─ lat: 48.27168293014006°
└─ lon: 16.34019877249091°

Geodesy.jl is not actively maintained. It should be deprecated or archived to avoid similar experiences.

juliohm avatar Jul 05 '24 12:07 juliohm

@juliohm FWIW, @asinghvi17 his answer was done with the native Julia implementation in this Geodesy package. Avoiding "similar experiences" and plugging CoordRefSystem is uncalled-for, and it would be appreciated if you disclose you're the author of said package.

Proj was mentioned for operations on other non-generic crs, that are not supported in Geodesy (nor in CoordRefSystems.jl for that matter).

A discussion on the maintenance status of this package should be done in a separate issue.

evetion avatar Jul 08 '24 13:07 evetion

@evetion your take on this issue is a bit surprising.

I have two things to say:

  1. Geodesy.jl should not be recommended to anyone nowadays given its status and available alternatives. You are not helping the OP by omitting this information.

  2. It doesn't matter that we maintain CoordRefSystems.jl, this is not politics. My recommendations are always based on technical criteria, and Geodesy.jl is clearly not the recommended option.

juliohm avatar Jul 08 '24 15:07 juliohm