def _convert_node_attr_types(G, node_type):
    """
    Convert graph nodes' attributes' types from string to numeric.

    Parameters
    ----------
    G : networkx.MultiDiGraph
        input graph
    node_type : type
        convert node ID (osmid) to this type

    Returns
    -------
    G : networkx.MultiDiGraph
    """
    for _, data in G.nodes(data=True):

        # convert node ID to user-requested type
        data["osmid"] = node_type(data["osmid"])

        # convert numeric node attributes from string to float
        for attr in {"elevation", "elevation_res", "lat", "lon", "x", "y"}:
            if attr in data:
                data[attr] = float(data[attr])

    return G