Skip to content

feat(stdlib): add haversine function#1442

Merged
pront merged 7 commits intovectordotdev:mainfrom
esensar:feature/haversine-function
Jul 9, 2025
Merged

feat(stdlib): add haversine function#1442
pront merged 7 commits intovectordotdev:mainfrom
esensar:feature/haversine-function

Conversation

@esensar
Copy link
Contributor

@esensar esensar commented Jul 3, 2025

Summary

Adds haversine function for calculating haversine distance and bearing, in kilometers or miles.

Change Type

  • Bug fix
  • New feature
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

How did you test this PR?

Included tests and benchmarks.

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on
    our guidelines.
  • No. A maintainer will apply the "no-changelog" label to this PR.

Checklist

  • Our CONTRIBUTING.md is a good starting place.
  • If this PR introduces changes to LICENSE-3rdparty.csv, please
    run dd-rust-license-tool write and commit the changes. More details here.
  • For new VRL functions, please also create a sibling PR in Vector to document the new function.

References


Sponsored by Quad9

Copy link
Member

@pront pront left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good mostly, left some nits.

esensar and others added 2 commits July 7, 2025 16:15
Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
esensar and others added 2 commits July 7, 2025 19:58
Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
@pront pront enabled auto-merge July 7, 2025 20:33
@pront pront added the vrl: stdlib Changes to the standard library label Jul 7, 2025
@pront pront added this pull request to the merge queue Jul 9, 2025
Merged via the queue into vectordotdev:main with commit f2a1bed Jul 9, 2025
17 checks passed
@esensar esensar deleted the feature/haversine-function branch July 9, 2025 16:10
esensar added a commit to esensar/vrl that referenced this pull request Jul 11, 2025
github-merge-queue bot pushed a commit that referenced this pull request Jul 14, 2025
* fix(stdlib): properly export haversine function in `all`

Related: #1442

* Fix failing tests
github-merge-queue bot pushed a commit to vectordotdev/vector that referenced this pull request Jul 21, 2025
* docs(external): add docs for `haversine` VRL function

Related: vectordotdev/vrl#1442

* Apply suggestions from code review

Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com>

* Rename haversine function in docs

* Add map category to docs

* Fix docs formatting

* Generate #FunctionCategory disjunction from list to reduce duplication

* Update names of arguments

* Update VRL

* Update VRL

* Update types for haversine in docs

---------

Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com>
Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
5Dev24 pushed a commit to 5Dev24/vector that referenced this pull request Jul 21, 2025
…3336)

* docs(external): add docs for `haversine` VRL function

Related: vectordotdev/vrl#1442

* Apply suggestions from code review

Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com>

* Rename haversine function in docs

* Add map category to docs

* Fix docs formatting

* Generate #FunctionCategory disjunction from list to reduce duplication

* Update names of arguments

* Update VRL

* Update VRL

* Update types for haversine in docs

---------

Co-authored-by: Rosa Trieu <107086888+rtrieu@users.noreply.github.com>
Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

vrl: stdlib Changes to the standard library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

New function: haversine (map distances on globe between latitude/longitude pairs)

2 participants