-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
GSIP 234
This proposal introduces support for defining, advertising, and enforcing restrictions on feature type attributes in GeoServer. The goal is to improve data integrity and support clients by:
- Allowing administrators to configure restrictions on feature attributes (e.g., enumerations, min/max ranges).
- Advertising these restrictions to clients via
DescribeFeatureTypeusing standard XML Schema restrictions. - Enforcing the restrictions during write operations (e.g., WFS-T, REST API).
Alessandro Ricchiuti
This proposal is for GeoServer 2.27.
- Under Discussion
- In Progress
- Completed
- Rejected
- Deferred
GeoServer currently lacks:
- A standardized way to expose attribute-level value restrictions to clients.
- Server-side enforcement of such restrictions on data writes.
- An API for programmatic constraint configuration.
Adding these capabilities will:
- Improve data quality by preventing invalid inputs.
- Enable client applications (e.g., MapStore, GeoNode) to provide appropriate user interfaces (e.g., dropdowns, numeric bounds).
- Ensure consistent behavior across services and interfaces.
Extend the AttributeTypeInfo model to support:
- Enumerations of valid values for
stringandintattributes. - Minimum and maximum inclusive bounds for numeric types.
Restrictions will be defined per attribute and stored persistently in the featuretype.xml.
Modify the WFS DescribeFeatureType response to include attribute restrictions using standard XSD restriction elements:
-
xsd:simpleTypewithxsd:restrictionover the base type -
xsd:enumerationfor fixed values -
xsd:minInclusive/xsd:maxInclusivefor numeric ranges
Example:
<xsd:element name="status" minOccurs="1" maxOccurs="1" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:enumeration value="ACTIVE"/>
<xsd:enumeration value="INACTIVE"/>
<xsd:enumeration value="UNKNOWN"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element><xsd:element name="value" minOccurs="1" maxOccurs="1" nillable="false">
<xsd:simpleType>
<xsd:restriction base="xsd:float">
<xsd:minInclusive value="0.0"/>
<xsd:maxInclusive value="100.0"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>Extend GeoServer's data validation pipeline to enforce the defined restrictions when receiving data write requests via:
- WFS-T (Insert/Update)
- REST API (PUT/POST)
Restriction compliance checks will occur in GeoserverFeatureStore to centrally ensure consistent enforcement
regardless of service or store.
Enhance the GeoServer admin UI to allow configuring attribute-level restrictions (enumeration, min/max) through the
FeatureType editor.
The main idea is to move all the editable HTML fields for the attributes in a dedicated pop-up.
The Feature Type Details table will be made not-editable.

Then, a click on the Edit icon will open a pop-up, to edit the feature type details.
The selection of a specific constraint depends on the type of the attribute.
Example for a "Range" restriction:

Example for an "Options" restriction:

This solution will be aimed to maintain the following:
- Fully backward-compatible: restrictions are optional.
-
DescribeFeatureTypeoutput remains valid XSD.
Project Steering Committee:
- Alessio Fabiani: +1
- Andrea Aime: +1
- Ian Turton: +1
- Jody Garnett: +1
- Jukka Rahkonen:
- Kevin Smith:
- Simone Giannecchini: +0
- Torben Barsballe: +1
- Nuno Oliveira: +1
- Peter Smythe: +0
©2022 Open Source Geospatial Foundation