geolime.operations.grid.utils

Classes:

BlockModel(data, metadata)

Proj(projparams, preserve_units, **kwargs)

Performs cartographic transformations.

Functions:

coord_to_lat_lon(bm[, proj_in])

Take x,y,z column of dataframe and convert x/y to latitude/longitude in two new columns proj_in by default is Lambert 93 out_proj (espg:4326) corresponds to lat/lon official reference

df_xy_to_arr2d(bm[, attribute])

Take x,y,z column of bm to make a 2D array, with attribute as values.

transform(p1, p2, x, y[, z, tt, radians, …])

New in version 2.1.2: skip_equivalent

geolime.operations.grid.utils.coord_to_lat_lon(bm: geolime.objects.blockmodel.BlockModel, proj_in='epsg:2154')

Take x,y,z column of dataframe and convert x/y to latitude/longitude in two new columns proj_in by default is Lambert 93 out_proj (espg:4326) corresponds to lat/lon official reference

Parameters
  • bm (BlockModel) – GeoLime BlockModel object

  • proj_in (str, optionnal) – Original EPSG of the project, Lambert 93 by default(FRANCE)

Returns

img_2d – 2d Array filled by attribute values.

Return type

(M, N) ndarray

geolime.operations.grid.utils.df_xy_to_arr2d(bm: geolime.objects.blockmodel.BlockModel, attribute: str = 'x')

Take x,y,z column of bm to make a 2D array, with attribute as values.

Parameters
  • bm (Grid2d) – GeoLime 2 dimensions BlockModel object

  • attribute (str,optionnal) – Name of a column of the dataframe taken to fill the array, if not specified, ‘x’ by default

Returns

img_2d – 2d Array filled by attribute values.

Return type

(M, N) ndarray

Example

>>> bm.df
   x  y  attribute
0  0  0          1
1  0  1          1
2  0  2          1
3  1  0          1
4  1  1          1
5  1  2          1
6  2  0          1
7  2  1          1
8  2  2          1
>>> img_2d = df_xy_to_arr2d(bm, attribute)
>>> img_2d
array([[1, 1, 1],
       [1, 1, 1],
       [1, 1, 1]])