estin / geosuggest

suggest by name or find nearest by coordinates cities
MIT License
9 stars 1 forks source link

Feature request: Be able to limit suggest and reverse to a list of countries #6

Closed jqnatividad closed 1 year ago

jqnatividad commented 1 year ago

It'd be great if both suggest and reverse results can be constrained to a provided list of countries.

This will greatly increase usability, especially for suggest, as it will markedly reduce false positive suggestions.

estin commented 1 year ago

it's is good option. I will take it to implement soon. But how about to build index only for set of countries? Less index size is better choice for concrete use cases.

jqnatividad commented 1 year ago

Awesome!

IMHO, its a must have for suggest to reduce the false positive matches.

Apart from country, you may want to also implement filters for CitiesRecord fields like admin_division, admin1_names, timezone and population while you're at it.

And I agree building an index for a set of countries is required as well.

Insofar as my use cases are concerned, I'd vote for the suggest filters over index optimization.

estin commented 1 year ago

done. release v0.4.0 it wasn't elegant to apply new logic for suggest/reverse. especial for reverse

jqnatividad commented 1 year ago

Thanks sooo much @estin !

geosuggest is sooo fast and its utility is far higher than the reverse-geocoder crate I was using before!

jqnatividad commented 1 year ago

BTW @estin,, for reverse, I just realized that the country filter doesn't really make sense.

You may want to remove support for country filtering for reverse. Sorry 😦

estin commented 1 year ago

@jqnatividad Thanks!

You may want to remove support for country filtering for reverse. Sorry 😦

No. It's may be useful to filter by countries on reverse where location nearest for country bounds.