8000 Add restricting results via bounded parameter in Nominatim by 0x836 · Pull Request #182 · geopy/geopy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add restricting results via bounded parameter in Nominatim #182

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

Closed
wants to merge 1 commit into from

Conversation

0x836
Copy link
@0x836 0x836 commented Mar 9, 2016

Viewbox area is preferred area to find search results.
The goal of adding bounded parameter is guaranteed restricting results to the bounding box.

For example
[query without bounded](http://nominatim.openstreetmap.org/search.php?q=строитель томск&viewbox=84.719353,56.588456,85.296822,56.437293)
geolocator = Nominatim(format_string='%s,Томск', view_box=('84.719353','56.588456','85.296822','56.437293')) - I want to get coords from Tomsk/Tomsk district etc excluding cities/villages south of the Tomsk

so [query with bounded](http://nominatim.openstreetmap.org/search.php?q=строитель томск&viewbox=84.719353,56.588456,85.296822,56.437293&bounded=1) is what I need

geolocator = Nominatim(format_string='%s,Томск', view_box=('84.719353','56.588456','85.296822','56.437293'), bounded=True)

Copy link
Member
@KostyaEsmukov KostyaEsmukov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks reasonable to me, thank you!

Could you please add a test for this? Thanks in advance.

@KostyaEsmukov KostyaEsmukov added this to the 1.15 milestone May 7, 2018
@senjed
Copy link
senjed commented Jun 26, 2018

I added the bounded parameter in a similar way and I get None as a result of geocoding. any updates on this issue?

@KostyaEsmukov
Copy link
Member

Merged in #308. Thanks @0x836 !

@senjed The None you're getting might be because Nominatim is unable to satisfy your query within the view_box.

@senjed
Copy link
senjed commented Jun 27, 2018

well I don't think that the None that I am getting is because of that since the view_box that I use is for a city and when I include the name of the city in the query (but without view_box) I will get relevant results with coordinates inside the view_box.

@KostyaEsmukov
Copy link
Member

That is interesting. But anyway, this looks like a peculiarity in Nominatim's behavior, which doesn't seem to be related to geopy itself (and this PR in particular). I would say that your #307 issue is a better venue for that (if it's still a problem).

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.

3 participants
0