Skip to content
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 max_distance argument to s2_closest edges() #162

Merged
merged 3 commits into from Jan 16, 2022

Conversation

paleolimbot
Copy link
Collaborator

For #156, see #125.

@rsbivand I believe you originally requested this...many apologies for taking so long to implement it!

library(s2)

names <- s2_data_tbl_cities$name
cities <- s2_data_cities()
london <- s2_data_cities("London")

# cities within 500 km of London
edge_ids <- s2_closest_edges(
  london, cities, 
  k = 100,
  min_distance = 0,
  max_distance = 500000
)

names[edge_ids[[1]]]
#> [1] "Dublin"     "Brussels"   "Amsterdam"  "Luxembourg" "Paris"     
#> [6] "The Hague"

@codecov-commenter
Copy link

codecov-commenter commented Jan 16, 2022

Codecov Report

Merging #162 (9869630) into main (bd2213d) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #162      +/-   ##
==========================================
+ Coverage   94.55%   94.56%   +0.01%     
==========================================
  Files          40       40              
  Lines        2864     2871       +7     
==========================================
+ Hits         2708     2715       +7     
  Misses        156      156              
Impacted Files Coverage Δ
R/s2-matrix.R 100.00% <100.00%> (ø)
src/s2-matrix.cpp 97.46% <100.00%> (+0.01%) ⬆️

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 bd2213d...9869630. Read the comment docs.

@paleolimbot paleolimbot merged commit a323a74 into main Jan 16, 2022
@paleolimbot paleolimbot deleted the closest-edges-max-dist branch January 16, 2022 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants