开发者

iOS - GPS position using road map

could somebody help me with a suggestion to get my project off the ground, I don't know where to start. I'd like to tr开发者_开发百科ack my GPS position on a map, add a certain value to the current position, say +100 meters, and have it return the new GPS position information. That's easy enough, but I'd like it to take road direction into account. In other words it returns the GPS coord that I'll be in, 100m from now, on the current road that I'm traveling on. Could anyone help me with where to start or how I can use mapkit to acheive this?

Thanks a lot!


Geez. Well obviously CoreLocation doesn't know anything about street topologies. But there is a utility for converting pin-point map locations into physical street addresses--MKReverseGeocoder. That can turn your latitude and longitude into a street address.

SO, I imagine you could repeatedly reverse geocode your current location, noticing when the street name hasn't changed but the house number has, and correlate the rate of change of house number to the meters of change in your position, and extrapolate the house number you'll be at in 100 meters, and then put a map callout at that address on your map.

It's a tricky little piece of software guesswork. It'll fail at intersections and road-endings, or anywhere else house numbers change unexpectedly (city limits, etc). That's really the only purely on-board way I can think to do this.


One simple way would be to use the compass direction, or just track the direction of travel over time. The drawback is that it would not take into consideration the curvature of the road ahead, but for 100 meters out, perhaps that would be acceptable?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜