# how to request places within given radius?

• 2012-04-07, 16:32
how to request places within given radius?
Hi
I have my current coordinates and a radius, how to request places within given radius using RESTFul API?
thanks
• 2012-04-12, 09:40
jasfox
Re: how to request places within given radius?
You can specify a search within a given viewport, by adding a an [B]X-Map-Viewport[/B] Header.

[CODE]X-Map-Viewport 13.39,52.51,13.41,52.54[/CODE]
And this URL ( note the lack of [B]at[/B] parameter)
[CODE]
http://demo.places.nlp.nokia.com/places/v1/discover/explore?tf=plain&pretty=y&size=10&app_id=demo_qCG24t50dHOwrLQ&app_code=NYKC67ShPhQwqaydGIW4yg[/CODE]

You will get the results within a given box, which is more typical for display on a map.

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:

[url]http://www.johndcook.com/lat_long_details.html[/url]

For a simple calculation, 1 nautical mile = 1/60th degree latitude at the equator = approx. 6000ft = 1.852km = 1.151 miles
• 2012-04-12, 10:19
danielmoor
Re: how to request places within given radius?
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 [B]explicit location context[/B] (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 [B]implicit location contexts[/B]:
| * 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:
[url]http://api.maps.nokia.com/en/restplaces/documentation.html#location[/url]

and here:

Best,
daniel.
• 2012-04-13, 22:00
Re: how to request places within given radius?
Hi

Daniel, are you planning to support radius search as it google does for example?
the use case is AR application, btw

thanks,