在Android中查找位置类型 [英] Find the type of a location in Android

查看:48
本文介绍了在Android中查找位置类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

鉴于我有一组位置坐标.我如何找到那个地方的类型".例如.我可以说这个地方是餐馆,咖啡馆或购物场所.

Given that I have a set of location coordinates. How can I find the 'type' of that place. Eg. Can I say that the place is a restaurant or cafe or shopping.

这将是Places API可以告诉您附近每个地点的类型的方式.除了我的情况外,我还想要所讨论地点的类型.

It would be the way Places API can tell you the type of each nearby place. Except that n my case, i want the type of the place in question.

谢谢!

推荐答案

您应该能够使用places API做到这一点.从设备获取坐标,然后以纬度/经度和很小的距离(例如,英尺)向Places API发出请求.您可能还应该按距离进行排名,因为默认情况下会突出显示.然后,使用第一个结果,因为它将是您最接近的匹配,然后提取类型.

You should be able to do this with the places API. Get the coordinates from the device, and make a request to the Places API with the latitude/longitude, and a very small distance (say, a matter of feet). You should probably also rank by distance, as prominence is default. Then, use the first result, as it will be your closest match, and extract the type.

https://developers.google.com/places/documentation/search#PlaceSearchRequests

这篇关于在Android中查找位置类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆