If I understand correctly, with ECEFfromLLA(osgb36)(LLA(x, y)), what you are doing is to convert latitude longitude coordinate with no elevation, that lie on the OSGB36 datum, to a Earth-centered, Earth-fixed (ECEF) coordinate system, i.e. measured from the center of the Earth. What you want to do instead is to convert coordinates that you have that are in the OSGB 1936 / British National Grid (EPSG:27700) coordinate system, to latitudes and longitudes.
As mentioned,
However I’d strongly recommend to use the new API, both for increased accuracy, and because the old API is about to be removed:
julia> using Proj4
julia> trans = Proj4.Transformation("EPSG:27700", "EPSG:4326", always_xy=true)
Transformation
source: OSGB 1936 / British National Grid
target: WGS 84 (with axis order normalized for visualization)
julia> trans((426642.0, 380231.0))
2-element SVector{2, Float64} with indices SOneTo(2):
-1.6015358313331525
53.3183599763518
Curiously I get a different result to your example
julia> trans = Proj4.Transformation("EPSG:27700", "EPSG:4326", always_xy=true)
Transformation
source: OSGB 1936 / British National Grid
target: WGS 84 (with axis order normalized for visualization)
julia> trans((426642.0, 380231.0))
2-element StaticArrays.SVector{2, Float64} with indices SOneTo(2):
-1.601536798482117
53.31834270000983
And both are also different to the previous solution
Accuracy in the sixth decimal place in the latitude measurement is worth about 10 cm.
It is almost certain that common input data is far from that kind of accuracy.
I was scratching my head why I had slightly different results with GMT (that uses GDAL for this calculation). It turns out that is not indifferent if the EPSG code is converted into aPROJ4 string or a WKT. (I’m using the println to force writing with higher number of decimals)