scale_nav

scalenav.scale_nav.add_geom(grid, crs='EPSG:4326')

Add the geometries of the cells to a data frame projected on the H3 grid. Using the h3_id column as reference.

Parameters:
  • grid (A data table that contains an 'h3_id' column among others.)

  • crs (default 'epsg:4326'.)

Return type:

A geopandas.GeoDataFrame with a column ‘geom’ containing the geometries of the hexagons.

scalenav.scale_nav.change_res(grid, level=1)

Change scale of a data frame using the H3 hieararchical index. Should any str containing column ( apart from osm_id ) be assumed as a factor ?

Parameters:
  • grid (a pandas.DataFrame or geopandas.GeoDataFrame that contains among others a column named h3_id. To signal columns that contain variables of interest, their name should end with the _var suffix.)

  • decreases. (These variables will be assumed additive and have their values rescaled depending on the transformation (up or down the scale). Every other column will see it's value broadcasted if the resolution increases or the first will be taken if the resolution)

  • level (a positive or negative integer value giving the relative scale change to perform. In other words, the final H3 resolution of the data will be equal to the resolution before change + level. The final resolution should be within {res_lower_limit}-{res_upper_limit}.)

Return type:

A data table that …

scalenav.scale_nav.h3_add_centr(input)

Add centroid coordinates of h3 cell to table. Useful for further spatial operations.

Parameters:

input (Table)

scalenav.scale_nav.set_res(grid, final=8)

Similarly to the change_scale function, but sets the resolution to a specific value.

Parameters:
  • grid (a data frame with h3_id column.)

  • final (the final resolution value desired.)

Return type:

A data table with the desired resolution and data transformations performed.