def edgepoints_from_network(network, attribute=False):
    """
    Obtains a list of projected points which are midpoints of edges
    
    Parameters:
        network: a network with/without attributes
        attribute: boolean
                   if true, one of return values includes attributes for each edge

    Returns:
        id2linkpoints: a dictionary that associates a sequential id to a projected, midpoint of each edge
        id2attr: a dictionary that associates a sequential id to the attributes of each edge
        link2id: a dictionary that associates each edge to its id
    """
    link2id, id2linkpoints, id2attr = {}, {}, {}
    counter = 0
    for n1 in network:
        for n2 in network[n1]:
            if (n1,n2) not in link2id or (n2,n1) not in link2id:
                link2id[(n1,n2)] = counter
                link2id[(n2,n1)] = counter
                if type(network[n1][n2]) != list:
                    half_dist = network[n1][n2]/2 
                else:
                    half_dist = network[n1][n2][0]/2 
                if n1[0] < n2[0] or (n1[0] == n2[0] and n1[1] < n2[1]):
                    id2linkpoints[counter] = (n1,n2,half_dist,half_dist)
                else:
                    id2linkpoints[counter] = (n2,n1,half_dist,half_dist)
                if attribute:
                    id2attr[counter] = network[n1][n2][1:]
                counter += 1
    return id2linkpoints, id2attr, link2id