title: Add a category variable that gives a unique id for each segment of 10m of each street
body: <p>I have a big csv that contains this informations of trip data for each point in 1s interval: lon, lat, timestamp and street_id.
  My aim is to segment street to 10m long segments and assign a unique segment id to each point based on its position.</p>
  <p>Here is an example of what my data looks like using <code>df.head()</code>:</p>
  <pre><code>    timestamp           Lat       Lon       street_id
  0   4/1/2014 0:11:00    40.7690   -73.9549  140
  1   4/1/2014 0:17:00    40.7267   -74.0345  50
  </code></pre>
  <p>I'm using goepandas as follows to get a spatial dataframe:</p>
  <pre class="lang-py prettyprint-override"><code>from geopandas import GeoDataFrame
  from shapely.geometry import Point
  
  geometry = [Point(xy) for xy in zip(df.Lon, df.Lat)]
  df = df.drop(['Lon', 'Lat'], axis=1)
  gdf = GeoDataFrame(df, crs=&quot;EPSG:4326&quot;, geometry=geometry)
  </code></pre>
  <p>I just dont know how to begin, I know I have to group by street_id then calculate the distance between each point and the begining of the street, but Ive failed to find how to find how to do so</p>
  <p>The expected result should look like:</p>
  <pre><code>    timestamp           Lat       Lon       street_id segment_id
  0   4/1/2014 0:11:00    40.7690   -73.9549  140          5
  1   4/1/2014 0:17:00    40.7267   -74.0345  50           1
  </code></pre>
  <p>Segment_id should be a unique identifier for each street segment of 10m long</p>