Closed wilwade closed 9 years ago
You're right. See http://3v4l.org/O968T and http://3v4l.org/3O4Jp
Do you mind to make a PR ? :)
Do you want to default to the returned parsed input query for the street if there is no street?
Yes I think it's a good idea.
Note I did send that bad address upstream to Geocod.io. It parses fine with a comma after Road, but it is having trouble parsing it with the Road and the Fort. So one of the two new tests will start failing once they fix it upstream.
@wilwade Isn't it you wrote here https://github.com/geocoder-php/geocoder-extra/blob/1.x/tests/Geocoder/Tests/Provider/GeocodioProviderTest.php#L85 ?
It is, although I got a confirmation from Geocodio that they have added that specific address to their regression testing for their new address parser they are working on.
Thank you :) Shouldn't we close this issue and reopen it when Geocodio fixed their address parser ?
Here is an example query:
https://api.geocod.io/v1/geocode?q=386+BRANAM+ROAD+OLD+FORT+TN+37362&api_key=USE_YOUR_KEY
It returns
So that means that we throw an error on https://github.com/geocoder-php/geocoder-extra/blob/master/src/Geocoder/Provider/GeocodioProvider.php#L129
Looks to me like
$street = $address['street'] ?: null;
is supposed to be$address['street'] = isset($address['street']) ? $address['street'] : null;
but was typed wrong?There is also a section in the response that parses the input query into a street, perhaps that should be the default instead of null?