-
Notifications
You must be signed in to change notification settings - Fork 664
Add PickPoint geocoder. #246
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
Conversation
KostyaEsmukov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this! This looks really good, especially the tests!
There are some missing things however, I've left some notes there.
Could you also please rebase on top of current master? Readme has been converted to rst and test files shouldn't be listed in the Makefile anymore.
geopy/geocoders/pickpoint.py
Outdated
| :class:`urllib2.ProxyHandler`. | ||
| """ | ||
|
|
||
| Nominatim.__init__( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason to not use super(PickPoint, self).__init__( here? The base class Geocoder is a new-style class (it extends object), so it should be fine. Also all other geocoders call constructor this way.
I would also suggest to use keyword arguments instead of positional ones, because this is really a large set of them.
geopy/geocoders/pickpoint.py
Outdated
| timeout, | ||
| proxies, | ||
| 'api.pickpoint.io', | ||
| 'https', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nominatim class has domain and scheme args, so these should be used there too instead of hardcoding the values.
| from geopy.geocoders.opencage import OpenCage | ||
| from geopy.geocoders.openmapquest import OpenMapQuest | ||
| from geopy.geocoders.osm import Nominatim | ||
| from geopy.geocoders.pickpoint import PickPoint |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to make a checklist for adding new geocoder classes next days (I'll attach the link when it's done), but before it's there, here's a couple of things definitely missing here:
PickPointshould be listed in the__all__tuple above in this file- Same for
SERVICE_TO_GEOCODERdict (below in this file) - Should have own test module (done) which should be referenced in
geopy/test/geocoders/__init__.py(missing) - In case an API KEY is required, it should be listed in
geopy/test/geocoders/util.py(see the top of the file) and the test class should be guarded with a unittest decorator (seetest/geocoders/what3words.pyfor example).
test/geocoders/pickpoint.py
Outdated
| class PickPointTestCase(GeocoderTestBase): | ||
|
|
||
| delta = 0.04 | ||
| API_KEY="4Xbbg6q9Tzms7ZyrrtvJ" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use an ENV variable instead
|
@KostyaEsmukov, thanks for the review! I will update the PR soon. |
a6adfe9 to
72c7dc7
Compare
Review notes. Review notes.
72c7dc7 to
0c11a17
Compare
|
Hey @KostyaEsmukov, I updated my PR, please feel free to review changed version. |
|
I've just pushed a couple of cosmetic changes to your branch. I'm sorry for not asking you first: I just want to speed up the 1.13 version release. Merging now, thank you for this! |
This PR adds PickPoint geocoder, which is commercial version of Nominatim hosted at https://pickpoint.io.