GeoserverConfig.Coverages (GeoserverConfig v0.4.0)

Copy Markdown View Source

Provides functionality for managing GeoServer coverages via the REST API.

All functions require a GeoserverConfig.Connection as their first argument.

Summary

Functions

Creates a new coverage (raster layer) in the specified coverage store.

Deletes a coverage layer from a workspace and coverage store.

Lists all coverages for a given workspace and coverage store.

Functions

create_coverage(conn, workspace, coverage_store, coverage_name, params, file_path)

Creates a new coverage (raster layer) in the specified coverage store.

Parameters

  • conn — a GeoserverConfig.Connection
  • workspace — the workspace name
  • coverage_store — the coverage store name
  • coverage_name — desired name of the coverage
  • params — metadata map with keys: :title, :srs, :native_bbox, :latlon_bbox, :grid, and optionally :description, :abstract, :native_crs, :metadata, :enabled
  • file_path — URL or file path of the GeoTIFF/COG

Returns

  • {:ok, coverage_name} on success
  • {:error, {:http_error, status, body}} on failure
  • {:error, {:request_failed, reason}} on transport error

delete_coverage(conn, workspace, coverage_store, coverage_name, recurse \\ false)

Deletes a coverage layer from a workspace and coverage store.

Parameters

  • conn — a GeoserverConfig.Connection
  • workspace — the workspace name
  • coverage_store — the coverage store name
  • coverage_name — name of the coverage to delete
  • recurse — if true, also deletes linked resources (default: false)

Returns

  • {:ok, coverage_name} on success
  • {:error, {:not_found, coverage_name}} when the coverage does not exist
  • {:error, {:http_error, status, body}} on other HTTP failure
  • {:error, {:request_failed, reason}} on transport error

list_coverages(conn, workspace, coverage_store)

Lists all coverages for a given workspace and coverage store.

Returns

  • {:ok, [coverage]} on success
  • {:error, :unexpected_format, body} when the response body is unrecognised
  • {:error, {:http_error, status, body}} on non-200 response
  • {:error, {:request_failed, reason}} on transport error