-
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
[Photon] Reverse Geocoding with query filters #1195
base: master
Are you sure you want to change the base?
Conversation
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.
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 |
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)