def __init__(self, id, in_node, out_node): self.id = id self.in_node = in_node self.out_node = out_node self.bearing = spatialfunclib.path_bearing( in_node.latitude, in_node.longitude, out_node.latitude, out_node.longitude ) self.length = spatialfunclib.distance( in_node.latitude, in_node.longitude, out_node.latitude, out_node.longitude ) self.cluster = None
def __init__(self, id, in_node, out_node): self.id = id self.in_node = in_node self.out_node = out_node self.bearing = spatialfunclib.path_bearing(in_node.latitude, in_node.longitude, out_node.latitude, out_node.longitude) self.length = spatialfunclib.distance(in_node.latitude, in_node.longitude, out_node.latitude, out_node.longitude) self.cluster = None
def _distance_coords(self, location1_latitude, location1_longitude, location2_latitude, location2_longitude): return spatialfunclib.distance(location1_latitude, location1_longitude, location2_latitude, location2_longitude)
def _distance(self, location1, location2): return spatialfunclib.distance(location1.latitude, location1.longitude, location2.latitude, location2.longitude)
def length(self): return spatialfunclib.distance( (self.in_node.latitude, self.in_node.longitude), (self.out_node.latitude, self.out_node.longitude))
def length(self): return spatialfunclib.distance(self.in_node.latitude, self.in_node.longitude, self.out_node.latitude, self.out_node.longitude)