Hi
I have my current coordinates and a radius, how to request places within given radius using RESTFul API?
thanks
Hi
I have my current coordinates and a radius, how to request places within given radius using RESTFul API?
thanks
You can specify a search within a given viewport, by adding a an X-Map-Viewport Header.
Using this header:
And this URL ( note the lack of at parameter)Code:X-Map-Viewport 13.39,52.51,13.41,52.54
You will get the results within a given box, which is more typical for display on a map.Code:http://demo.places.nlp.nokia.com/places/v1/discover/explore?tf=plain&pretty=y&size=10&app_id=demo_qCG24t50dHOwrLQ&app_code=NYKC67ShPhQwqaydGIW4yg
If you need to reduce this to a radius, you'll just need to calculate the corners of the box from your centre point and distance. The mathematics can be seen here:
http://www.johndcook.com/lat_long_details.html
For a simple calculation, 1 nautical mile = 1/60th degree latitude at the equator = approx. 6000ft = 1.852km = 1.151 miles
Last edited by jasfox; 2012-04-12 at 09:42. Reason: minutes, not degrees. The globe is 60 times larger than that.
Hi,
the viewport header is a good way to go.
However, please be aware, that we take this as an indicator of what part of the map the user of your application is looking at. We might serve places that are outside this region in the case that there are some good results just outside of it.
Thus, exact region search is not fully supported yet. Since the API is in development and we will add more features to it, could you tell us more about your use case?
Some more details on the current behaviour:
When trying to serve the best set of places we process several location contexts that you could provide to us.
* We currently support one explicit location context (i.e., the user tapped on the map to explicitly search here) which can be set using the "at" query parameter.
* We currently support two implicit location contexts:
| * The X-Map-Viewport header to indicate which part of the map the user is looking at
| * The Geolocation header to indicate the physical position user as derived from GPS or WiFi sensors
Position values support uncertainty values and an indicator from which sensor the data is coming from.
Additionally you can provide us the X-Mobility-Mode header to indicate if the user is driving, walking or not moving at all.
Documentation on these parameters can be found here:
http://api.maps.nokia.com/en/restpla....html#location
and here:
http://api.maps.nokia.com/en/restpla...pi_ref_headers
Best,
daniel.
Last edited by danielmoor; 2012-04-12 at 10:25.
Daniel Moor
Nokia Places API
Hi
thanks for yer answers
Daniel, are you planning to support radius search as it google does for example?
the use case is AR application, btw
thanks,
Vlad
Hi Vlad,
We are evaluating it.
Do you need to search for a given term or do you want to explore places?
daniel.
Daniel Moor
Nokia Places API