openeuropa / webtools-geocoding-provider

Webtools Geocoding provider for Geocoder PHP
European Union Public License 1.2
0 stars 3 forks source link

Currently the provider returns no results #20

Open LOBsTerr opened 1 year ago

LOBsTerr commented 1 year ago

I have debugged it a bit and I found the problem is here:

        if (empty($content->locations)) {
            return new AddressCollection([]);
        }

Currently no locations are returned from the services, we get:

https://europa.eu/webtools/rest/geocoding/?q=rue+de+la+loi+51+1000+BRUSSELS+BE

{"features":[{"geometry":{"coordinates":[4.3729153,50.8444561],"type":"Point"},"type":"Feature","properties":{"osm_id":"6207518564","country":"Belgi\u00eb - Belgique - Belgien","city":"Ville de Bruxelles - Stad Brussel","countrycode":"BE","postcode":"1000","locality":"Quartier europ\u00e9en - Europese Wijk","type":"house","osm_type":"N","osm_key":"place","housenumber":"51","street":"Rue de la Loi - Wetstraat","district":"Bruxelles \/ Brussel","osm_value":"house","state":"R\u00e9gion de Bruxelles-Capitale - Brussels Hoofdstedelijk Gewest"}}],"type":"FeatureCollection"}

Probably, the format was updated at some point. in the official page they actually even using address parameter instead of q

https://europa.eu/webtools/rest/geocoding/?address=Rue%20de%20la%20Loi%2056,%20B-1000%20Bruxelles,%20Belgium

LOBsTerr commented 1 year ago

Since the format has been changes in endpoint we need to adapt the code:

https://github.com/openeuropa/webtools-geocoding-provider/pull/21

LOBsTerr commented 1 year ago

Also, it was suggested to use this end point: https://gisco-services.ec.europa.eu/api?q=Rue%20de%20la%20Loi%2056,%20B-1000%20Bruxelles,%20Belgium