export#

geobricks.export(data, output_filepath, **kwargs)[source]#

Export any geospatial dataset (file or GEOP4TH variable) to a file. Note that if the export implies a rasterization or a vectorization, it will not be handled by this function. It is necessary instead to use the rasterize() function (or its related super-function transform()). Vectorization is not yet implemented in GEOP4TH.

Parameters#

datapath (str or pathlib.Path), or variable (xarray.Dataset, xarray.DataArray, geopandas.GeoDataFrame, pandas.DataFrame or numpy.array)

Dataset that will be exported to output_filepath.

Note that data will be loaded into a standard GEOP4TH variable:

  • all vector data (GeoPackage, shapefile, GeoJSON) will be loaded as a geopandas.GeoDataFrame

  • all raster data (ASCII, GeoTIFF) and netCDF will be loaded as a xarray.Dataset

  • other data will be loaded either as a pandas.DataFrame (CSV and JSON) or as a numpy.array (TIFF)

output_filepathstr or pathlib.Path

Full filepath (must contains location folder, name and extension) of the file to be exported. For instance: r”D:resultsexportedData.tif”

**kwargs :

Additional arguments that can be passed to geopandas.GeoDataFrame.to_file(), xarray.Dataset.to_netcdf(), xarray.Dataset.rio.to_raster(), pandas.DataFrame.to_csv() or pandas.DataFrame.to_json(), depending of the specified file extension.

Returns#

None. The data is exported to the specified file.