-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Add support for distances in nautical miles #5088
Conversation
corresponding "nm" unit suffix.
cool stuff - can you sign the CLA so we can pull this in? |
The CLA was submitted just before this pull request; I have the PDF file so it should be on its way. |
Nice One! But I think we should name it "nmi" rather than "nm" to avoid conflicts with metric units. |
I've seen "nmi" suggested, but for any distances related to aviation (distances between two points, maximum ranges, and so on), I've only seen "nm". For one of many examples, the ranges of the various Gulfstream jets are given in "nm": http://www.gulfstream.com/careers/our_products.html But I'm all for changing the second string to "mni" (unless DistanceUnit supports more than 2 strings... I didn't have time to explore that one after I thought of it). But geospatial distances and aircraft distances never confuse "nm" with nanometers! So both "nm" and "nmi" would seem to be useful; let the client decide which to use. Does that make sense? |
Sure, within a specific field there won't be confusion. My concern is more about setting up more metric units. In this case nanometers and their naming. IMO we should have the "mi" suffix on miles and keep "m" for meters. |
With nm being the SI symbol for nanometer I'd go with nmi for nautical miles. A shame they share the symbol. |
yes, indeed! |
In that case, I wouldn't recommend pulling in this change. When I receive a feed that uses "nm" for nautical miles, as 100% of the aviation world uses, I'll need to front ES with my own converter. And in that case, I'll just convert it down to meters and the current DistanceUnit already supports it. On the other hand, I can't imagine nanometers being useful for geo distances. Academics aside, a human hair is about 100,000 nanometers; is ES going to be used to search for the nearest bacterium at the end of hair number 21,456,234? |
I still think, supporting nautical miles is a good and reasonable idea. Also we're discussing measuring distances, a part of ES that should kept as general as possible. Maybe it doesn't make sense (yet) to talk about nanometer distances in the current context, but we should not spoil future applications of this. In my opinion we should primarily support the SI units and their abbreviations and search for reasonable alternatives on non-SI units. Also, if we turn the argument and ask what the abbreviation nm stands for, I would say even people of the aviation world ponder on the related field. But for this special kind of purpose it's possible to set a default unit separately by the |
The DistanceUnit is case-sensitive? Then how about "NM" (another accepted, though not common, abbreviation for nautical miles), and also "nmi"? Nobody in aviation would ever doubt what "nm" stood for, or they wouldn't last long in aviation! But I fully understand your argument, and can envision that nanometers might be extremely useful for the medical and bioengineering fields, for example (just not for geo-distances, of course). So in the interests of SI coexistence I propose "NM" and "nmi". And then, of course. "nauticalmiles" for consistency with the other supported enumerations. How does this sound? |
I agree! This is a great idea! |
I had to define NAUTICALMILES with "nmi" before MILES with "mi" because "mi" is a subset of "nmi" (same reason that METERS had to come last). But now the test case succeeds with both NM and nmi as suffix strings. If you think this is acceptable, I'll commit and push this change. I might even try to rebase it into one commit message but not sure. I'm solidly booked for the next few days. But if you like this compromise and you think I should rebase then let me know. Thanks! |
corresponding "NM and "nmi" unit suffixes.
@brian-from-fl yes it needs to be defined before miles. I guess rebase is not necessary right now, but please try. Thanks. |
I don't have my expert handy and there are only two comments; the most recent one is accurate and complete. I committed, and then pushed up to my nm-branch. Do I need to make another pull request? |
By the way, both of these test cases passed! (After I fixed the order!!!!)
|
That's great. You don't need to open another pull request but it would be kind, if you can squash both commits. |
sorry, I forgot to ask you if you can insert the new unit into |
Re: Rebase. A bit confusing to this git newbie. If I make the most recent commit message all-inclusive, is that OK? Re: docs. How's this? "Nautical miles" is two words; Is this acceptable or do you have a better suggestion:
|
…sponding "NM and "nmi" unit suffixes. Update the docs to match.
no worries. On docs just insert |
corresponding "NM", "nmi", and "nauticalmiles" unit suffixes. Added the DistanceUnit.NAUTICALMILES enumeration label with the corresponding "NM and "nmi" unit suffixes. Update the docs to match. Change underscore to blank, as in: Nautical mile:: 'NM' or 'nmi' or 'nauticalmiles'
…earch into nm-branch Conflicts: docs/reference/api-conventions.asciidoc
I did the rebase and squash thing... went ok including the most recent commit message update. Then a push failed. Needed to pull, but then a merge conflict. After correcting that, the commit message is not what it was but... as I said, this is my very first day with git and GitHub. I hope it's ok as it stands. My apologies if it's worse than before. |
…sponding "NM and "nmi" unit suffixes. Update the docs to match with proper backtics.
Had to fix the asciidoc since I noticed it used backtics and not single quotes. Then on review, I noticed that the TimeValue is missing |
Yes, I thing the timevalues are another story. on the current branch you're always able to override your last commit message by |
I guess you solved all the conflicts and you're on the latest master now? so look up the git log for the last sha1 id that's not associated with your changes and do |
…sponding "NM and "nmi" unit suffixes. Update the docs to match with proper backtics.
given that these are the official symbols for nautic miles |
+1 on using the International System of Units conventions; I'm not a fan of using upper vs lower case but these are the official names so we should support them as such. |
Added the DistanceUnit.NAUTICALMILES enumeration label with the corresponding "nm" unit suffix.
Closes #5085