diff --git a/src/geod.jl b/src/geod.jl index 3b12369..2600960 100644 --- a/src/geod.jl +++ b/src/geod.jl @@ -34,7 +34,7 @@ function geod_inverse(g::geod_geodesic, lat1::Real, lon1::Real, lat2::Real, lon2 azi1 = Ref{Cdouble}(NaN) azi2 = Ref{Cdouble}(NaN) - geod_inverse(Ref(g), lat1, lat2, lon1, lon2, s12, azi1, azi2) + geod_inverse(Ref(g), lat1, lon1, lat2, lon2, s12, azi1, azi2) return s12[], azi1[], azi2[] end diff --git a/test/libproj.jl b/test/libproj.jl index 850d741..04a0f5c 100644 --- a/test/libproj.jl +++ b/test/libproj.jl @@ -479,7 +479,7 @@ end # Maybe enable later, based on https://github.com/JuliaGeo/GeoFormatTypes.jl/issues/21 # @test convert(GFT.ProjString, gftcrs) == GFT.ProjString("+proj=longlat +datum=WGS84 +no_defs +type=crs") - # Check that we can round trip CRS/wkt without errors + # Check that we can round trip CRS/wkt without errors @test GFT.EPSG(Proj.CRS(GFT.WellKnownText(crs))) == GFT.EPSG(Proj.CRS(GFT.WellKnownText2(crs))) @@ -495,8 +495,10 @@ end lat1, lon1, lat2, lon2 = 40.64, -73.78, 1.36, 103.99 @test_nowarn geod = Proj.geod_geodesic(6378137, 1 / 298.257223563) + # the azi1 and s12 values were computed directly + azi1, s12 = 3.3057734780176125, 1.534751294051294e7 @test_nowarn direct_line = - Proj.geod_directline(geod, lat1, lon1, 3.3057734780176125, 1.534751294051294e7) # the azi1 and s13 values were computed directly + Proj.geod_directline(geod, lat1, lon1, azi1, s12) @test_nowarn inverse_line = Proj.geod_inverseline(geod, lat1, lon1, lat2, lon2) @test begin @@ -523,6 +525,11 @@ end lats, lons = Proj.geod_path(geod, lat1, lon1, lat2, lon2, 2) lats[1] ≈ lat1 && lats[2] ≈ lat2 && lons[1] ≈ lon1 && lons[2] ≈ lon2 end + + @test begin + s12_, azi1_, azi2_ = Proj.geod_inverse(geod, lat1, lon1, lat2, lon2) + s12 ≈ s12_ && azi1 ≈ azi1_ + end end @testset "GeoInterface" begin