transbigdata.area_to_grid

transbigdata.area_to_grid(location, accuracy=500, method='rect', params='auto')

Generate the rectangular grids in the bounds or shape

Parameters:
  • location (bounds(List) or shape(GeoDataFrame)) – Where to generate grids. If bounds, [lon1, lat1, lon2, lat2](WGS84), where lon1 , lat1 are the lower-left coordinates, lon2 , lat2 are the upper-right coordinates If shape, it should be GeoDataFrame

  • accuracy (number) – Grid size (meter)

  • method (str) – rect, tri or hexa

  • params (list or dict) – Gridding parameters. See https://transbigdata.readthedocs.io/en/latest/grids.html for detail information about gridding parameters. When Gridding parameters is given, accuracy will not be used.

Returns:

  • grid (GeoDataFrame) – Grid GeoDataFrame, LONCOL and LATCOL are the index of grids, HBLON and HBLAT are the center of the grids

  • params (list or dict) – Gridding parameters. See https://transbigdata.readthedocs.io/en/latest/grids.html for detail information about gridding parameters.