Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@cylon-v
Copy link
Contributor

@cylon-v cylon-v commented Jun 26, 2017

This PR adds PickPoint geocoder, which is commercial version of Nominatim hosted at https://pickpoint.io.

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.

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.

:class:`urllib2.ProxyHandler`.
"""

Nominatim.__init__(
Copy link
Member

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.

timeout,
proxies,
'api.pickpoint.io',
'https',
Copy link
Member

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
Copy link
Member

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:

  1. PickPoint should be listed in the __all__ tuple above in this file
  2. Same for SERVICE_TO_GEOCODER dict (below in this file)
  3. Should have own test module (done) which should be referenced in geopy/test/geocoders/__init__.py (missing)
  4. 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 (see test/geocoders/what3words.py for example).

class PickPointTestCase(GeocoderTestBase):

delta = 0.04
API_KEY="4Xbbg6q9Tzms7ZyrrtvJ"
Copy link
Member

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

@cylon-v
Copy link
Contributor Author

cylon-v commented Mar 15, 2018

@KostyaEsmukov, thanks for the review! I will update the PR soon.

@KostyaEsmukov KostyaEsmukov mentioned this pull request Mar 17, 2018
25 tasks
@cylon-v cylon-v force-pushed the add-pickpoint-geocoder branch from a6adfe9 to 72c7dc7 Compare March 31, 2018 03:32
Review notes.

Review notes.
@cylon-v cylon-v force-pushed the add-pickpoint-geocoder branch from 72c7dc7 to 0c11a17 Compare March 31, 2018 03:38
@cylon-v
Copy link
Contributor Author

cylon-v commented Mar 31, 2018

Hey @KostyaEsmukov, I updated my PR, please feel free to review changed version.

@KostyaEsmukov KostyaEsmukov added this to the 1.13 milestone Apr 7, 2018
@KostyaEsmukov
Copy link
Member

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!

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.

2 participants