is it possible to get distance between current location and a street, avenue or area?
<p>all solutions about calculating distance are between two points.
my question is:
Is there any way to calculate the distance to a certain street?</p>

<p>suppose I want to calculate a distance from my location to a specific area or avenue, which have many streets to get there, in this case how to know the nearest street to me to get there?</p>

<p>here I have only one point (my location) while the destination point is variant and depends on my current location. what I know about destination is in a certain street or area, so how to calculate it?</p>

<p>another case for this issue, suppose I am away 10 meters from a certain street which is 1 km long.
I should be able to calculate that my distance is 10 meters from the beginning of that street, after this distance when enter the street, and for each meter I waked for 1 km it should be 0 meter distance from my location to this street, and when I exit it from the other side the distance should be calculating again from the end point of that street not from the beginning point, so when I get away from it about 5 meters it should calculate it as 5 meters not as 1005 meters.</p>

<hr>

<p>Here is the requirement by example on google maps:</p>

<p>first let's see <a href="https://www.google.com/maps/dir/40.7052323,-74.0074383/40.707155,-74.0107727/@40.7061093,-74.0094159,17.53z/data=!4m2!4m1!3e2" rel="noreferrer">Wall Street in NY city</a> on map.</p>

<p><a href="https://i.stack.imgur.com/zcJxL.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zcJxL.png" alt="enter image description here"></a></p>

<p>So the target destination is Wall Street.
Now if your current location in the cross of John Street with Water Street, my task is to lead you to the nearest point in Wall Street and the path will be as <a href="https://www.google.com/maps/dir/40.7068884,-74.0050023/40.7052537,-74.0075128/@40.706165,-74.0084484,17z/data=!3m1!4b1!4m2!4m1!3e2" rel="noreferrer">this one</a> (walk mode).</p>

<p><a href="https://i.stack.imgur.com/1JJjK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/1JJjK.png" alt="enter image description here"></a></p>

<p>however if you are in the cross of Broad Street with Beaver Street then the destination to nearest point in Wall Street will be <a href="https://www.google.com/maps/dir/40.704963,-74.0115765/40.7070807,-74.0106125/@40.7052671,-74.0119824,18.75z/data=!4m2!4m1!3e2" rel="noreferrer">like this one</a> (walk mode):</p>

<p><a href="https://i.stack.imgur.com/VfJP7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VfJP7.png" alt="enter image description here"></a></p>

<p>this is my issue</p>

<hr>

<p>is it possible? Do new APIs offer a solution for this?</p>

<p>any solutions or ideas?</p>