src.geoserver.netcdf_layers

Functions for serving NetCDF layers via geoserver.

Attributes

_xml_header

Functions

create_layer_from_nc_store(→ None)

Create a GeoServer Layer from a GeoServer NetCDF store, making it ready to serve.

add_nc_to_geoserver(→ None)

Upload a NetCDF file to GeoServer, ready for serving to clients.

Module Contents

src.geoserver.netcdf_layers._xml_header
src.geoserver.netcdf_layers.create_layer_from_nc_store(geoserver_url: str, layer_name: str, workspace_name: str, band_name: str) None

Create a GeoServer Layer from a GeoServer NetCDF store, making it ready to serve.

Parameters:
  • geoserver_url (str) – The URL to the geoserver instance.

  • layer_name (str) – Defines the name of the layer in GeoServer.

  • workspace_name (str) – The name of the existing GeoServer workspace that the store is to be added to.

  • band_name (str) – The name of the band within the NetCDF file to serve.

Raises:

HTTPError – If geoserver responds with an error, raises it as an exception since it is unexpected.

src.geoserver.netcdf_layers.add_nc_to_geoserver(nc_filepath: pathlib.Path, band_name: str, workspace_name: str, model_id: int) None

Upload a NetCDF file to GeoServer, ready for serving to clients.

Parameters:
  • nc_filepath (pathlib.Path) – The filepath to the NetCDF file to be served.

  • band_name (str) – The name of the NetCDF band/layer getting served

  • workspace_name (str) – The name of the existing GeoServer workspace that the store is to be added to.

  • model_id (int) – The id of the model being added, to facilitate layer naming.