title: networkx ego_graph apply to geopandas series speed-up
body: <p>Having <code>GeoSeries</code> of around 100000 locations, I have a working code for calculating <code>Polygons</code>  of walking  accessibility from each location as a center.</p>
  
  <p>The code does calculations over <code>networkx</code> graph, obtained from <code>OpenStreeMaps</code> via <code>osmnx</code> by <code>apply</code> to  <code>GeoDataFrame</code>.</p>
  
  <p>I am trying to speed up calculation, as that is incredibly slow.</p>
  
  <p><code>G</code> - is a <code>networkx</code> graph</p>
  
  <pre><code># create graph walking_time edge property
  
  walking_speed = 4.5 #km/h
  walking_speed_m_minute = walking_speed * 1000 / 60 #km/h to m/min
  for u, v, k, data in G.edges(data=True, keys=True):
      data['walking_time'] = data['length'] / walking_speed_m_minute
  </code></pre>
  
  <p>This is the func I <code>apply</code> to <code>GeoDataFrame</code>:</p>
  
  <pre><code>def calculate_time_accessibility_polygon(row, trip_time):
      # location x,y
      y = row['latitude']
      x = row['longitude']
      # find nearest node on the graph
      center_node = ox.get_nearest_node(G, (y, x))
      subgraph = nx.ego_graph(G, center_node, radius=trip_time, 
  distance='time')
      node_points = [Point((data['x'], data['y'])) for node, data in 
  subgraph.nodes(data=True)]
      bounding_poly = gpd.GeoSeries(node_points).unary_union.convex_hull
      return(bounding_poly)
  </code></pre>
  
  <p>I apply with the following line of code:</p>
  
  <pre><code>gdf.apply(calculate_time_accessibility_polygon, args=(15,), axis=1))
  </code></pre>
  
  <p>Thank you!!!</p>