Is it interesting to add a possibility to search for elements contained in a region by giving the BYBOX parameter a unit in degree (in addition to the metrics) ?
This would make the following modification in the syntax (with the ° added):
GEOSEARCH key [FROMMEMBER member] [FROMLONLAT longitude latitude] [BYRADIUS radius m|km|ft|mi|°] [BYBOX width height m|km|ft|mi|°] [ASC|DESC] [COUNT count [ANY]] [WITHCOORD] [WITHDIST] [WITHHASH]
Then i could express a region by the same FROMLONLAT longitude latitude center, and express a width and a height in degrees, not in meters. An example with a BOX having 7° for the width and 30° for the height:
GEOSEARCH mykey FROMLONLAT lng1 lng2 BYBOX 7 30 °
Comment From: githubfr
GEOSEARCH key [FROMMEMBER member] [FROMLONLAT longitude latitude] [BYRADIUS radius m|km|ft|mi|°] [BYBOX width height m|km|ft|mi|°] [ASC|DESC] [COUNT count [ANY]] [WITHCOORD] [WITHDIST] [WITHHASH]
Comment From: oranagra
@githubfr is there any application in which this is really useful? FROMLONLAT makes a lot of sense (there's actually no other way to provide a location). But when you wanna limit the results distance, you give radius in meters. And the bybox use case is when an app, like maps, which have a viewport that's usually projected to meters, wants only the results that fit in the viewport. I'm not sure in which case your box would be in lon/lat..
Comment From: githubfr
Thank you Oranagra for your answer. You have detected the use I would like to make of it indeed. So i explain the context : It is an application with a map on IOS (MKMapView). I thought it was a fairly common use, and the geographical positions are often linked to a map anyway. In computer science i have seen that often "georectangles" are defined by their coordinates (coordinate bottomLeft, coordinate topRight or the other pair).
Comment From: oranagra
@githubfr but in your map application, i assume you wanna search for elements that fit within the user's viewport. and isn't your viewport a projected rectangle with width and height in meters? note that converting a rectangle that's in meters to lon/lat doesn't produce a rectangle, it produces a trapezoid, and what's worse it's one with dented edges.
Comment From: githubfr
Your arguments have totally convinced me. Moreover, i have read geo.c and geohashes actually identifies regions (rectangular cells). In fact, for information, the Region property of the Mkmapview (IOS project) is indeed what is used to get the width and height parameters i need for the GEOSEARCH command. It is the area currently displayed by the map view (a lat/lng center, a width in meters, a height in meters). So the proposal is not appropriate. thank you very much for your help.