Find the type of a location in Android

2019-07-23 12:57发布

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.

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.

Thanks!

1条回答
孤傲高冷的网名
2楼-- · 2019-07-23 13:30

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

查看更多
登录 后发表回答