shapelib/core.py
def line_angle_at(line, point, h=0.001):
    """
    return the angle of `line` at the `point` given. I

    If point is not in the line, return the angle at the
    nearest point within the line.
    """
    point = Point(*_normalize_point(point))
    if not line.intersects(point):
        point = nearest_point(line, point)
    bufdist = min(line.length, h)
    c = point.buffer(bufdist).exterior
    points = c.intersection(line)
    if isinstance(points, Point):
        # only one intersection, point is one of the extremes
        a = points
        b = line.intersection(point.buffer(bufdist*2).exterior)
        if not isinstance(b, Point):
            b = b[0]
    else:
        assert len(points) == 2
        a, b = points
    return angle_from_points(a.centroid, b.centroid)

    return the angle of `line` at the `point` given. I

    If point is not in the line, return the angle at the
    nearest point within the line.
    
return the angle of `line` at the `point` given. I
If point is not in the line, return the angle at the
nearest point within the line.
return the angle of ` line ` at the ` point ` given . I If point is not in the line return the angle at the nearest point within the line .
def line_angle_at(line, point, h=0.001):
    point = Point(*_normalize_point(point))
    if not line.intersects(point):
        point = nearest_point(line, point)
    bufdist = min(line.length, h)
    c = point.buffer(bufdist).exterior
    points = c.intersection(line)
    if isinstance(points, Point):
        a = points
        b = line.intersection(point.buffer(bufdist*2).exterior)
        if not isinstance(b, Point):
            b = b[0]
    else:
        assert len(points) == 2
        a, b = points
    return angle_from_points(a.centroid, b.centroid)
def line_angle_at ( line , point , h = 0.001 ) : point = Point ( * _normalize_point ( point ) ) if not line . intersects ( point ) : point = nearest_point ( line , point ) bufdist = min ( line . length , h ) c = point . buffer ( bufdist ) . exterior points = c . intersection ( line ) if isinstance ( points , Point ) : a = points b = line . intersection ( point . buffer ( bufdist * 2 ) . exterior ) if not isinstance ( b , Point ) : b = b [ 0 ] else : assert len ( points ) == 2 a , b = points return angle_from_points ( a . centroid , b . centroid )
return the angle of `line` at the `point` given.
return the angle of ` line ` at the ` point ` given .
"""
    return the angle of `line` at the `point` given. I

    If point is not in the line, return the angle at the
    nearest point within the line.
    """ # only one intersection, point is one of the extremes
line
point
h