def transform_projection(G, to_crs='epsg:4326'):
    """
    change the coordinate projection of Shapely "geometry" attributes in edges
    and nodes in the graph
    """
    from functools import partial
    try:
        from shapely.ops import transform
        import pyproj
    except ImportError:
        raise ImportError('pyproj and shapely modules needed. get them here: ',
            'https://pypi.org/project/pyproj/, https://pypi.org/project/Shapely/'
            )
    st_plane = pyproj.Proj(G.graph['crs'], preserve_units=True)
    wgs = pyproj.Proj(init=to_crs)
    project = partial(pyproj.transform, st_plane, wgs)
    for u, v, geometry in G.edges(data='geometry'):
        if geometry:
            G[u][v]['geometry'] = transform(project, geometry)
    for n, geometry in G.nodes(data='geometry'):
        if geometry:
            G.node[n]['geometry'] = transform(project, geometry)
    G.graph['crs'] = to_crs
