title: Calculate all distances between two GeoDataFrame (of points) in GeoPandas
body: <p>This is quite simple case, but I did not find any easy way to do it so far. The idea is to get a set of distances between all the points defined in a <code>GeoDataFrame</code> and the ones defined in another <code>GeoDataFrame</code>.</p>
  <pre class="lang-py prettyprint-override"><code>import geopandas as gpd
  import pandas as pd
  
  # random coordinates
  gdf_1 = gpd.GeoDataFrame(geometry=gpd.points_from_xy([0, 0, 0], [0, 90, 120]))
  gdf_2 = gpd.GeoDataFrame(geometry=gpd.points_from_xy([0, 0], [0, -90]))
  print(gdf_1)
  print(gdf_2)
  
  #  distances are calculated elementwise
  print(gdf_1.distance(gdf_2))
  </code></pre>
  <p>This produces the element-wise distance between points in <code>gdf_1</code> and <code>gdf_2</code> that share the same index (with also a warning because the two GeoSeries do not have the same index, which will be my case).</p>
  <pre><code>                geometry
  0    POINT (0.000 0.000)
  1   POINT (0.000 90.000)
  2  POINT (0.000 120.000)
                      geometry
  0    POINT (0.00000 0.00000)
  1  POINT (0.00000 -90.00000)
  /home/seydoux/anaconda3/envs/chelyabinsk/lib/python3.8/site-packages/geopandas/base.py:39: UserWarning: The indices of the two GeoSeries are different.
    warn(&quot;The indices of the two GeoSeries are different.&quot;)
  0      0.0
  1    180.0
  2      NaN
  </code></pre>
  <p>The question is; how is it possible to get a series of all points to points distances (or at least, the unique combinations of the index of <code>gdf_1</code> and <code>gdf_2</code> since it is symmetric).</p>
  <h2>EDIT</h2>
  <ul>
  <li><p>In <a href="https://stackoverflow.com/questions/63722124/get-distance-between-two-points-in-geopandas">this post</a>, the solution is given for a couple of points; but I cannot find a straightforward way to combine all points in two datasets.</p>
  </li>
  <li><p>In <a href="https://gis.stackexchange.com/questions/293310/how-to-use-geoseries-distance-to-get-the-right-answer/293319">this post</a> only element-wise operations are proposed.</p>
  </li>
  <li><p>An analogous question was also raised <a href="https://github.com/geopandas/geopandas/issues/673" rel="nofollow noreferrer">on the GitHub repo of geopandas</a>. One of the proposed solution is to use the <code>apply</code> method, without any detailed answer.</p>
  </li>
  </ul>