Closed slinkp closed 11 years ago
(In [de54a19747078e230f5a182f94187b70e8bb18e6]) Fixes #286, major breakage in full_geocode(convert_to_block=True), now with some tests ... still needs more coverage
Thanks for the report, and the analysis - all correct.
Ticket imported from Trac: http://developer.openblockproject.org/ticket/286 Reported by: kmtracey
This code: https://github.com/openplans/openblock/blob/master/ebpub/ebpub/geocoder/base.py#L498
runs into a few problems when convert_to_block is True. Seems it's been copied from somewhere else but not fully adapted. For easier reference the code is:
First we need a
from ebpub.utils.text import address_to_block
before using address_to_block, that's easy.I think
kwargs['location_name']
needs to be replaced withquery
throughout.We need an instance of !BlockGeocoder to call
_do_geocode
result['result']['address'] = block_name
generatesKeyError: 'result'
, I think that's maybe supposed to beresult['address'] = block_name
And in that case where we have a result it needs to be returned somehow?