-
Notifications
You must be signed in to change notification settings - Fork 284
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
Add bbox parameter #364
Add bbox parameter #364
Conversation
Signed-off-by: Holger Bruch <[email protected]>
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.
This is really nice! And it LGTM
One comment ...
@@ -132,6 +133,11 @@ http://localhost:2322/api?q=berlin&limit=2 | |||
http://localhost:2322/api?q=berlin&lang=it | |||
``` | |||
|
|||
#### Filter results by bounding box | |||
``` | |||
http://localhost:2322/api?q=berlin&bbox=9.5,51.5,11.5,53.5 |
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.
It would be important to mention which order the bbox has. Maybe we should also use a different order with left,bottom and right,top points ala latSouth,lonWest,latNorth,lonEast
or why did you pick this order?
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.
You are right, this should be documented. Concerning the order: to me this was the one I‘m used to, but Nomination and Overpass both use a different order.
Should I change it?
And before merging, I should add a verification of the lat/lon limits.
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.
Should I change it?
Up, not necessary. I confused the APIs ;)
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.
Did you change the order now? Because I read from the code below that you expect <minLon, maxLon, minLat, maxLat>. My preference would be as documented: <minLon,minLat,maxLon,maxLat>. (Or to be precise: <x1,y1,x2,y2>, Envelope() does not seem to care if it is min,max or max,min.)
Just to mention it, the odd boundingbox format of Nominatim is only used for output. The viewbox input parameter also expects <minLon,minLat,maxLon,maxLat>.
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.
As you have a preference then we should do x1,y1,x2,y2
Signed-off-by: Holger Bruch <[email protected]>
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.
Stupid question: how does this work well together with the location bias? Anything strange we should warn about in the docs?
@@ -132,6 +133,11 @@ http://localhost:2322/api?q=berlin&limit=2 | |||
http://localhost:2322/api?q=berlin&lang=it | |||
``` | |||
|
|||
#### Filter results by bounding box | |||
``` | |||
http://localhost:2322/api?q=berlin&bbox=9.5,51.5,11.5,53.5 |
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.
Did you change the order now? Because I read from the code below that you expect <minLon, maxLon, minLat, maxLat>. My preference would be as documented: <minLon,minLat,maxLon,maxLat>. (Or to be precise: <x1,y1,x2,y2>, Envelope() does not seem to care if it is min,max or max,min.)
Just to mention it, the odd boundingbox format of Nominatim is only used for output. The viewbox input parameter also expects <minLon,minLat,maxLon,maxLat>.
Should work with it. E.g. it should be still possible to have a bias inside a bounding box. |
Closing in favour of #421. |
Introduce a bbox to filter results contained in a given bounding box as suggested by #268.