spaghetti.Network.compute_distance_to_vertices

Network.compute_distance_to_vertices(self, x, y, arc)[source]

Given an observation on a network arc, return the distance to the two vertices that bound that end.

Parameters
xfloat

x-coordinate of the snapped point.

yfloat

y-coordinate of the snapped point.

arctuple

(vtx0, vtx1) representation of the network arc.

Returns
d1float

The distance to vtx0. Always the vertex with the lesser id.

d2float

The distance to vtx1. Always the vertex with the greater id.