Closed mmiller-max closed 2 years ago
Merging #63 (59c3da8) into master (076c7a2) will increase coverage by
0.65%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## master #63 +/- ##
==========================================
+ Coverage 71.58% 72.24% +0.65%
==========================================
Files 11 11
Lines 894 915 +21
==========================================
+ Hits 640 661 +21
Misses 254 254
Impacted Files | Coverage Δ | |
---|---|---|
src/types.jl | 79.16% <ø> (ø) |
|
src/nearest_node.jl | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 076c7a2...59c3da8. Read the comment docs.
This PR addresses and closes #45.
Changes
nearest_node
updated so now only returns a single node for each point given. If a single point is given (whether aGeoLocation
, vector of lat/lon,Node
or node ID) then a tuple of(id, dist)
is returned. If a vector of points is given, then a tuple of([ids...], [dists...])
is returned.Added
nearest_nodes
allows for the nearest n nodes. If a single point is given, returns a tuple of([ids...], [dists...])
. If a vector of points is given, returns a tuple of([[ids...]...], [[dists...]...])
.Concretely type
kdtree
field ofOSMGraph
- improves performanceQuite a bit of refactoring including removing function return typing - we can let Julia work this out.
Performance
I've benchmarked each of these functions against
main
, andmain
with thekdtree
field concretely typed. For each test below, the first time ismain
, the second is withkdtree
concretely typed and the third is with the changes in this PR. It can be seen that in all cases the refactoring is faster and allocates less.