-
Notifications
You must be signed in to change notification settings - Fork 799
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
Functions of loxodrome
or rhumb line
are needed
#3855
Comments
Is there a reason why you can't just use Geographiclib? The geodesic functionality is included in PROJ because it is useful in various instances. I am not sure the same is the case for the rhumb lines, but maybe @cffk can enlighten that topic better than me. |
@AkexStar perhaps compute the Mercator coordinates of the end points, then interpolate linearly, and call the inverse Mercator, to obtain the geographical coordinates of a series of points along the loxodrome? |
I'll aggrege with @kbevers that the best option is to use GeographicLib directly. I believe that Rhumb line support is only implemented for the C++ library (GeographicLib::Rhumb and GeographicLib::RhumbLine). PROJ's geodesic functions are directly from GeographicLib's C implementation, as noted here. |
@AkexStar Is it really the case that rhumb lines are still used for navigation? Surely, all electronic systems are set up to follow geodesics and, even though the heading is continuously changing, the course does not have to be constantly adjusted, since the geodesic path corresponds to "rudder amidships". |
@kbevers @busstoptaktik @mwtoews |
Looking around for Python wrappers for GeographicLib I see GeoFun, which has Rhumb line functions. I've not used this, but try Another project is geographiclib-cython-bindings, but this project seems to have stalled, and no built distributions are available, and I only see Rhumb line in an unmerged PR |
That's funny. I had the exact same issue two weeks ago. Indeed, the IMO, having a bit more of |
@mwtoews And that is why I seek for |
Thanks to @cffk, I do need to learn more about rhumb and geodesic. I will try to study these. |
@AkexStar I'd be happy to build more wheels. What platform would you need? |
I like @busstoptaktik 's solution. The main purpose of Mercator projection is that a loxodrome is a straight line in the map. Linear interpolation there is simple and fast. Just be careful with the antimeridian.
As @cffk says, to compute the distance there is a direct formula. Fun fact: the distance to the pole is finite, but takes infinite number of turns. |
I'm on vacation right now. I'll start contributing again once I've returned (Sept 8). |
@jjimenezshaw |
@AkexStar If I understood properly the distance in a loxodrome, equidistant points in the curve will be equally distributed in latitude. Am I right? Convert those latitudes into |
You cannot do that: Equidistant in both latitude and longitude would imply a plate-carré projection, and straight lines in a plate-carré projection are not loxodromes. You can get loxodromic equidistance in longitude by splitting your input linearly wrt. the longitude span, then iterating bisectionally wrt. easting, along the mercator-projected line (you may be able to find a closed form solution, at least for the spherical case) |
If I want to get a series of equidistant points between source and destination on ellipsoid(WGS84), is there a way to use mercator projection? |
Essentially no. Not without numerical integration along the path. You could probably do it in the Mercator space, and correct the length of each integration-step by the local scale factor, which you can get through the PROJ API and get a feeling for using the proj executable: $ echo 12 55 | proj -VS +proj=merc
#Mercator
# Cyl, Sph&Ell
# lat_ts=
# +proj=merc +break_cs2cs_recursion +ellps=GRS80
#Final Earth figure: ellipsoid
# Major axis (a): 6378137.000
# 1/flattening: 298.257222
# squared eccentricity: 0.006694380023
Longitude: 12dE [ 12 ]
Latitude: 55dN [ 55 ]
Easting (x): 1335833.89
Northing (y): 7326837.71
Meridian scale (h) : 1.73952661 ( 73.95 % error )
Parallel scale (k) : 1.73952661 ( 73.95 % error )
Areal scale (s): 3.02595283 ( 202.6 % error )
Angular distortion (w): 0.000
Meridian/Parallel angle: 90.00000
Convergence : 0d [ -0.00000000 ]
Max-min (Tissot axis a-b) scale error: 1.73953 1.73953 |
@AkexStar. I think it would be helpful if you explain on a higher level what you're trying to achieve. Obviously splitting either an orthodrome (geodesic: shortest distance) or a loxodrome (rhumb line: constant heading/azimuth) from point A to point B into a number of equal length segments is trivial. So in what way is that not sufficient? |
Assuming the latitudes of source and destination are different, then just pick points equally spaced in latitude using the geodesic machinery of PROJ for a meridional geodesic. This gives a series of latitudes; convert each latitude to the Mercator y coordinate; compute the corresponding x coordinate in the Mercator projection and this gives you the longitude. If the latitudes of source and destination are the same, just divide the longitude interval evenly. My paper on rhumb lines gives a method which maintains accuracy if the difference in latitudes is small. |
@jrversteegh |
Also thanks to explanations from @busstoptaktik and @cffk |
@AkexStar I've updated the readme at https://github.com/jrversteegh/geofun with such a case: JFK-AMS flight paths. |
Some people showed here how to easily compute a loxodrome using the Mercator projection. Should this issue be closed? |
Yes |
I have did a lot of surveys, but found that there is few libs about
rhumb_inverse
andrhumb_direct
.I noticed that Geographiclib has a solution for rhumb, but
PROJ
still lacks of functions to calculate rhumb line.Rhumb Line is very important for air/sea track calculation.
I hope that there will be funtions just similar to Geodesic calculations to solve rhumb line.
I will be very grateful if any developer could reply me.
The text was updated successfully, but these errors were encountered: