Feature #11803
openRepeaterBook proximity query unable to return multi-state results
0%
Description
(Describe what you were doing)
Goal is to load all repeaters within 150 miles of my longitude and latitude.
Repeaterbook query form has country and state selected (US, NH). I can not un-select the state. In a perfect world, I should be able to un-select the country and state since I am using Longitude and Latitude
(Describe what you expected to happen)
Expected to see repeaters located in four states - NH, MA, VT, ME
(Describe what actually happened instead)
List of repeaters was limited to NH
(Has this ever worked before? New radio? Does it work with OEM software?)
No
Files
Updated by Mike Brown 23 days ago
- File config.txt config.txt added
- File macos_system_info.txt macos_system_info.txt added
- File debug_log.txt debug_log.txt added
[Uploaded from CHIRP next-20250124]
Updated by Mike Brown 23 days ago
I forgot to include that I tried the query with a distance of 200 and 300 in case this is using kilometers instead of miles
Updated by Dan Smith 23 days ago
- Tracker changed from Bug to Feature
- Subject changed from RepeaterBook proximity query fails to return multi-state results to RepeaterBook proximity query unable to return multi-state results
- Status changed from New to Blocked
- Platform deleted (
MacOS)
Unfortunately, RepeaterBook's API does not support proximity (by lat/lon) queries directly. CHIRP is downloading a state's worth of data and then doing the geographical filtering/sorting itself. The only real way to do this with the current API would be to download the entire country.
I'll leave this open and can bring it up with the RepeaterBook admin at some point, but just know that it's not an easy limitation to address.
Updated by Mike Brown 22 days ago
- File logo_200.gif logo_200.gif added
Hi Dan,
I understand the problem if the API doesn’t support the functionality. RepeaterBook does have a query in their web UI that uses proximity… Here’s the URL I copied from a query that has the four state results.
https://www.repeaterbook.com/repeaters/prox2_result.php?city=&lat=43.427800&long=-71.935405&distance=75&Dunit=m&band%5B%5D=4&band%5B%5D=16&freq=&call=&mode%5B%5D=1&status_id=%25
Repeaters within 75 miles of 43.427800, -71.935405
repeaterbook.com
Regards
Mike
On Jan 30, 2025, at 21:32, Dan Smith redmine@chirpmyradio.com wrote:
Updated by Dan Smith 22 days ago
Yep, I know, but the API does not.
I've been thinking about this all day and I've just cooked up what might be a reasonable workaround until/unless we get the ability to get larger data sets from repeaterbook. CHIRP caches the RB data so it rarely has to hit the API after it has data for a region. How about if you're doing a proximity search (lat, lon and distance) CHIRP just includes all the cached data it has in that search? On a cold system that has no cached data, searching for MA, with a suitable lat,lon,distance will only return MA results. But, if you've ever queried for NH, then the same query will include NH repeaters if they're within the range circle, along with VT if you have ever queried VT, and so on. It's a little more obscure than just being able to unselect the state, but it would at least be predictable. Thoughts?
I would say chirp could just let you select multiple states and it would query what it needs (i.e. doesn't have cached) but the RB API has some very tight rate limits on it and a programmatic multi-query will get you on the throttled list pretty quick.
Updated by Mike Brown 21 days ago
Hi Dan,
Your clever solution appeals to my laziness :). I'm concerned about how to explain this to others. Can you add a pop up or similar to the proximity query explaining how to get multiple state results? Or an explicit option that says only use cached results and explains how to populate the cache?
Another option is to add an explanation that multi-state results are not supported and require the user to export RB's proximity results into Chirp.
Regards
Mike
Updated by Dan Smith 21 days ago
Yeah, like I said, it's a bit obscure for the user. I thought about trying to let them select multiple states as long as they're cached, but it'll also be complex and confusion to explain to the average person why you can select some multiple states and not others.
Maybe just an "include cached results from other areas if they match" check box with a tooltip would be sufficient. Or, just not say anything and those that know will know and those that don't will just do multiple queries. Sometimes trying to be flexible ends up biting me in "support costs" :)
But yeah, I'll do something around this.
Updated by Dan Smith 21 days ago
- File clipboard-202502010757-y5aig.png added
- File clipboard-202502010759-mjp6z.png clipboard-202502010759-mjp6z.png added
Maybe this? It's showing the tooltip when you hover, but the mouse pointer is not visible.
Updated by Mike Brown 20 days ago
Hi Dan - it looks good - just need somewhere to explain how to populate the cache and explain the lifetime of a cache entry
Updated by Dan Smith 20 days ago
"Downloaded before" is "how to populate the cache" and the lifetime is infinite for the purposes of including in another query. This box is already pretty busy and I don't think it's important enough of a feature to consider redesigning it. If you think it's still obscure, I can just shelve this and wait for a potential API change sometime in the future.
Updated by Mike Brown 20 days ago
Hi Dan
I understand and agree with your point about the pop up is busy and a redesign.
As a compromise, Is there a place I could create a write up on proximity search in the Chirp documentation? I'm thinking the write-up would have notes on:
1 - RB API doesn't support proximity
2 - how to populate the cache
3 - example of a multi-state search
If not, I'm ok with adding your original solution or doing nothing until RB adds proximity to the API.
Regards
Mike
Updated by Dan Smith 19 days ago
Okay I added ExternalDatabases as a template with a section to explain the details. I've made the label before the checkbox to enable this a link to that page/section. I've also added you as a wiki editor so you should be able to edit that page. Do you have enough info to presumptively fill that out a little?
Updated by Mike Brown 19 days ago
Hi Dan
Great! I put a draft recipe and explanation in ExternalDatabases , let me know what changes you want me to make.
Regards
Mike
Updated by Dan Smith 19 days ago
- Status changed from Blocked to In Progress
Thanks, I flipped around a few words that I think will make it more readable by a layperson. Also, CHIRP refreshes a cached state if you query for it and the cached version is more than 30 days old, but it will never purge them (so they're always available offline). Maybe it's easier to describe doing this as a "always query each state first" but that will only really be necessary in practice if you've never queried before.
Anyway, at least there's something...