Provides functions to manage GeoServer feature types (vector layers) via its REST API.
Feature types are vector-based spatial resources that originate from datastores. This module handles listing, creating, updating, and deleting feature types.
Summary
Functions
Creates a new feature type (vector layer) in the specified datastore.
Creates a new feature type in the default data store for the workspace.
Deletes a feature type from the given datastore.
Deletes a feature type from the default data store for the workspace.
Fetches a single feature type by name from the given workspace and datastore.
Fetches a single feature type from the given workspace (across all datastores).
Lists all feature types in a given datastore and workspace.
Lists all feature types across all datastores in the given workspace.
Resets the caches related to this specific feature type.
Updates an existing feature type.
Updates a feature type in the default data store for the workspace.
Functions
Creates a new feature type (vector layer) in the specified datastore.
Parameters
params: Map containing feature type configuration including:title: Human-readable titledescription: Descriptionabstract: Abstract textsrs: Coordinate reference system (e.g., "EPSG:4326")native_crs: Native CRSnative_bbox: Native bounding box as %{minx: x, maxx: x, miny: y, maxy: y}latlon_bbox: Lat/lon bounding boxenabled: Boolean (default: true)keywords: List of keywordsmetadata: Additional metadataprojection_policy:"FORCE_DECLARED","NONE", or"REPROJECT_TO_DECLARED"max_features: Maximum number of features returnednum_decimals: Number of decimal placescql_filter: CQL filter expressionoverriding_service_srs: Booleanskip_number_matched: Booleancircular_arc_present: Booleanlinearization_tolerance: Tolerance valuemetadata_links: List of metadata link mapsdata_links: List of data link mapsresponse_srs: SRS for response (defaults to[params.srs])
Returns
{:ok, feature_type_name}on success{:error, reason}on failure
Creates a new feature type in the default data store for the workspace.
The feature type definition must reference a store.
Parameters
params: Same map ascreate_featuretype/5, plus optionally:store: Map with:nameto specify the target data store
Returns
{:ok, feature_type_name}on success{:error, reason}on failure
Deletes a feature type from the given datastore.
Parameters
recurse: If true, also deletes dependent layers (default: false)
Returns
{:ok, feature_type_name}on success{:error, {:http_error, status, body}}on failure{:error, {:request_failed, message}}on transport error
Deletes a feature type from the default data store for the workspace.
Parameters
recurse: If true, also deletes dependent layers (default: false)
Returns
{:ok, feature_type_name}on success{:error, {:http_error, status, body}}on failure{:error, {:request_failed, message}}on transport error
Fetches a single feature type by name from the given workspace and datastore.
Options
:quiet_on_not_found— whentrue, avoids logging an exception on 404 (default:false)
Returns
{:ok, featuretype}on success (a map with feature type details){:error, {:http_error, status, body}}on non-200 response{:error, exception}on transport error
Fetches a single feature type from the given workspace (across all datastores).
Options
:quiet_on_not_found— whentrue, avoids logging an exception on 404
Returns
{:ok, featuretype}on success{:error, {:http_error, status, body}}on failure{:error, exception}on transport error
Lists all feature types in a given datastore and workspace.
Parameters
list: Optional parameter to filter results. Can be::configured- Only configured feature types (default):available- Only available but not configured feature types:available_with_geom- Available feature types with geometry:all- All feature types
Returns
{:ok, [feature_types]}on success{:error, {:http_error, status, body}}on non-200 response{:error, exception}on transport error
Lists all feature types across all datastores in the given workspace.
Parameters
list: Optional filter. Can be::configured— Only configured feature types (default):available— Only available but not configured feature types:available_with_geom— Available feature types with geometry:all— All feature types
Returns
{:ok, [feature_types]}on success{:error, {:http_error, status, body}}on non-200 response{:error, exception}on transport error
Resets the caches related to this specific feature type.
This forces GeoServer to drop cached feature type structures and recompute them on the next request. Attributes configuration is not changed.
Returns
{:ok, feature_type_name}on success{:error, {:http_error, status, body}}on failure{:error, {:request_failed, message}}on transport error
Updates an existing feature type.
Parameters
params: Map containing updated feature type propertiesrecalculate: Optional parameter to recalculate bounding boxes
Returns
{:ok, feature_type_name}on success{:error, {:http_error, status, body}}on failure{:error, {:request_failed, message}}on transport error
Updates a feature type in the default data store for the workspace.
Parameters
params: Same map asupdate_featuretype/5recalculate: Optional parameter to recalculate bounding boxes
Returns
{:ok, feature_type_name}on success{:error, {:http_error, status, body}}on failure{:error, {:request_failed, message}}on transport error