-
Notifications
You must be signed in to change notification settings - Fork 2k
docs(external): add docs for haversine VRL function
#23336
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
4b80ee3
docs(external): add docs for `haversine` VRL function
esensar 49a0bc4
Apply suggestions from code review
esensar 49ffdac
Rename haversine function in docs
esensar bee7236
Add map category to docs
esensar 93acc22
Fix docs formatting
esensar 6db8e40
Generate #FunctionCategory disjunction from list to reduce duplication
esensar 9d88404
Update names of arguments
esensar b3cd50c
Update VRL
esensar 74d286d
Merge remote-tracking branch 'origin/master' into docs/haversine
pront 48698bb
Update VRL
esensar acb9128
Merge branch 'master' into docs/haversine
esensar 5e6bcd0
Update types for haversine in docs
esensar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,72 @@ | ||
| package metadata | ||
|
|
||
| remap: functions: haversine: { | ||
| category: "Map" | ||
| description: """ | ||
| Calculates [haversine](\(urls.haversine)) distance and bearing between two points. | ||
| Results are available in kilometers or miles. | ||
| """ | ||
|
|
||
| arguments: [ | ||
| { | ||
| name: "latitude1" | ||
| description: "Latitude of the first point." | ||
| required: true | ||
| type: ["float"] | ||
| }, | ||
| { | ||
| name: "longitude1" | ||
| description: "Longitude of the first point." | ||
| required: true | ||
| type: ["float"] | ||
| }, | ||
| { | ||
| name: "latitude2" | ||
| description: "Latitude of the second point." | ||
| required: true | ||
| type: ["float"] | ||
| }, | ||
| { | ||
| name: "longitude2" | ||
| description: "Longitude of the second point." | ||
| required: true | ||
| type: ["float"] | ||
| }, | ||
| { | ||
| name: "measurement" | ||
| description: "Measurement system to use for resulting distance." | ||
| required: false | ||
| type: ["string"] | ||
| default: "kilometers" | ||
| enum: { | ||
| kilometers: "Use kilometers for the resulting distance." | ||
| miles: "Use miles for the resulting distance." | ||
| } | ||
| }, | ||
| ] | ||
| internal_failure_reasons: [] | ||
| return: types: ["object"] | ||
|
|
||
| examples: [ | ||
| { | ||
| title: "Haversine in kilometers" | ||
| source: #""" | ||
| haversine(0.0, 0.0, 10.0, 10.0) | ||
| """# | ||
| return: { | ||
| distance: 1568.5227233 | ||
| bearing: 44.561 | ||
| } | ||
| }, | ||
| { | ||
| title: "Haversine in miles" | ||
| source: #""" | ||
| haversine(0.0, 0.0, 10.0, 10.0, "miles") | ||
| """# | ||
| return: { | ||
| distance: 974.6348468 | ||
| bearing: 44.561 | ||
| } | ||
| }, | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.