E
E
Emil Revencu2015-12-23 00:10:25
Python
Emil Revencu, 2015-12-23 00:10:25

How to calculate the distance from your coordinates to the street what is in the answer (geopy)?

I use the code to get the address of the point:

from geopy.geocoders import Nominatim
from geopy.distance import vincenty
geolocator = Nominatim()
point1=(44.778374,10.341664)
loc = geolocator.reverse("44.778374,10.341664") #Координаты точки
point2 = (loc.raw['lat'], loc.raw['lon']) #Координаты точки ответа
print vincenty(point1, point2).meters #Получаем растояние

But the distance was calculated from my point to the middle of the street (which is in the answer).
How to calculate the minimum perpendicular distance to the street?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Emil Revencu, 2015-12-23
@Revencu

Let me put the question differently: how to calculate the distance to the nearest street from your coordinates?
Using the module "geopy" I get the name of the street (nearest), as well as the coordinates of the middle of this street

A
abcd0x00, 2015-12-23
@abcd0x00

The distance from a point to a straight line is sought by a well-known formula.
www.pm298.ru/reshenie/tochpr.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question