def coordinates(g, nodes):
    """
    Extract (lon, lat) coordinate pairs from nodes in an osmgraph

    osmgraph nodes have a 'coordinate' property on each node. This is
    a shortcut for extracting a coordinate list from an iterable of nodes

    >>> g = osmgraph.parse_file(filename)
    >>> node_ids = g.nodes()[:3]  # Grab 3 nodes
    [61341696, 61341697, 61341698]
    >>> coords = coordinates(g, node_ids)
    [(-71.0684107, 42.3516822),
     (-71.133251, 42.350308),
     (-71.170641, 42.352689)]


    Parameters
    ----------
    g : networkx graph created with osmgraph
    nodes : iterable of node ids

    Returns
    -------
    List of (lon, lat) coordinate pairs

    """
    c = [g.nodes[n]["coordinate"] for n in nodes]
    return c