We have a GeoServer 2.18.2 instance serving data from PostGIS that seems to return a different structure for DescribeFeatureType requests depending on the outputFormat specified in the request.

One of our database tables which is published via GeoServer has 7 column names: [id, geom, code, name, enw, inset_no, category], nothing out of the ordinary. Making a WFS DescribeFeatureType to GeoServer for this and including outputFormat=application/json provides a complete description of the feature including all of the above attributes from the underlying table. However, if outputFormat is omitted so that GeoServer returns a GML3.2 response, then the name attribute is completely missing from the result.

There are no errors in the log from GeoServer when making these requests and any GetFeature requests against the same data source include the name attribute as expected. It is only DescribeFeatureType requests that seem to be affected, which causes a problem for some clients such as QGIS that use a DescribeFeatureType call to set up a layer. Prefixing the database column and reloading the feature type in GeoServer makes the attribute appear in responses but this feels like a workaround.

Is this expected behaviour from GeoServer or am I seeing a bug?

  • 1
    Name is a restricted attribute name in XML so it gets removed. I think there is a way to turn it off but I can recall what it is – Ian Turton Feb 25 at 17:31

As far as I know, you are not seeing a bug. The schema reports anything in addition to the attributes already inherited from "gml:Feature", which already contains a "gml:name" attribute.

If the output of a GetFeature has a "gml:name" attribute with the value in your table, then everything fits and declaring the attribute in DescribeFeatureType is not necessary (not 100% sure, but believe it would be a mistake).

If you don't like the usage of "gml:name", check the "Override GML Attributes" in the WFS configuration panel for the version of GML you're requesting:

enter image description here

  • Thanks Andrea, gml:StandardObjectProperties in the GML 3.2.1 schema also appears to contain gml:description and gml:identifier, and any database columns with the same name aren't provided in a DescribeFeatureType response either. That's definitely the reason for this, so we'll stick with the suggestion to override the GML attributes. – Wrass Feb 26 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.