-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Pelias] custom address fields #1203
base: master
Are you sure you want to change the base?
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
… wherever possible This change does not affect the way this provider behaves, it's only syntactic sugar.
@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: |
In For instance: /**
* @link https://github.com/pelias/documentation/blob/master/result_quality.md#confidence Confidence score
* @var float|null
*/
private ?float $confidence = null; |
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.