[Photon] Reverse Geocoding with query filters#1195
[Photon] Reverse Geocoding with query filters#1195jbelien merged 15 commits intogeocoder-php:masterfrom
Conversation
jbelien
left a comment
There was a problem hiding this comment.
Hello @ybert ,
Thanks a lot for your contribution.
I've looked a bit for documentation about query_string_filter but couldn't find anything. After a bit more research, I've found komoot/photon#703 (comment).
I see you've commented this issue but it seems that that filter was not really intended to be implemented and might be removed.
In theory we have the query_string_filter parameter for reverse which got sneaked in in komoot/photon#254. It should be able to do arbitrary filtering including the one you want. However, this was never documented and I very much prefer to let it die quietly and implement the tag filters from search instead.
I would prefer not to implement this feature in our provider (because we will have to remove it at some point which will create a breaking change) and instead implement osm_tag for the search (and the reverse geocoding once implemented).
|
Ok, I undersand your position. I will see if I have time to propose a PR for osm_tag on the Photon repository. |
Awesome work! 👍
Of course, you can definitely already update this PR (or close this PR and open a new one if you prefer). |
97511a5 to
71a1a8e
Compare
|
I just added osm tag feature for both geocode and reverse queries. You can easily combine multiple osm tag filters like this : $provider = new Geocoder\Provider\Photon\Photon($httpClient, 'https://your-photon-root-url');
$reverseQuery = \Geocoder\Query\GeocodeQuery::create('Paris')
->withData('osm_tag', ['tourism', ':!museum'])
->withLimit(5);
// Here we get 5 tourism results in Paris which are not museums
$results = $provider->reverseQuery($reverseQuery);If it is ok for you I think we can safely release it as the feature has been released on Photon here https://github.com/komoot/photon/releases/tag/0.4.3 |
|
@jbelien Any chance to merge this PR ? |
|
@jbelien Can we make a new release for the Photon provider to make these changes available ? |
Sure! But you need to merge your PR first! 😉 |
|
@jbelien How can I merge this PR ? I think I don't have write access. |
|
@jbelien Let me know if there is anything I can do to get it merged ? |
|
@ybert My apologies, you indeed don't have the write to merge that PR. Taking care of it right now. |
It can be usefull to search precise data from osm when we do reverse geocoding.
For example it can help to search only osm places (locality, city) from a location (latitude, longitude)