standardize_fr.bdalti#

standardize_fr.bdalti(data, *, to_file=False)[source]#

Standardize the DEM data from IGN’s ALTI Database (https://geoservices.ign.fr/bdalti):

  • merge tiles

  • georeference (embed CRS = 2154, standardize _FillValue, grid_mapping and time)

  • replace nodata values (-99999.0) with np.nan

Parameters#

data(list of) str or pathlib.Path, or variable (xarray.Dataset or xarray.DataArray)

data is usually the folder containing all the raw BDALTI tiles downloaded from IGN website. It can also be a list of filepaths or xarray variables. It can also be a single filepath or xarray variable.

to_filebool or path (str or pathlib.Path), default False

If True and if data is a path (str or pathlib.Path), the resulting dataset will be exported to the same location as data, with the name ‘BDALTIV2_stz.tif’. If to_file is a path, the resulting dataset will be exported to this specified filepath.

Returns#

data_dsxarray.Dataset

Standardized DEM.

If to_file argument is used, the standardized DEM is exported to a file. If to_file = True, the standardized DEM is exported to the GeoTIFF file ‘BDALTIV2_stz.tif’.

Examples#

>>> stzfr.bdalti(
    r"E:\Inputs\DEM\IGN\BDALTIV2_2-0_25M_ASC_LAMB93-IGN69", 
    to_file = True
    )
Exporting...
   _ Success: The data has been exported to the file 'E:\Inputs\DEM\IGN\BDALTIV2_2-0_25M_ASC_LAMB93-IGN69_PAYS_BASQUE\BDALTIV2_stz.tif'
<xarray.Dataset> Size: 252MB
Dimensions:      (x: 7000, y: 9000)
Coordinates:
  * x            (x) float64 56kB 3e+05 3e+05 3e+05 ... 4.75e+05 4.75e+05
  * y            (y) float64 72kB 6.4e+06 6.4e+06 ... 6.175e+06 6.175e+06
    spatial_ref  int64 8B 0
Data variables:
    elev         (y, x) float32 252MB nan nan nan nan nan ... nan nan nan nan