[Geoserver-users] describeFeature question, accepted values for a property.

Hello,
is there a way to set a property in a featureType stored in postgis to only accept certain values and then be able to describe this en the xml returned by the describeFeature Reponse?
For example, I have a layer of streets, where each street has a property named “street quality” and the accepted values are “very good”, “good”, “poor” and “very poor”. How can I reflect this constraint with the describeFeature method of the WFS protocol?

muchas gracias!!

Nicolás Badano ha scritto:

Hello,
is there a way to set a property in a featureType stored in postgis to only accept certain values and then be able to describe this en the xml returned by the describeFeature Reponse?
For example, I have a layer of streets, where each street has a property named "street quality" and the accepted values are "very good", "good", "poor" and "very poor". How can I reflect this constraint with the describeFeature method of the WFS protocol?

GeoServer has no direct way to allow you do what you ask.
You'd need to specify your own hand made schema with string restrictions, which can be done, but it's not supported, mind:
- for wfs 1.0 responses, put a schema.xml file with your hand modified
   schema in the feature type configuration directory, that is,
   $GEOSERVER_DATA_DIR/yourFeatureTypeName/schema.xml.
   for wfs 1.1 responses, put a schema.xsd file in the same directory
- if you're using a database as the backend, add check contraints on
   your table so that only the above values can be used.

Hope this helps
Cheers
Andrea