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

Filter on handhold distance #56

Open
btmccord opened this issue Mar 17, 2024 · 3 comments
Open

Filter on handhold distance #56

btmccord opened this issue Mar 17, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@btmccord
Copy link
Contributor

btmccord commented Mar 17, 2024

As a user it would be awesome to have two additional filters that would enable looking for climbs of a specific nature (ie. long/short, big moves/small moves etc) I think two additional filters would enable this pretty well.

  • Filter by number of hand holds

  • Filter by hand hold distance, This one seems hard to achieve since this data is not in the database from what I can tell.

@lemeryfertitta
Copy link
Owner

Thanks for the ideas! Both are possible but non-trivial.

Filter by number of hand holds

This requires parsing the frame string to find the roles of each hold, and then counting the number of placements that have a role designated for hands. This would likely have to be done in Python instead of the SQLite query, so it will probably be a bit slower, but I'd imagine it should still be performant enough, especially on smaller queries.

Filter by hand hold distance

This would be on top of the previous (first identify all of the hand holds), then map the placements to the x y coordinates of the board (holes table), then some algorithm to score overall "distance" - maybe something like finding the min distance between each point and every other point, and then summing that min distance for each point. It would be interesting to see if an algorithm like that actually captures the spirit of the filter, given that you do not always move between the closest hand holds in a climb.

@lemeryfertitta lemeryfertitta added the enhancement New feature or request label Mar 17, 2024
@btmccord
Copy link
Contributor Author

btmccord commented Mar 17, 2024

I am not very familiar with SQLite but it seems like something like this would work for the number of hand holds?

SELECT frames, (length(frames) - length(replace(frames, 'r13', ''))) / 3 AS holdCount FROM climbs WHERE holdCount BETWEEN 5 and 10

@lemeryfertitta lemeryfertitta changed the title Filters for the nature of climbs Filter on handhold distance Apr 26, 2024
@lemeryfertitta
Copy link
Owner

Filtering on hold count has been deployed. Leaving the issue open for the the idea of filtering on distance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants