geocoder-php/BazingaGeocoderBundle

chain doesn't propagate after gap return zero_results

AlmogBaku opened this issue · 10 comments

chain doesn't propagate after gap return zero_results:

bazinga_geocoder:
  providers:
    gmap:
      cache: 'app.simple_cache'
      cache_lifetime: 3600
      factory: Bazinga\GeocoderBundle\ProviderFactory\GoogleMapsFactory
      options:
        api_key: '%env(GMAPS_API)%'
    opencage:
      cache: 'app.simple_cache'
      cache_lifetime: 3600
      factory: Bazinga\GeocoderBundle\ProviderFactory\OpenCageFactory
      options:
        api_key: '%env(OPENCAGE_API)%'
    chain:
      factory: Bazinga\GeocoderBundle\ProviderFactory\ChainFactory
      options:
        services: ['@bazinga_geocoder.provider.gmap','@bazinga_geocoder.provider.opencage']

I can see in the profiler that there was a query for gmap but not for opencage.

Thank you.
What does the Google provider return?

zero_results

Are you talking about a ZeroResultException? Are you using the latest version of the bundle? 5,0?

Im not sure what zero_results is. If you using the latest version of the bundle and geocoder. In previous versions there was a zero_results but not in the latest...

So if you debug Chain::reverseQuery() the $result is not empty, correct?

not sure what you asked...

When I call reverseQuery with the chain, it returns me an empty result since the first chain(google) respond with zero_results, however- if I reorder the chain order(first opencage and then gmap) it work

You say:

it returns me an empty result since the first chain(google) respond with zero_results

What is zero_results? There is nothing I know that is called zero_results. :/

I know this PR has been sitting for about a year. Please come back with a possible fix or workaround.