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

Show more than 10 search results #7

Open
bryceco opened this issue Aug 28, 2020 · 2 comments
Open

Show more than 10 search results #7

bryceco opened this issue Aug 28, 2020 · 2 comments

Comments

@bryceco
Copy link

bryceco commented Aug 28, 2020

You probably want to add “&limit=50” to the Nominatim search URL:

let url = URL(string: "https://nominatim.openstreetmap.org/?addressdetails=0&q=\(escapedTerm)&format=json")

@wtimme
Copy link
Owner

wtimme commented Aug 28, 2020

Thanks for the feedback, @bryceco!

This looks quite easily doable, thanks for providing the link to the line! I don't have that much experience with that particular API. Are there search strings that you put in where the default limit of the results is too small? For me personally, the first couple of search results usually do.

The thing that bothers me a bit with the search is that substrings are not found as expected. For example, when I search for "Trafalge" in order to find "Trafalgar Square", Nominatim returns zero results. But since the same is true for openstreetmap.org, I don't think that is an issue with the app.

@bryceco
Copy link
Author

bryceco commented Aug 28, 2020

Probably 80-90% of the time the first 10 results are sufficient. But every once in a while it doesn't find a feature I know is mapped and only after double-checking I realize it didn't appear because of the 10 item (default) cutoff.

I don't think there's a way to do a substring match like you want.

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

No branches or pull requests

2 participants