Uh oh!
There was an error while loading. Please reload this page.
[Pelias] custom address fields - #1203
Conversation
This is a minor refactor, but can help customization of this provider a lot. By having a separate method for Address instantiation one might easily override what fields from Pelias make into the output
This change introduces a new address type for pelias. This exposes the following properties from the pelias feature: - layer - confidence - source - match_type - accuracy These values can be very useful when deciding if the result is accurate enough or not.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
… wherever possible This change does not affect the way this provider behaves, it's only syntactic sugar.
mrbig
commented
Oct 26, 2023
@jbelien I have implemented the changes suggested by @norkunas. Could you point me to the documentation that I should update? I've included documentation in the code itself, I realize that might not be sufficient. The fields I have added are always returned to my knowledge. They describe what data source was used, how accurate that data source is considered, could it find the exact location or it did some kind of interpolation. Our use case: |
jbelien
commented
Oct 27, 2023
In For instance: /** * @link https://github.com/pelias/documentation/blob/master/result_quality.md#confidence Confidence score * @var float|null */private ?float $confidence = null; |
mrbig
commented
Nov 7, 2023
Hi @jbelien do you need any other change on this PR? |
Pelias is an open source modular geocoder. It support several data sources and tries to find the best match for each query. Unfortunately a lot of this information is hidden in PHP Geocoder. This PR will expose the most important fields through an extended PeliasAddress class.
The solution is similar to the GoogleMaps provider's GoogleAddress, I have also included the with... methods although currently they are not in use.
The change also includes a minor refactor in the provider that leads to better extendability if one would want to override how the results are parsed into addresses.