Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
308 views
in Technique[技术] by (71.8m points)

android - Given GPS coordinates, how do I find nearby landmarks or points-of-interest?

I just bought a Google Nexus One smartphone, and I want to write a small Android application for fun. Suppose I can get my current GPS coordinates, so then how can I programmatically find nearby landmarks or points-of-interest within some radius? Is there an API to get GPS geo-tagged landmarks, like in Google Earth's database?

For example, if I'm in downtown Chicago, my program would point me to all the "tourist" things to visit in that city.

Ideally, it would all run on my smartphone, but if necessary, I can have the smartphone query a webserver, which would then run more queries.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Depends where you're getting your landmark data from. If you want to do a web query, you could run with one of the things above.

Alternatively - if you have your own data, you can stash it in the db with lat and lon values and then form bounding rectangle for a query. This Question tells you how to calculate a bounding box that covers a given radius around your current point (it will be a box, so it will be bigger than a circle....

How to calculate the bounding box for a given lat/lng location?

Using the bounding box, you can now do a query from your db where lat < maxlat and lat > minlat and lon > minlon and lon < maxlon which will give you all your points of interest within the box.

Then, using the Location class in the Android api, you can get it to calculate the bearing and distance to each of the hits and then you could for instance, sort by radius from your position.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...