title: How to interpolate points (lon, lat) into the multidigraph generated by osmnx function graph_from_xxx?
body: <p>I read the article <a href="https://towardsdatascience.com/connecting-pois-to-a-road-network-358a81447944" rel="nofollow noreferrer">Connecting and interpolating POIs to a road network</a> which may solve this problem; but face the same problem posed as follows:</p>
  <blockquote>
  <p>However, we often gather data from different sources and need to
  integrate them manually. The process is actually a bit more
  complicated than I had imagined.</p>
  </blockquote>
  <p>I downloaded the codes and already made the function <em>connect_poi</em> from toolbox working.
  However, both the demo provided by the author and my own codes missing the u and v value for the new_edges (output of connect_poi) which results in the problem of <strong>cannot</strong> merge new graph with function <code>graph_from_gdfs</code> provided by osmnx. How to solve this? Thanks a lot.</p>
  <pre><code>def connect_poi(pois, nodes, edges, key_col=None, path=None, threshold=200, knn=5, meter_epsg=3857):
  
  Connect and integrate a set of POIs into an existing road network.
  
  Given a road network in the form of two GeoDataFrames: nodes and edges,
  link each POI to the nearest edge (road segment) based on its projection
  point (PP) and generate a new integrated road network including the POIs,
  the projected points, and the connection edge.
  
  Args:
      pois (GeoDataFrame): a gdf of POI (geom: Point)
      nodes (GeoDataFrame): a gdf of road network nodes (geom: Point)
      edges (GeoDataFrame): a gdf of road network edges (geom: LineString)
      key_col (str): a unique key column of pois should be provided,
                     e.g., 'index', 'osmid', 'poi_number', etc.
                     Currently, this will be renamed into 'osmid' in the output.
                     [NOTE] For use in pandana, you may want to ensure this
                            column is numeric-only to avoid processing errors.
                            Preferably use unique integers (int or str) only,
                            and be aware not to intersect with the node key,
                            'osmid' if you use OSM data, in the nodes gdf.
      path (str): directory path to use for saving files (nodes and edges).
                    Outputs will NOT be saved if this arg is not specified.
      threshold (int): the max length of a POI connection edge, POIs with
                       connection edge beyond this length will be removed.
                       The unit is in meters as crs epsg is set to 3857 by
                       default during processing.
      knn (int): k nearest neighbors to query for the nearest edge.
                 Consider increasing this number up to 10 if the connection
                 output is slightly unreasonable. But higher knn number will
                 slow down the process.
      meter_epsg (int): preferred EPSG in meter units. Suggested 3857 or 3395.
  
  Returns:
      nodes (GeoDataFrame): the original gdf with POIs and PPs appended
      edges (GeoDataFrame): the original gdf with connection edges appended
                            and existing edges updated (if PPs are present)
  
  Note:
      1. Make sure all three input GeoDataFrames have defined crs attribute.
         Try something like `gdf.crs` or `gdf.crs = 'epsg:4326'`.
         They will then be converted into epsg:3857 or specified meter_epsg for processing.
  </code></pre>
  <pre><code>---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  Input In [37], in &lt;cell line: 6&gt;()
        3 print(new_edges.index)
        4 # print(new_nodes.values)
  ----&gt; 6 G = ox.graph_from_gdfs(new_nodes, new_edges, graph_attrs=G.graph)
  
  File ~\anaconda3\envs\ox\lib\site-packages\osmnx\utils_graph.py:168, in graph_from_gdfs(gdf_nodes, gdf_edges, graph_attrs)
      165 # add edges and their attributes to graph, but filter out null attribute
      166 # values so that edges only get attributes with non-null values
      167 attr_names = gdf_edges.columns.to_list()
  --&gt; 168 for (u, v, k), attr_vals in zip(gdf_edges.index, gdf_edges.values):
      169     data_all = zip(attr_names, attr_vals)
      170     data = {name: val for name, val in data_all if isinstance(val, list) or pd.notnull(val)}
  
  TypeError: cannot unpack non-iterable int object
  </code></pre>