symerio / pgeocode

Postal code geocoding and distance calculation
https://pgeocode.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
231 stars 57 forks source link

Handle detailed postal codes for Great Britain #4

Open rth opened 5 years ago

rth commented 5 years ago

The GB dataset for Great Britain only includes outwards codes (i.e. only first 3 letters). The full dataset is included in GB_full, but currently this fails to load,

>>> import pgeocode
>>> dist = pgeocode.GeoDistance('GB_full')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/rth/src/pgeocode/pgeocode.py", line 174, in __init__
    super(GeoDistance, self).__init__(country)
  File "/home/rth/src/pgeocode/pgeocode.py", line 49, in __init__
    .format(country))
ValueError: country=GB_FULL is not a known country code. See the README for a list of supported countries

Mostly making sure input validation works, in this case, should fix this, I think.

amarchin commented 4 years ago

Hi, I was looking for a package like pgeocode. Unfortunately I need the GB_full dataset so I open a PR to address this issue: https://github.com/symerio/pgeocode/pull/18

Let me know if you think it is acceptable :)

Thank you for the package!

alvise1988 commented 4 years ago

Hello @rth ,

First of all, thanks for the useful package!

I would be looking exactly for this feature and most of the work seems to have been done already. Is there any particular reason why the PR was never merged?

Thanks

martijnschouten commented 3 years ago

I forked the package and edited it to support the full list of postal codes of the Netherlands and Great Brittain. See d32dace3a03647ffc72a491ae3ab441533d86b6f