| Finding coordinates of route segments
For some time I've tried to find a way to find the coordinates of the staring point of route segments. I want to be able to sent these coordinates to my basic garmin GPS. I've written code that sends the points of a polyline to my GPS. But I always have to trace a route by hand because MapPoint only returns the middle of a route segment and not the start. Your article gave me hope by using the extrapolation technique I thought I would be able to find the starting points of all the route segments. This works for strait route segments, but for example on a roundabout this doesn't work anymore. There the middle of the route isn't in the middle of the start and end of the segment. While exploring this technique I came up with a completely different solution. I found out that when you select a route segment, a label with the instruction appears on the map at the start of the segment. I found out that by using the GetPixel or, better the GetBitmapBits, api calls I could analyze the map bitmap and find the location of this label and therefore the starting point of a route segment. There are many disadvantages to this technique. It is slow and the different maps are 'flashing' over the screen. Also I have to improve the technique further because it is not working 100%. But if there are others who are interested in this technique I'd be happy to share it, and maybe together we can further improve it.
Nico Bontenbal
The Netherlands |