Skip to content

Feature types

A feature type is a vector based spatial resource or data set that originates from a data store. In some cases, such as with a shapefile, a feature type has a one-to-one relationship with its data store. In other cases, such as PostGIS, the relationship of feature type to data store is many-to-one, feature types corresponding to a table in the database.

/workspaces/<ws>/datastores/<ds>/featuretypes[.<format>]

Controls all feature types in a given data store / workspace.

Method Action Status code Formats Default Format Parameters
GET List all feature types in data store ds 200 HTML, XML, JSON HTML list
POST Create a new feature type, see note below 201 with Location header XML, JSON
PUT 405
DELETE 405

featuretypes POST

When creating a new feature type via POST, if no underlying dataset with the specified name exists an attempt will be made to create it. This will work only in cases where the underlying data format supports the creation of new types (such as a database). When creating a feature type in this manner the client should include all attribute information in the feature type representation.

Exceptions

Exception Status code
GET for a feature type that does not exist 404
PUT that changes name of feature type 403
PUT that changes data store of feature type 403

Parameters

list

The list parameter is used to control the category of feature types that are returned. It can take one of the following values:

  • configured---Only configured feature types are returned. This is the default value.
  • available---Only feature types that haven't been configured but are available from the specified data store will be returned.
  • available_with_geom---Same as available but only includes feature types that have a geometry attribute.
  • all---The union of configured and available.

/workspaces/<ws>/datastores/<ds>/featuretypes/<ft>[.<format>]

Controls a particular feature type in a given data store and workspace.

Method Action Status code Formats Default Format Parameters
GET Return feature type ft 200 HTML, XML, JSON HTML quietOnNotFound
POST 405
PUT Modify feature type ft 200 XML,JSON recalculate
DELETE Delete feature type ft 200 recurse

Exceptions

Exception Status code
GET for a feature type that does not exist 404
PUT that changes name of feature type 403
PUT that changes data store of feature type 403

Parameters

recurse

The recurse parameter recursively deletes all layers referenced by the specified featuretype. Allowed values for this parameter are "true" or "false". The default value is "false". A DELETE request with recurse=false will fail if any layers reference the featuretype.

recalculate

The recalculate parameter can be used specifiy which feature type properties (nativebbox,latlonbbox,attributes) to recalculate when processing the request, or to control automatic recalculating.

Feature type properties recalculated automatically when necessary (if not included in the Request):

  • nativebbox is recalculated when the projection or projection policy changes.
  • latlonbbox is recalculated when nativebbox is recalculated, or when a new nativebbox is explicitly provided in the request.

To force recalculation use recalculate to provide a comma-separated list of feature type properties:

  • recalculate=attributes: Reload the feature type attributes from the underlying data source. This is required when the source schema has changed, for example when columns have been added, removed, renamed, or otherwise modified. The underlying schema must be updated before this operation is invoked.
  • recalculate=nativebbox: Recalculate the native bounding box, but do not recalculate the lat/long bounding box.
  • recalculate=nativebbox,latlonbbox: Recalculate both the native bounding box and the lat/long bounding box.
  • recalculate=attributes,nativebbox,latlonbbox: Reload the feature type attributes and recalculate both the native and lat/long bounding boxes.
  • recalculate= (empty parameter): Do not recalculate any properties, regardless of changes to the projection, projection policy, or other feature type settings. This may be useful for avoiding slow calculations when operating against large datasets.

Projection Policy

When specifying the Projection Policy in a FeatureType defined in the request body, the internal name should be used instead of the one available on the UI. The following table shows the correspondence between display and internal names:

Display Name Internal Name
Force declared FORCE_DECLARED
Keep native NONE
Reproject native to declared REPROJECT_TO_DECLARED

quietOnNotFound

The quietOnNotFound parameter avoids to log an Exception when the feature type is not present. Note that 404 status code will be returned anyway.