transbigdata.odagg_grid

transbigdata.odagg_grid(oddata, params, col=['slon', 'slat', 'elon', 'elat'], arrow=False, **kwargs)

Aggregate the OD matrix and generate the grid geometry. The input is the OD matrix (each row represents a trip). The OD will assigned to grids and then aggregated in the form of GeoDataFrame.

Parameters:
  • oddata (DataFrame) – OD data

  • col (List) – The column of the origin/destination location,[‘slon’,’slat’, ’elon’,’elat’]. The default weight is 1 for each column. You can also add the weight parameter, for example, [‘slon’, ’slat’,’elon’,’elat’,’count’].

  • params (List) – Gridding parameters (lonStart,latStart,deltaLon,deltaLat), lonStart and latStart are the lower-left coordinates, deltaLon, deltaLat are the length and width of a single grid

  • arrow (bool) – Whether the generated OD geographic line contains arrows

Returns:

oddata1 – GeoDataFrame of OD after aggregation

Return type:

GeoDataFrame