geo6 / geocoder-php-spw-provider

:belgium: Geocoder Service Public de Wallonie adapter - Coverage: Wallonia (Belgium)
MIT License
3 stars 1 forks source link

SPW webservice returning "ALL CAPS" results #8

Open ici-be opened 3 years ago

ici-be commented 3 years ago

Unfortunately, the results from http://geoservices.wallonie.be/geolocalisation/doc/ws/index.xhtml (SPW geolocation API) are returned in ALL CAPS.

This leads to inconsistency with results from Flanders and Brussels, and the other geocoder-php providers. I'll ask geoservices.wallonie.be if they can remove these caps... fingers crossed, but i guess it could take a long time.

I've also been looking for a workaround... and would be happy to work on a PR if you agree with the solution. It would imply to make a second query, with the ArcGIS REST API of the PICC_VDIFF/Address layer.

Example
1) Existing query gives 83 CHAUSSÉE DE CHARLEROI, 6061 MONTIGNIES-SUR-SAMBRE 2) Second Query: https://geoservices.wallonie.be/arcgis/rest/services/TOPOGRAPHIE/PICC_VDIFF/MapServer/1/query?where=CODEPOSTAL%3D%276061%27+AND+UPPER(RUE_NOM)%3D%27CHAUSS%C3%89E+DE+CHARLEROI%27+AND+NUMERO%3D%2783%27&outFields=*&returnGeometry=true&outSR=&returnIdsOnly=false&returnCountOnly=false&f=geojson gives "Chaussée de Charleroi", "Montignies-sur-Sambre" and both lat/lon in WGS84 and Lambert72

jbelien commented 3 years ago

Hello @ici-be ,

I completely agree with you about the poor formatting of addresses in SPW API. I believe SPW geocoding API is not using PICC or ICAR databases (even though I don't have real proof).

That being said I don't think integrating a second query in this provider is a valid solution. The Geocoder PHP providers are meant to be a layer built on top of a single API.

I really like your idea to use PICC ArcGIS Rest API to get "more" information but I would build that on top of this provider and not "inside" it.