I want to draw a line or polyline within a map and figure out the street numbers where this line crosses a road (within a radius of a few metres from this crossing point). Maybe there's someone who's got an idea - I've got no one.
This is a discussion on get street numbers of crossing lines within the MapPoint Desktop Discussion forums, part of the Map Forums category; I want to draw a line or polyline within a map and figure out the street numbers where this line ...
I want to draw a line or polyline within a map and figure out the street numbers where this line crosses a road (within a radius of a few metres from this crossing point). Maybe there's someone who's got an idea - I've got no one.
Hi,
Looks easy. You know starting point and end point. Find addrss restults every 10 meter on the line. Streets are normlly wider so this resolution must go.
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
... every 10 meter on the line...
thank you for suggestion, - something like this was on my mind, but it failed by this point. I've got the start and end as geographical coordinates and don't know how to go along this line...
regards
martin
Hi,
See following drawing:
you know from both points latitude and longitude. Substract them from each other and you know a (delta latitude) and b (delta longitude). First we calculate c (the distance between the points:Code:B / | / | / | / | c / | a / | / | / | /_________________| A b C
Now we calcualte A (the Angle):Code:c := Sqrt(Power(a, 2) + Power(b, 2));
Now the only thing that rest, is calculate a and b in steps of c until we are at the length of c.Code:A := ArcSin(a / c);
So you have to add a and b by the latitude and longitude of the from A and you have the new point on the line.Code:a := Sin(A) * c_step; b := Cos(A) * c_step;
Note that this is from the top of my head and I could mistake here and there. I also did not check these (Delphi) functions for degree or radians because you could have it idfferent in your programming language.
I also think we have to correct longitude for the latitude because this only count on the equator. Someone has a better view on this ? When I have some spare time I want to check, but difficult at the moment.
I hope this let you in the right direction![]()
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
Thank you very much, - of course it's a simple math function. I was thinking about formulas for eliptical bodys an so and had forgotten that I can neglect that for the short of the distance.
Sometimes there are knots in my head.
regards
martin
Hi,
Sometime a solution is very simple. Ofthen we think too complicatied
I'm glad it helped.
rgds, Wilfried Mestdagh
www.mestdagh.biz
www.comfortsoftware.be
www.expertsoftware.be
MapPoint coding demo
MapPoint 2011 available, buy now
There are currently 1 users browsing this thread. (0 members and 1 guests)